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

Should set snapshot.storage.kubernetes.io/deletion-secret-name(space) annotation automatically to VolumeSnapshotContent when importing an exists snapshot #251

Closed
bells17 opened this issue Feb 10, 2020 · 7 comments
Assignees

Comments

@bells17
Copy link
Contributor

bells17 commented Feb 10, 2020

Hi, I think it should set snapshot.storage.kubernetes.io/deletion-secret-name(space) annotation automatically to VolumeSnapshotContent when importing an exists snapshot.

Now, If your CSI driver uses VolumeSnapshotClass Secrets in DeleteSnapshot RPC, may DeleteSnapshot is failed.
Because the VolumeSnapshotClass Secrets don't be used when requesting the DeleteSnapshot RPC call.

If you want to use VolumeSnapshotClass Secrets in DeleteSnapshot RPC, You need to set snapshot.storage.kubernetes.io/deletion-secret-name(space) annotation manually to VolumeSnapshotContent.

But if VolumeSnapshotContent is created from VolumeSnapshot, snapshot.storage.kubernetes.io/deletion-secret-name(space) annotation annotation set automatically to VolumeSnapshotContent.

So I think it should set snapshot.storage.kubernetes.io/deletion-secret-name(space) annotation automatically to VolumeSnapshotContent when importing an exists snapshot.

If annotations are set automatically, users don't need to think about annotations when importing an existing snapshot.

@xing-yang
Copy link
Collaborator

Yes, it makes sense to set deletion secret annotation for pre-provisioned snapshots as well.

I think it should be added in this routine and secrets should be retrieved from snapshotClass on the content for pre-provisioned case (same as ListSnapshots secret):
https://github.com/kubernetes-csi/external-snapshotter/blob/master/pkg/sidecar-controller/snapshot_controller.go#L261

One thing we need to decide is how to handle the case where annotation is already applied. For example, a snapshot was dynamically provisioned and secret annotation was added to the content. This content has Retain policy. User deletes VolumeSnapshot. Content remains. User changes the snapshotClassName or secrets in snapshotClass associated with the content. User creates a new VolumeSnapshot to bind with the existing content. At this time, should we keep the original annotation or modify it with the new one.

@xing-yang
Copy link
Collaborator

CC @msau42

@msau42
Copy link
Collaborator

msau42 commented Mar 4, 2020

In terms of responsibility, I think we currently have some clear boundaries:

  • When dynamically provisioning a snapshot, it's the snapshot controller that creates and owns the SnapshotContent object. The only thing the controller can modify is the Status.
  • When manually importing a snapshot, it's the admin that creates and owns the object.

I don't think we should mix responsibilities and have the controller modify the Content object.

This is the same behavior for PVs. If someone manually creates a PV object, they need to manually fill in all the fields.

@humblec
Copy link
Contributor

humblec commented May 6, 2020

I agree with @msau42 here, with that, this is no longer an issue or we dont have to fix something here. Can we close this @bells17 ?

@humblec
Copy link
Contributor

humblec commented May 6, 2020

/assign @humblec

@bells17
Copy link
Contributor Author

bells17 commented May 14, 2020

Thank you for response @xing-yang @msau42.
I understand.

@humblec Yes, I closed this issue. Thank you for notification.

@bells17 bells17 closed this as completed May 14, 2020
@humblec
Copy link
Contributor

humblec commented May 14, 2020

Thanks @bells17 👍

bells17 added a commit to bells17/external-snapshotter that referenced this issue May 10, 2024
edd89ad Merge pull request kubernetes-csi#251 from jsafrane/add-logcheck
043fd09 Add test-logcheck target
d7535ae Merge pull request kubernetes-csi#250 from jsafrane/go-1.22
b52e7ad Update go to 1.22.2
14fdb6f Merge pull request kubernetes-csi#247 from msau42/prow
9b4352e Update release playbook
c7bb972 Fix release notes script to use fixed tags
463a0e9 Add script to update specific go modules

git-subtree-dir: release-tools
git-subtree-split: edd89ad
jsafrane added a commit to jsafrane/external-snapshotter that referenced this issue May 13, 2024
adb3af9 Merge pull request kubernetes-csi#252 from bells17/update-go-version
b82ee38 Merge pull request kubernetes-csi#253 from bells17/fix-typo
c317456 Fix typo
0a78505 Bump to Go 1.22.3
edd89ad Merge pull request kubernetes-csi#251 from jsafrane/add-logcheck
043fd09 Add test-logcheck target
d7535ae Merge pull request kubernetes-csi#250 from jsafrane/go-1.22
b52e7ad Update go to 1.22.2
14fdb6f Merge pull request kubernetes-csi#247 from msau42/prow
9b4352e Update release playbook
c7bb972 Fix release notes script to use fixed tags
463a0e9 Add script to update specific go modules

git-subtree-dir: release-tools
git-subtree-split: adb3af9
andyzhangx pushed a commit to andyzhangx/external-snapshotter that referenced this issue Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants