Addressed Dave's review

Signed-off-by: Carlisia <carlisia@vmware.com>
This commit is contained in:
Carlisia
2021-03-25 13:24:30 -07:00
parent 4fff2a4a5c
commit 61c891f055
2 changed files with 5 additions and 9 deletions

View File

@@ -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))
}
}
}

View File

@@ -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 {