From a84333a3aeb9ddc0f596371176505a4c276d3e62 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Wed, 11 Sep 2024 09:11:05 +0200 Subject: [PATCH] fix: change namespace in reset password --- cmd/vclusterctl/cmd/platform/reset.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/vclusterctl/cmd/platform/reset.go b/cmd/vclusterctl/cmd/platform/reset.go index 61a9cd3525..ba1172d892 100644 --- a/cmd/vclusterctl/cmd/platform/reset.go +++ b/cmd/vclusterctl/cmd/platform/reset.go @@ -78,6 +78,7 @@ vcluster platform reset password --user admin c.Flags().StringVar(&cmd.Password, "password", "", "The new password to use") c.Flags().BoolVar(&cmd.Create, "create", false, "Creates the user if it does not exist") c.Flags().BoolVar(&cmd.Force, "force", false, "If user had no password will create one") + c.Flags().StringVar(&cmd.Namespace, "namespace", "vcluster-platform", "The namespace to use") return c } @@ -117,7 +118,7 @@ func (cmd *PasswordCmd) Run() error { }, PasswordRef: &storagev1.SecretRef{ SecretName: "loft-password-" + random.String(5), - SecretNamespace: "loft", + SecretNamespace: cmd.Namespace, Key: "password", }, }, @@ -138,7 +139,7 @@ func (cmd *PasswordCmd) Run() error { user.Spec.PasswordRef = &storagev1.SecretRef{ SecretName: "loft-password-" + random.String(5), - SecretNamespace: "loft", + SecretNamespace: cmd.Namespace, Key: "password", } user, err = managementClient.Loft().StorageV1().Users().Update(context.Background(), user, metav1.UpdateOptions{})