Skip to content

Commit

Permalink
use correct role in snitch rolbinding
Browse files Browse the repository at this point in the history
log error messages as well

Signed-off-by: rksharma95 <[email protected]>
  • Loading branch information
rksharma95 committed Jan 24, 2025
1 parent a88b0fa commit f04277c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions pkg/KubeArmorOperator/internal/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit f04277c

Please sign in to comment.