diff --git a/charts/k8s-image-pre-puller/templates/cluster-role.yaml b/charts/k8s-image-pre-puller/templates/cluster-role.yaml index 769d56d..431ce8c 100644 --- a/charts/k8s-image-pre-puller/templates/cluster-role.yaml +++ b/charts/k8s-image-pre-puller/templates/cluster-role.yaml @@ -25,7 +25,7 @@ rules: - apiGroups: - apps resources: - - daemonset + - daemonsets verbs: - create - delete @@ -37,7 +37,7 @@ rules: - apiGroups: - apps resources: - - daemonset/status + - daemonsets/status verbs: - get - apiGroups: diff --git a/internal/controller/prepullimage_reconciller.go b/internal/controller/prepullimage_reconciller.go index c96026e..ace94c4 100644 --- a/internal/controller/prepullimage_reconciller.go +++ b/internal/controller/prepullimage_reconciller.go @@ -343,8 +343,8 @@ func (r *prePullImageReconciller) getTolerationsByNodeSelector(ctx context.Conte } tolerationMap := map[string]corev1.Toleration{} - for _, item := range nodes.Items { - for _, taint := range item.Spec.Taints { + for _, node := range nodes.Items { + for _, taint := range node.Spec.Taints { if strings.HasPrefix(taint.Key, BuiltinKubernetesTaintKeyPrefix) { // WARN: we should avoid to add tolerations for builtin taints continue