From f04277cc848d98f8762193c8603f3e0755cc2e57 Mon Sep 17 00:00:00 2001 From: rksharma95 Date: Fri, 24 Jan 2025 17:08:14 +0530 Subject: [PATCH] use correct role in snitch rolbinding log error messages as well Signed-off-by: rksharma95 --- .../helm/KubeArmorOperator/templates/rolebindng-rbac.yaml | 4 ++-- pkg/KubeArmorOperator/internal/controller/cluster.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deployments/helm/KubeArmorOperator/templates/rolebindng-rbac.yaml b/deployments/helm/KubeArmorOperator/templates/rolebindng-rbac.yaml index a001a50e8..a289b2c44 100644 --- a/deployments/helm/KubeArmorOperator/templates/rolebindng-rbac.yaml +++ b/deployments/helm/KubeArmorOperator/templates/rolebindng-rbac.yaml @@ -16,12 +16,12 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: {{ .Values.kubearmorOperator.name }}-manage-snitch-job-role + name: {{ .Values.kubearmorOperator.name }}-manage-snitch-job-rolebinding namespace: {{.Release.Namespace}} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role - name: {{ .Values.kubearmorOperator.name }}-manage-snitch-job-rolebinding + name: {{ .Values.kubearmorOperator.name }}-manage-snitch-job-role subjects: - kind: ServiceAccount name: {{ .Values.kubearmorOperator.name }} diff --git a/pkg/KubeArmorOperator/internal/controller/cluster.go b/pkg/KubeArmorOperator/internal/controller/cluster.go index b4bbe4334..2b2f9783e 100755 --- a/pkg/KubeArmorOperator/internal/controller/cluster.go +++ b/pkg/KubeArmorOperator/internal/controller/cluster.go @@ -144,7 +144,7 @@ func (clusterWatcher *ClusterWatcher) checkJobStatus(job, runtime, nodename stri j, err := clusterWatcher.Client.BatchV1().Jobs(common.Namespace).Get(context.TODO(), job, v1.GetOptions{}) if err != nil { - clusterWatcher.Log.Warnf("cannot get job: %s", job) + clusterWatcher.Log.Warnf("cannot get job: %s err: %s", job, err) return } @@ -157,7 +157,7 @@ func (clusterWatcher *ClusterWatcher) checkJobStatus(job, runtime, nodename stri }) if err != nil { - clusterWatcher.Log.Warnf("Cannot get job pod: %s", job) + clusterWatcher.Log.Warnf("Cannot get job pod: %s err: %s", job, err) return } @@ -168,7 +168,7 @@ func (clusterWatcher *ClusterWatcher) checkJobStatus(job, runtime, nodename stri FieldSelector: fmt.Sprintf("involvedObject.name=%s", pod.Name), }) if err != nil { - clusterWatcher.Log.Warnf("cannot get pod events for pod: %s", pod.Name) + clusterWatcher.Log.Warnf("cannot get pod events for pod: %s err: %s", pod.Name, err) return }