Skip to content

Commit

Permalink
chore: add creds
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Dec 5, 2024
1 parent 5357067 commit 70727a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const (
OPERATOR_SEED_KEY = "seed.nk"
OPERATOR_PUBLIC_KEY = "key.pub"
OPERATOR_JWT = "key.jwt"
OPERATOR_CREDS = "user.creds"
USER_CREDS = "user.creds"
OPERATOR_CONFIG_FILE = "auth.conf"
AUTH_CONFIG_TEMPLATE = `operator: %s
system_account: %s
Expand Down
2 changes: 2 additions & 0 deletions controllers/natsuser_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controllers

import (
"context"
"fmt"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -264,6 +265,7 @@ func (r *NatsUserReconciler) reconcileSecret(ctx context.Context, user *natsv1al
return err
}
data[OPERATOR_JWT] = []byte(jwt)
data[USER_CREDS] = []byte(fmt.Sprintf(ACCOUNT_TEMPLATE, jwt, seed))

secret.Namespace = user.Namespace
secret.Name = secretName.Name
Expand Down

0 comments on commit 70727a5

Please sign in to comment.