Skip to content

Commit

Permalink
fix: wrong namespace for vcluster
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Sep 12, 2024
1 parent 1363a2b commit 2047129
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmd/vclusterctl/cmd/platform/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import (
type PasswordCmd struct {
*flags.GlobalFlags

User string
Password string
Create bool
Force bool
Namespace string
User string
Password string
Create bool
Force bool

Log log.Logger
}
Expand Down Expand Up @@ -128,6 +129,9 @@ func (cmd *PasswordCmd) Run() error {
return err
}
}
if user == nil {
return errors.New("could not obtain user")
}

// check if user had a password before
if user.Spec.PasswordRef == nil || user.Spec.PasswordRef.SecretName == "" || user.Spec.PasswordRef.SecretNamespace == "" || user.Spec.PasswordRef.Key == "" {
Expand Down Expand Up @@ -185,6 +189,9 @@ func (cmd *PasswordCmd) Run() error {
return errors.Wrap(err, "create password secret")
}
} else {
if passwordSecret == nil {
passwordSecret = &corev1.Secret{}
}
if passwordSecret.Data == nil {
passwordSecret.Data = map[string][]byte{}
}
Expand Down

0 comments on commit 2047129

Please sign in to comment.