diff --git a/Makefile b/Makefile index a96c9c64..ec429f8d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v0.1.52 +VERSION=v0.1.53 OUT_DIR=dist YEAR?=$(shell date +"%Y") diff --git a/cmd/commands/migrate.go b/cmd/commands/migrate.go index f8e97e45..33c5a00b 100644 --- a/cmd/commands/migrate.go +++ b/cmd/commands/migrate.go @@ -474,7 +474,6 @@ func addPathToClusterApp(destFs apfs.FS, runtimeName, clusterName, path string) addPathToInclude(app, path) bytes, err := yaml.Marshal(app) bytes = filterStatus(bytes) - fmt.Println(string(bytes)) if err != nil { return err } @@ -531,6 +530,11 @@ func removeFromCluster(ctx context.Context, runtimeNamespace, kubeContext string return fmt.Errorf("failed updating argoproj CRDs: %w", err) } + err = deleteInitialAdminSecret(ctx, kubeFactory, runtimeNamespace) + if err != nil { + return fmt.Errorf("failed deleting initial-admin-secret: %w", err) + } + return nil } @@ -589,6 +593,10 @@ func patchCrds(ctx context.Context, kubeFactory apkube.Factory) error { return nil } +func deleteInitialAdminSecret(ctx context.Context, kubeFactory apkube.Factory, namespace string) error { + return kube.GetClientSetOrDie(kubeFactory).CoreV1().Secrets(namespace).Delete(ctx, "argocd-initial-admin-secret", metav1.DeleteOptions{}) +} + func getLabelPatch(value string) string { return fmt.Sprintf(`{ "metadata": { "labels": { "%s": "%s" } } }`, apstore.Default.LabelKeyAppManagedBy, value) }