vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.71k stars 1.4k forks source link

Plugins param for velero installation should allow surrounding comma with blank spaces #4190

Open danfengliu opened 3 years ago

danfengliu commented 3 years ago

What steps did you take and what happened: [A clear and concise description of what the bug is, and what commands you ran.)

When install velero with param plugins like this: --plugins harbor-repo.vmware.com/harbor-ci/velero/velero-plugin-for-aws:v1.2.0, vsphereveleroplugin/velero-plugin-for-vsphere:v1.1.1

Got error like this: BackupStorageLocation/default: created VolumeSnapshotLocation/default: attempting to create resource VolumeSnapshotLocation/default: attempting to create resource client VolumeSnapshotLocation/default: created Deployment/velero: attempting to create resource Deployment/velero: attempting to create resource client An error occurred:

Error installing Velero. Use kubectl logs deploy/velero -n velero to check the deploy logs: Error creating resource Deployment/velero: Deployment.apps "velero" is invalid: [spec.template.spec.initContainers[1].name: Required value, spec.template.spec.initContainers[1].image: Required value]

What did you expect to happen: Installation should be success.

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.)

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

reasonerjt commented 3 years ago

So either the CLI trim the input or it may fail earlier and more explicitly.

reasonerjt commented 3 years ago

@danfengliu in this case you should quote the list like "harbor-repo.vmware.com/harbor-ci/velero/velero-plugin-for-aws:v1.2.0, vsphereveleroplugin/velero-plugin-for-vsphere:v1.1.1" otherwise the space will confuse the shell and CLI thinks it's another param.

Keeping this open to check why there's no more explicit error.

danfengliu commented 3 years ago

@reasonerjt yes, it's should be quoted. After quoting, it's still not an acceptable param for velero CLI, the message is more clearer, but I think it's better this format should be accepted as an input param.

Error installing Velero. Use kubectl logs deploy/velero -n velero to check the deploy logs: Error creating resource Deployment/velero: Deployment.apps "velero" is invalid: spec.template.spec.initContainers[1].name: Invalid value: " vsphereveleroplugin-velero-plugin-for-vsphere": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is 'a-z0-9?')