From 61c891f05565adcc01110f72d0293dafcc55f778 Mon Sep 17 00:00:00 2001 From: Carlisia Date: Thu, 25 Mar 2021 13:24:30 -0700 Subject: [PATCH] Addressed Dave's review Signed-off-by: Carlisia --- pkg/cmd/cli/uninstall/uninstall.go | 7 ++++--- test/e2e/velero_utils.go | 7 +------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/cmd/cli/uninstall/uninstall.go b/pkg/cmd/cli/uninstall/uninstall.go index 3267e644c..ccb37f446 100644 --- a/pkg/cmd/cli/uninstall/uninstall.go +++ b/pkg/cmd/cli/uninstall/uninstall.go @@ -49,7 +49,7 @@ type uninstallOptions struct { // BindFlags adds command line values to the options struct. func (o *uninstallOptions) BindFlags(flags *pflag.FlagSet) { - flags.BoolVar(&o.wait, "wait", o.wait, "Wait for Velero deployment to be ready. Optional.") + flags.BoolVar(&o.wait, "wait", o.wait, "Wait for Velero uninstall to be ready. Optional.") flags.BoolVar(&o.force, "force", o.force, "Forces the Velero uninstall. Optional.") } @@ -63,7 +63,7 @@ func NewCommand(f client.Factory) *cobra.Command { Long: `Uninstall Velero along with the CRDs. The '--namespace' flag can be used to specify the namespace where velero is installed (default: velero). -Use '--wait' to wait for the Velero Deployment to be ready before proceeding. +Use '--wait' to wait for the Velero uninstall to be ready before proceeding. Use '--force' to skip the prompt confirming if you want to uninstall Velero. `, Example: `# velero uninstall -n staging`, @@ -134,7 +134,8 @@ func Run(ctx context.Context, client *kubernetes.Clientset, extensionsClient *ap } else { for _, removeCRD := range crds.Items { if err = extensionsClient.ApiextensionsV1().CustomResourceDefinitions().Delete(ctx, removeCRD.ObjectMeta.Name, metav1.DeleteOptions{}); err != nil { - errs = append(errs, errors.WithStack(err)) + err2 := errors.WithMessagef(err, "Uninstall failed removing CRD %s", removeCRD.ObjectMeta.Name) + errs = append(errs, errors.WithStack(err2)) } } } diff --git a/test/e2e/velero_utils.go b/test/e2e/velero_utils.go index eef8b463b..ccc207922 100644 --- a/test/e2e/velero_utils.go +++ b/test/e2e/velero_utils.go @@ -292,12 +292,7 @@ func VeleroInstall(ctx context.Context, veleroImage string, veleroNamespace stri } func VeleroUninstall(ctx context.Context, client *kubernetes.Clientset, extensionsClient *apiextensionsclient.Clientset, veleroNamespace string) error { - err := uninstall.Run(ctx, client, extensionsClient, veleroNamespace, true) - if err != nil { - return err - } - - return nil + return uninstall.Run(ctx, client, extensionsClient, veleroNamespace, true) } func VeleroBackupLogs(ctx context.Context, veleroCLI string, veleroNamespace string, backupName string) error {