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

Delete snapshot command does not check for snapshot's existence #549

Closed
hossainemruz opened this issue Aug 9, 2018 · 0 comments · Fixed by #548
Closed

Delete snapshot command does not check for snapshot's existence #549

hossainemruz opened this issue Aug 9, 2018 · 0 comments · Fixed by #548
Labels

Comments

@hossainemruz
Copy link
Contributor

Observed behaviour:
When we delete a Snapshot with kubectl delete <snapshot-name> command, it show delete successful even if the snapshot does not exist.

For example

$ kubectl delete snapshot default.deployment.stash-demo-36fs0b4b
snapshot.repositories.stash.appscode.com "default.deployment.stash-demo-36fs0b4b" deleted

$ kubectl delete snapshot default.deployment.stash-demo-36fs0b4b
snapshot.repositories.stash.appscode.com "default.deployment.stash-demo-36fs0b4b" deleted

In the first command we delete a snapshot and it success. In second command we try to delete the snapshot again. This time it also success even if the snasphot does not exist.

Expected behaviour:
API server should throw an error showing snapshot not found.

Reason:
Snapshot's existence was not checked in Delete method for snapshot.

tamalsaha pushed a commit that referenced this issue Aug 15, 2018
This PR fixes #549
Task list:
- [x] Check if snapshot exist before delete
- [x] Used `k8s.io/apimachinery/pkg/api/errors`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant