@@ -124,6 +124,51 @@ Pass environment variables to the agent container if tracing a specific protocol
124124{{- end }}
125125{{- end -}}
126126
127+ {{/*
128+ Returns the pull policy for kernel header installer, respecting global.images.pullPolicy
129+ */}}
130+ {{- define "nr-ebpf-agent.kernelHeaderInstaller.imagePullPolicy" -}}
131+ {{- $globalPullPolicy := .Values.global.images.pullPolicy | default "" -}}
132+ {{- $chartPullPolicy := .Values.ebpfAgent.kernelHeaderInstaller.pullPolicy | default "" -}}
133+ {{- if $globalPullPolicy -}}
134+ {{- $globalPullPolicy -}}
135+ {{- else if $chartPullPolicy -}}
136+ {{- $chartPullPolicy -}}
137+ {{- else -}}
138+ IfNotPresent
139+ {{- end -}}
140+ {{- end -}}
141+
142+ {{/*
143+ Returns the pull policy for eBPF agent, respecting global.images.pullPolicy
144+ */}}
145+ {{- define "nr-ebpf-agent.ebpfAgent.imagePullPolicy" -}}
146+ {{- $globalPullPolicy := .Values.global.images.pullPolicy | default "" -}}
147+ {{- $chartPullPolicy := .Values.ebpfAgent.image.pullPolicy | default "" -}}
148+ {{- if $globalPullPolicy -}}
149+ {{- $globalPullPolicy -}}
150+ {{- else if $chartPullPolicy -}}
151+ {{- $chartPullPolicy -}}
152+ {{- else -}}
153+ IfNotPresent
154+ {{- end -}}
155+ {{- end -}}
156+
157+ {{/*
158+ Returns the pull policy for OTel collector, respecting global.images.pullPolicy
159+ */}}
160+ {{- define "nr-ebpf-agent.otelCollector.imagePullPolicy" -}}
161+ {{- $globalPullPolicy := .Values.global.images.pullPolicy | default "" -}}
162+ {{- $chartPullPolicy := .Values.otelCollector.image.pullPolicy | default "" -}}
163+ {{- if $globalPullPolicy -}}
164+ {{- $globalPullPolicy -}}
165+ {{- else if $chartPullPolicy -}}
166+ {{- $chartPullPolicy -}}
167+ {{- else -}}
168+ IfNotPresent
169+ {{- end -}}
170+ {{- end -}}
171+
127172{{/*
128173Generate environment variables for disabling protocols and setting sampling latency.
129174*/}}
@@ -141,66 +186,15 @@ Generate environment variables for disabling protocols and setting sampling late
141186 {{- if (eq $config.spans.enabled false) }}
142187- name: PROTOCOLS_{{ upper $protocol }}_SPANS_ENABLED
143188 value: "false"
144- {{- end }}
189+ {{- end }}
145190 {{- if (eq $config.spans.enabled true) }}
146191 {{- include "validate.samplingLatency" (dict "protocol" $protocol "latency" $config.spans.samplingLatency) }}
147192- name: PROTOCOLS_{{ upper $protocol }}_SPANS_SAMPLING_LATENCY
148193 value: "{{ $config.spans.samplingLatency | regexMatch "p1|p10|p50|p90|p99" | ternary $config.spans.samplingLatency "" }}"
149194 {{- end }}
150195 {{- end }}
151- {{- end }}
152- {{- end }}
196+ {{- end }}
153197{{- end }}
154198{{- end }}
155199{{- end }}
156-
157- {{/*
158- Returns the kernel header installer image repository, respecting global.images.registry
159- */}}
160- {{- define "nr-ebpf-agent.kernelHeaderInstaller.image" -}}
161- {{- $imageRepository := .Values.ebpfAgent.kernelHeaderInstaller.repository -}}
162- {{- $defaultRepository := "docker.io/newrelic/newrelic-ebpf-agent" -}}
163- {{- $registry := "" -}}
164- {{- if .Values.global }}
165- {{- $registry = .Values.global.images.registry | default "" -}}
166- {{- end -}}
167- {{- if and $registry (eq $imageRepository $defaultRepository) -}}
168- {{- printf "%s/newrelic/newrelic-ebpf-agent" $registry -}}
169- {{- else -}}
170- {{- $imageRepository -}}
171- {{- end -}}
172- {{- end -}}
173-
174- {{/*
175- Returns the eBPF agent image repository, respecting global.images.registry
176- */}}
177- {{- define "nr-ebpf-agent.ebpfAgent.image" -}}
178- {{- $imageRepository := .Values.ebpfAgent.image.repository -}}
179- {{- $defaultRepository := "docker.io/newrelic/newrelic-ebpf-agent" -}}
180- {{- $registry := "" -}}
181- {{- if .Values.global }}
182- {{- $registry = .Values.global.images.registry | default "" -}}
183- {{- end -}}
184- {{- if and $registry (eq $imageRepository $defaultRepository) -}}
185- {{- printf "%s/newrelic/newrelic-ebpf-agent" $registry -}}
186- {{- else -}}
187- {{- $imageRepository -}}
188- {{- end -}}
189- {{- end -}}
190-
191- {{/*
192- Returns the OTel collector image repository, respecting global.images.registry
193- */}}
194- {{- define "nr-ebpf-agent.otelCollector.image" -}}
195- {{- $imageRepository := .Values.otelCollector.image.repository -}}
196- {{- $defaultRepository := "docker.io/newrelic/newrelic-ebpf-agent" -}}
197- {{- $registry := "" -}}
198- {{- if .Values.global }}
199- {{- $registry = .Values.global.images.registry | default "" -}}
200- {{- end -}}
201- {{- if and $registry (eq $imageRepository $defaultRepository) -}}
202- {{- printf "%s/newrelic/newrelic-ebpf-agent" $registry -}}
203- {{- else -}}
204- {{- $imageRepository -}}
205- {{- end -}}
206- {{- end -}}
200+ {{- end }}
0 commit comments