Skip to content

Commit

Permalink
use appNamespace instead of options.Namespace for secret namespace (o…
Browse files Browse the repository at this point in the history
…bc regenerate)

Signed-off-by: shirady <[email protected]>
(cherry picked from commit 560a17c)
  • Loading branch information
shirady authored and liranmauda committed Nov 2, 2023
1 parent 1c23541 commit 5950757
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/obc/obc.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func RunRegenerate(cmd *cobra.Command, args []string) {

accountName := ob.Spec.AdditionalState["account"]

err := GenerateAccountKeys(name, accountName)
err := GenerateAccountKeys(name, accountName, appNamespace)
if err != nil {
log.Fatalf(`❌ Could not regenerate credentials for %q: %v`, name, err)
}
Expand Down Expand Up @@ -518,7 +518,7 @@ func CheckPhase(obc *nbv1.ObjectBucketClaim) {
}

// GenerateAccountKeys regenerate noobaa OBC account S3 keys
func GenerateAccountKeys(name string, accountName string) error {
func GenerateAccountKeys(name, accountName, appNamespace string) error {
log := util.Logger()

if accountName == "" {
Expand All @@ -534,7 +534,7 @@ func GenerateAccountKeys(name string, accountName string) error {

// Checking that we can find the secret before we are calling the RPC to change the credentials.
secret := util.KubeObject(bundle.File_deploy_internal_secret_empty_yaml).(*corev1.Secret)
secret.Namespace = options.Namespace
secret.Namespace = appNamespace
secret.Name = name
if !util.KubeCheckQuiet(secret) {
log.Fatalf(`❌ Could not find secret: %s, will not regenerate keys.`, secret.Name)
Expand Down

0 comments on commit 5950757

Please sign in to comment.