-
Notifications
You must be signed in to change notification settings - Fork 560
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
Added checks to make sure delete-access-point should not delete entir… #1201
base: master
Are you sure you want to change the base?
Added checks to make sure delete-access-point should not delete entir… #1201
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mskanth972 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:
Approvers can indicate their approval by writing |
@@ -394,11 +395,28 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) | |||
} | |||
} | |||
|
|||
klog.V(2).Infof("Access point root directory : %s", accessPoint.AccessPointRootDir) | |||
if accessPoint.AccessPointRootDir == "/" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when accessPoint.AccessPointRootDir
is an empty string? (The field seems not mandatory when creating an AP, so could in rare cases be empty).
According to my understanding the efs-plugin mounts the entire filesystem in /var/lib/csi/pv/<fsap-id>
and later calls os.RemoveAll(target, accessPoint.AccessPointRootDir)
. Now if accessPoint.AccessPointRootDir
is empty, the left-over path for os.RemoveAll
is /var/lib/csi/pv/<fsap-id>
which represents the entire filesystem. I'm I right with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pull AccessPointRootDir from an API call to the AWS EFS console API:
aws-efs-csi-driver/pkg/driver/controller.go
Line 374 in 8b78393
accessPoint, err := localCloud.DescribeAccessPoint(ctx, accessPointId) |
The API layer has empty access point root dirs default to the root path, so an empty access point root dir shouldn't be possible.
But, I agree, we should validate our assumptions and add a check, just in case.
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten Xref: |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten @dobsonj @mskanth972 is anything missing here or why did you not merge it? |
…e EFS
Is this a bug fix or adding new feature?
This is a bug fix
What is this PR about? / Why do we need it?
Added checks to make sure delete-access-point should not delete entire EFS
What testing is done?