Velero panics on delete backup request when done using the API #1546
Description
What steps did you take and what happened:
On sending a delete backup request using the API, Velero panics.
Here is the payload of the request -
{"kind":"DeleteBackupRequest","apiVersion":"velero.io/v1","metadata":{"name":"k8s-job-21","namespace":"velero"},"spec":{"backupName":"k8s-job-21"}}
What did you expect to happen:
Backup deletion is successful.
The output of the following commands will help us better understand what's going on:
(Pasting long output into a GitHub gist or other pastebin is fine.)
-
kubectl logs deployment/velero -n velero
https://pastebin.com/U6etiCQF -
velero backup describe <backupname>
orkubectl get backup/<backupname> -n velero -o yaml
velero describe backup k8s-job-21
Name: k8s-job-21
Namespace: velero
Labels: velero.io/storage-location=magneto-0-1-7-ext
Annotations:
Phase: Completed
Namespaces:
Included: nginx-example
Excluded:
Resources:
Included: *
Excluded:
Cluster-scoped: excluded
Label selector:
Storage Location: magneto-0-1-7-ext
Snapshot PVs: auto
TTL: 0s
Hooks:
Backup Format Version: 1
Started: 2019-06-05 11:21:28 -0700 PDT
Completed: 2019-06-05 11:21:32 -0700 PDT
Expiration: 0001-01-01 00:00:00 +0000 UTC
Persistent Volumes:
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
@skriss debugged the issue and determined that delete requests need to have a label else Velero panics.
Environment:
-
Velero version (use
velero version
):
velero version
Client:
Version: v1.0.0
Git commit: 72f5cad
Server:
Version: v0.11.0 -
Kubernetes version (use
kubectl version
):
kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:23:09Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"} -
Kubernetes installer & version:
Minikube -
OS (e.g. from
/etc/os-release
):
18.04.1-Ubuntu