Skip to content

Commit 8dc3ba9

Browse files
committed
added helper for identifying remediation runners
1 parent 1e85387 commit 8dc3ba9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

wiz-outpost-lite/templates/_helpers.tpl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ wiz.io/runner: {{ .runner | quote }}
5858
{{- end }}
5959
{{- end }}
6060

61+
{{/*
62+
Check if runner is a remediation runner
63+
*/}}
64+
{{- define "wiz-outpost-lite.isRemediationRunner" -}}
65+
{{- hasPrefix "remediation-" . }}
66+
{{- end }}
67+
6168
{{- define "wiz-outpost-lite.runners" -}}
6269
{{- $runnerValues := dict }}
6370
{{- range $runner, $values := $.Values.runners }}
@@ -70,7 +77,7 @@ wiz.io/runner: {{ .runner | quote }}
7077
container-registry -> outpost-lite-runner-container-registry
7178
*/}}
7279
{{- $imageName := "" }}
73-
{{- if hasPrefix "remediation" $runner }}
80+
{{- if include "wiz-outpost-lite.isRemediationRunner" $runner }}
7481
{{- $imageName = "outpost-lite-runner-remediation" }}
7582
{{- else }}
7683
{{- $imageName = dig "image" "name" (printf "outpost-lite-runner-%s" $runner) $values }}
@@ -94,7 +101,7 @@ Get security context for a runner
94101
{{- $runner := .runner }}
95102
{{- $values := .Values }}
96103
{{- $baseProfile := "standard" }}
97-
{{- if hasPrefix "remediation" $runner }}
104+
{{- if include "wiz-outpost-lite.isRemediationRunner" $runner }}
98105
{{- $baseProfile = "secure" }}
99106
{{- end }}
100107
{{- $baseSecurityContext := get $values.securityContextProfiles $baseProfile }}

0 commit comments

Comments
 (0)