diff --git a/cmd/flux/uninstall.go b/cmd/flux/uninstall.go index 0128a833..58b4fa73 100644 --- a/cmd/flux/uninstall.go +++ b/cmd/flux/uninstall.go @@ -90,16 +90,24 @@ func uninstallCmdRun(cmd *cobra.Command, args []string) error { } logger.Actionf("deleting components in %s namespace", *kubeconfigArgs.Namespace) - uninstall.Components(ctx, logger, kubeClient, *kubeconfigArgs.Namespace, uninstallArgs.dryRun) + if err := uninstall.Components(ctx, logger, kubeClient, *kubeconfigArgs.Namespace, uninstallArgs.dryRun); err != nil { + return err + } logger.Actionf("deleting toolkit.fluxcd.io finalizers in all namespaces") - uninstall.Finalizers(ctx, logger, kubeClient, uninstallArgs.dryRun) + if err := uninstall.Finalizers(ctx, logger, kubeClient, uninstallArgs.dryRun); err != nil { + return err + } logger.Actionf("deleting toolkit.fluxcd.io custom resource definitions") - uninstall.CustomResourceDefinitions(ctx, logger, kubeClient, uninstallArgs.dryRun) + if err := uninstall.CustomResourceDefinitions(ctx, logger, kubeClient, uninstallArgs.dryRun); err != nil { + return err + } if !uninstallArgs.keepNamespace { - uninstall.Namespace(ctx, logger, kubeClient, *kubeconfigArgs.Namespace, uninstallArgs.dryRun) + if err := uninstall.Namespace(ctx, logger, kubeClient, *kubeconfigArgs.Namespace, uninstallArgs.dryRun); err != nil { + return err + } } logger.Successf("uninstall finished")