Skip to content

Commit 8d8fb4c

Browse files
committed
feat: add global.images.pullPolicy support to k8s-agents-operator
Add support for cascading pullPolicy from global.images.pullPolicy setting: - Added k8s-agents-operator.manager.imagePullPolicy helper in _helpers.tpl - Updated deployment.yaml to use the helper instead of inline default Configuration hierarchy: 1. global.images.pullPolicy (highest priority) 2. controllerManager.manager.image.pullPolicy 3. Default: IfNotPresent Users can now configure pull policy globally: global: images: pullPolicy: Always
1 parent 8695c96 commit 8d8fb4c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

charts/k8s-agents-operator/templates/_helpers.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ Returns if the template should render, it checks if the required values are set.
66
{{- and (or $licenseKey)}}
77
{{- end -}}
88

9+
{{- define "k8s-agents-operator.manager.imagePullPolicy" -}}
10+
{{- $globalPullPolicy := .Values.global.images.pullPolicy | default "" -}}
11+
{{- $chartPullPolicy := .Values.controllerManager.manager.image.pullPolicy | default "" -}}
12+
{{- if $globalPullPolicy -}}
13+
{{- $globalPullPolicy -}}
14+
{{- else if $chartPullPolicy -}}
15+
{{- $chartPullPolicy -}}
16+
{{- else -}}
17+
IfNotPresent
18+
{{- end -}}
19+
{{- end -}}
20+
921
{{- define "k8s-agents-operator.manager.image" -}}
1022
{{- $managerRepository := .Values.controllerManager.manager.image.repository -}}
1123
{{- $defaultRepository := "newrelic/k8s-agents-operator" -}}

charts/k8s-agents-operator/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ spec:
7272
- name: ENABLE_WEBHOOKS
7373
value: "true"
7474
image: {{ include "k8s-agents-operator.manager.image" . }}
75-
imagePullPolicy: {{ .Values.controllerManager.manager.image.pullPolicy | default "Always" }}
75+
imagePullPolicy: {{ include "k8s-agents-operator.manager.imagePullPolicy" . }}
7676
livenessProbe:
7777
httpGet:
7878
path: /healthz

0 commit comments

Comments
 (0)