-
Notifications
You must be signed in to change notification settings - Fork 382
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
Get credentials before checking if the SnapshotClass exists #423
Get credentials before checking if the SnapshotClass exists #423
Conversation
// that the content can be deleted if this class no longer exists. | ||
snapshotterCredentials, err := ctrl.GetCredentialsFromAnnotation(content) | ||
if err != nil { | ||
return nil, nil, err |
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.
This will affect snapshot creation. We need to have SnapshotClass for snapshot creation.
Instead of making changes to getCSISnapshotInput
, we can make a change in deleteCSISnapshotOperation
.
Replace the call _, snapshotterCredentials, err := ctrl.getCSISnapshotInput(content)
with snapshotterCredentials, err := ctrl.GetCredentialsFromAnnotation(content)
as we only need to get credentials from annotation at delete snapshot time.
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.
Thanks for the quick review! I'll make the changes now.
28dad41
to
60c478e
Compare
Can you update the PR description? |
This has been done. |
60c478e
to
0f3fa91
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huffmanca, xing-yang 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
If a CSIDriver requires credentials, but the VolumeSnapshotClass has been deleted, then the VolumeSnapshotContent cannot be deleted even though it contains a reference to the credentials in its own annotations.
This PR grabs the credentials instead of checking to see if the VolumeSnapshotClass exists, so that we can delete VolumeSnapshotContent objects if the secret annotation is on the VolumeSnapshotContent.
Which issue(s) this PR fixes:
Fixes #412
Special notes for your reviewer:
Does this PR introduce a user-facing change?: