Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSI driver] Implementation of staged mount for vhost block and FS volumes in VM mode #1982

Merged

Commits on Sep 23, 2024

  1. cleanup: fix error comparison

    Direct comparison can fail for wrapped errors, use errors.Is(err, target) instead.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    386ab7e View commit details
    Browse the repository at this point in the history
  2. cleanup: Removed unused function arguments

    This way it is more obvious that they are unused and makes the linter happy.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    8d3b571 View commit details
    Browse the repository at this point in the history
  3. cleanup: Fix potential nil pointer dereference

    This is an impossible code path now but someday this can change and
    otherwise function is ready to have nil mnt, so fix one more condition.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    f351ec0 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2024

  1. cleanup: Use import alias to avoid name collision with variable

    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    4b0d3ec View commit details
    Browse the repository at this point in the history
  2. cleanup: Explicitly ignore errors that doesn't matter

    Some errors are expected or don't matter, so ignore them explicitly.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    f6e5fb8 View commit details
    Browse the repository at this point in the history
  3. cleanup: Extract disk.img file creation in separate function

    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    8c4ab66 View commit details
    Browse the repository at this point in the history
  4. CSI staged mount: Separate start endpoint for vhost and NBD

    This will be required later to add staged mount for vhost endpoints
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    76aa3b2 View commit details
    Browse the repository at this point in the history
  5. csi tests: extract values from test calls to variables

    Volume context and capabilities should be reused in Stage and Publish
    Move most of other constants from arguments to variables.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    f06fa6b View commit details
    Browse the repository at this point in the history
  6. staged csi: move dummy img file craation from mount to callers

    This will be used later when part of NodePublish logic for vhost
    endpoints will be moved to NodeStage.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    6f3878a View commit details
    Browse the repository at this point in the history
  7. staged csi: rename getPodId to getInstanceOrPodId

    Before we assumed that pod ID is always present and can be used as a
    part of mount path, but if endpoint is started in NodePublish podId is
    not known. For such cases return staging directory name where endpoint
    will be started.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    6488bba View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2024

  1. staged csi: split endpoint start and mount for volumes that have inst…

    …anceId attribute
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    d93baa5 View commit details
    Browse the repository at this point in the history
  2. staged csi: extract staging path construction to function

    Also rename all socketDir variables to endpointDir for conststency.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    6feb1e1 View commit details
    Browse the repository at this point in the history
  3. staged csi: remove endpointDir construction from mount function

    In most callsites we already know endpointDir, so just accept it as an
    argument instead of rebuilding every time.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    e9c5faf View commit details
    Browse the repository at this point in the history
  4. staged csi: split mounts with old publish scheme and new staged ones

    This keeps apart codepaths that require podId separate from ones that rely on
    instanceID.
    It also allows to remove temporary hack from getInstanceOrPodId and rename
    it back to getPodId.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    6205172 View commit details
    Browse the repository at this point in the history
  5. staged csi: make NodeStageVolume logic a little more explicit

    This way instanceId variable can be used only if it is not empty and
    error handling happens only if any of stage functions was called.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    34e63f1 View commit details
    Browse the repository at this point in the history
  6. staged csi: save volume parameters as json file in stagingTargetPath

    We will need these parameters later to properly stop endpoints during
    NodeUnstage. This also allows to skip unnecessary calls in unstage of
    old volumes.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    f134a8a View commit details
    Browse the repository at this point in the history
  7. staged csi: use per-instance staging directory

    We had all staged disk on the node to be in shared staging directory,
    but now we have all necessary information in stage record to get
    instanceId in NodeUnstage so we can group disks in instance directory.
    
    Old path looked like:
    /...NBS.../sockets/${POD_ID}/${VOLUME_ID}/[nbs,nfs].sock
    
    Intermediate path looked like:
    /...NBS.../sockets/staging/${VOLUME_ID}/[nbs,nfs].sock
    
    New path will look like:
    /...NBS.../sockets/${INSTANCE_ID}/${VOLUME_ID}/[nbs,nfs].sock
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    e3ec3d8 View commit details
    Browse the repository at this point in the history
  8. staged csi: add comment to remember enable check later

    According to spec target directory must be removed after NodeUnstage
    but now mounter mock doesn't delete it during mount point cleanup.
    If directory deletion is enabled then other test breaks because it
    relies on previous tests leaving temoprary directories.
    
    This will be fixed separately form this PR.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    0adefc7 View commit details
    Browse the repository at this point in the history
  9. staged csi: explain how NodeUnpublishVolume works for staged volumes

    We use the same code for all types of volumes in NodeUnpublish because
    we have no good way to get their type.
    Add comment to explain why StopEndpoint calls in NodeUnpublishVolume has no
    effect for staged disks.
    
    Signed-off-by: Anton Kuchin <[email protected]>
    aikuchin committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    e7c8ad8 View commit details
    Browse the repository at this point in the history