diff --git a/controllers/const.go b/controllers/const.go index c803a19..0e5221c 100644 --- a/controllers/const.go +++ b/controllers/const.go @@ -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 diff --git a/controllers/natsuser_controller.go b/controllers/natsuser_controller.go index 6ee53ee..5c713df 100644 --- a/controllers/natsuser_controller.go +++ b/controllers/natsuser_controller.go @@ -2,6 +2,7 @@ package controllers import ( "context" + "fmt" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -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