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

VolumeSnapshot cannot be deleted when the VolumeSnapshotClass is missing #306

Closed
ialidzhikov opened this issue Apr 26, 2020 · 20 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@ialidzhikov
Copy link
Contributor

ialidzhikov commented Apr 26, 2020

What happened:
Checking the changelog, there is #275 which should allow deletion of VolumeSnapshot when the VolumeSnapshotClass is missing, but this is not happening.

What you expected to happen:
I would expect to be able to delete VolumeSnapshot when its .spec.volumeSnapshotClassName is missing.

How to reproduce it (as minimally and precisely as possible):

  1. Create PVC
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: source-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 6Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: source-pod
spec:
  containers:
  - name: busybox
    image: busybox
    command: ["/bin/sh", "-c"]
    args: ["touch /demo/data/sample-file.txt && sleep 3000"]
    volumeMounts:
    - name: source-data
      mountPath: /demo/data
  volumes:
  - name: source-data
    persistentVolumeClaim:
      claimName: source-pvc
      readOnly: false
  1. Create a VolumeSnapshot.
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass
metadata:
  annotations:
    snapshot.storage.kubernetes.io/is-default-class: "true"
  name: default-snapshot-class
driver: ebs.csi.aws.com
deletionPolicy: Delete
---
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
  name: snapshot-source-pvc
spec:
  volumeSnapshotClassName: default-snapshot-class
  source:
    persistentVolumeClaimName: source-pvc
  1. Delete the VolumeSnapshotClass.
$ k get volumesnapshotclasses.snapshot.storage.k8s.io
NAME                     DRIVER            DELETIONPOLICY   AGE
default-snapshot-class   ebs.csi.aws.com   Delete           2d2h

$ k delete volumesnapshotclasses.snapshot.storage.k8s.io default-snapshot-class
volumesnapshotclass.snapshot.storage.k8s.io "default-snapshot-class" deleted
  1. Delete the VolumeSnasphot and ensure its deletion fails:
$ k delete volumesnapshot snapshot-source-pvc
volumesnapshot.snapshot.storage.k8s.io "snapshot-source-pvc" deleted
$ k describe volumesnapshot snapshot-source-pvc

Events:
  Type     Reason                  Age    From                 Message
  ----     ------                  ----   ----                 -------
  Warning  GetSnapshotClassFailed  8m26s  snapshot-controller  Failed to get snapshot class with error volumesnapshotclass.snapshot.storage.k8s.io "default-snapshot-class" not found

Anything else we need to know?:

Environment:

  • Version: v2.1.0
@ialidzhikov
Copy link
Contributor Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 26, 2020
@xing-yang
Copy link
Collaborator

#275 only fixed it in the snapshot controller. There's also a place in the csi snapshotter sidecar that needs to be fixed. There's WIP PR to address this: #287

@ialidzhikov
Copy link
Contributor Author

I see that #287 is merged. But it is still not included in any release, right?

@xing-yang
Copy link
Collaborator

Not yet. We are still waiting for a few PRs to be merged before cutting the next release.

@ialidzhikov
Copy link
Contributor Author

@xing-yang , is there a target date for the v2.2.0 release?

@xing-yang
Copy link
Collaborator

I'm mainly waiting for 2 changes to get in before cutting the release:

@vpnachev
Copy link

vpnachev commented Sep 14, 2020

Hello @xing-yang, I see that the linked PRs are merged now and most of them are part of 2.2.0-rcX releases. For when do you plan to cut the final 2.2.0 release?

@xing-yang
Copy link
Collaborator

There are still a couple of PRs pending. Also waiting for this changelog PR to be merged: #332

@xing-yang
Copy link
Collaborator

Release 3.0.0 is cut. Closing this issue.

@ialidzhikov
Copy link
Contributor Author

@xing-yang , I see that #287 is not cherry-picked into release-2.1 branch (please correct if I am wrong). Is there any chance to have #287 PR cherry-picked into release-2.1?

@ialidzhikov
Copy link
Contributor Author

@xing-yang , I see that #287 is not cherry-picked into release-2.1 branch (please correct if I am wrong). Is there any chance to have #287 PR cherry-picked into release-2.1?

@xing-yang @msau42 any feedback on the above question?

@xing-yang
Copy link
Collaborator

We could. @ialidzhikov do you want to submit a PR to backport this fix to release-2.1?

@ialidzhikov
Copy link
Contributor Author

We could. @ialidzhikov do you want to submit a PR to backport this fix to release-2.1?

#466

@ialidzhikov
Copy link
Contributor Author

Reopen as the cherry-pick for release-2.1 is still pending.

/reopen
/priority important-soon

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Feb 8, 2021
@k8s-ci-robot k8s-ci-robot reopened this Feb 8, 2021
@k8s-ci-robot
Copy link
Contributor

@ialidzhikov: Reopened this issue.

In response to this:

Reopen as the cherry-pick for release-2.1 is still pending.

/reopen
/priority important-soon

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.

@ialidzhikov
Copy link
Contributor Author

Hello @xing-yang 👋

I see that the cherry-pick PR is now merged. Is there a release date (ETA) for [email protected] patch release? In Gardener project (https://github.com/gardener) we are looking forward to it! Many thanks in advance and appreciate your support!

@xing-yang
Copy link
Collaborator

I'm working on the release.

@ialidzhikov
Copy link
Contributor Author

@xing-yang , thank you for the release!

@ialidzhikov
Copy link
Contributor Author

/close

@k8s-ci-robot
Copy link
Contributor

@ialidzhikov: Closing this issue.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

4 participants