vmware-tanzu / velero-plugin-for-vsphere

Plugin to support Velero on vSphere
Other
58 stars 50 forks source link

Backup failed if the length of backup name > 64 #370

Open ywk253100 opened 2 years ago

ywk253100 commented 2 years ago

If we create a backup with name > 64 characters(e.g. backup-bsl-e7a1d0f3-2f29-4d80-9184-6214dac91d96-e7a1d0f3-2f29-4d80-9184-6214dac91d96), will get the following error:

Failed to create snapshot record: Snapshot.backupdriver.cnsdp.vmware.com "snap-8945e7df-069e-4f56-aeb5-75b1dd87547f" is invalid: metadata.labels: Invalid value: "backup-bsl-e7a1d0f3-2f29-4d80-9184-6214dac91d96-e7a1d0f3-2f29-4d80-9184-6214dac91d96": must be no more than 63 characters"

plugin version: v1.1.1

lintongj commented 2 years ago

It is not pretty much a bug, but a known issue in velero-plugin-for-vsphere. We should have put it in our documentation though.

Basically, we put backup name as a label in Snapshot CRD for the convenience of back referencing, https://github.com/vmware-tanzu/velero-plugin-for-vsphere/blob/fac6530fdc429c00119fe76972620943871843ae/pkg/plugin/backup_pvc_action_plugin.go#L147. And kubernetes labels have the constraint of 63 characters, https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/.