kubernetes-sigs / azurelustre-csi-driver

Apache License 2.0
12 stars 22 forks source link

Skip subdirectory creation for invalid volume ID #156

Closed dabradley closed 9 months ago

dabradley commented 9 months ago

The only reasonable way that the unpublish command can determine whether to keep or delete the subdirectory, if given, is to bake this information into the volume ID, as the original volume context is not passed to volume unpublish calls. For dynamically created volumes, this is always consistent. However, if the end user defines their own volumes, but does not follow the expected volume handle / volume ID form, that information is not available. In this instance, if the user sets the retain-sub-dir value on a manually created volume to 'false', we will error out and refuse to create the volume. If they request that the subdirectory be retained, we will treat the volume as we do a read-only volume, where we will attempt to mount the given subdirectory, but will not do any logic associated with creating or deleting that subdirectory. As with a read-only volume, if that subdirectory does not exist on the cluster, the mount will fail with a reasonable error.

What type of PR is this? /kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer: This PR is based on https://github.com/kubernetes-sigs/azurelustre-csi-driver/pull/155 and will be in draft until that is merged.

Release note:

none
dabradley commented 9 months ago

@joe-atzinger Could you take a look at this PR? It's based on https://github.com/kubernetes-sigs/azurelustre-csi-driver/pull/155 so I'm leaving it a draft, but I'd like this to go in as soon as that's done

k8s-ci-robot commented 9 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dabradley, joe-atzinger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/azurelustre-csi-driver/blob/main/OWNERS)~~ [dabradley,joe-atzinger] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment