mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 05:46:37 +00:00
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user