From 68ef897b6afa193ec5fd73333b68e4c0beb9550d Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Mon, 5 May 2025 01:39:30 +0400 Subject: [PATCH] fix: logs and rbac --- k8-operator/config/rbac/role.yaml | 12 ++++++++++++ .../infisicalpushsecret_controller.go | 2 +- .../infisicalpushsecret_helper.go | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/k8-operator/config/rbac/role.yaml b/k8-operator/config/rbac/role.yaml index 542face87..ea2fbada3 100644 --- a/k8-operator/config/rbac/role.yaml +++ b/k8-operator/config/rbac/role.yaml @@ -74,6 +74,18 @@ rules: - tokenreviews verbs: - create +- apiGroups: + - secrets.infisical.com + resources: + - clustergenerators + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - secrets.infisical.com resources: diff --git a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go index faacc578d..a9e22e406 100644 --- a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go +++ b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go @@ -51,7 +51,7 @@ func (r *InfisicalPushSecretReconciler) GetLogger(req ctrl.Request) logr.Logger //+kubebuilder:rbac:groups="",resources=pods,verbs=get;list //+kubebuilder:rbac:groups="authentication.k8s.io",resources=tokenreviews,verbs=create //+kubebuilder:rbac:groups="",resources=serviceaccounts/token,verbs=create - +// +kubebuilder:rbac:groups=secrets.infisical.com,resources=clustergenerators,verbs=get;list;watch;create;update;patch;delete // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. // For more details, check Reconcile and its Result here: diff --git a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go index f8549c9db..9db0599ab 100644 --- a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go +++ b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go @@ -136,8 +136,6 @@ func (r *InfisicalPushSecretReconciler) processGenerators(infisicalPushSecret v1 if generatorRef.Kind == v1alpha1.GeneratorKindUUID { - fmt.Printf("clusterGenerator: %+v\n", clusterGenerator) - uuid, err := generatorUtil.GeneratorUUID() if err != nil { return nil, fmt.Errorf("unable to generate UUID [err=%s]", err)