From f06c4b44792c08429e300378cbb87dcbb5982b6c Mon Sep 17 00:00:00 2001 From: Anish Bista Date: Mon, 23 Sep 2024 00:01:04 +0530 Subject: [PATCH] create function for container level security context Signed-off-by: Anish Bista --- helm/kanister-operator/templates/_helpers.tpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/helm/kanister-operator/templates/_helpers.tpl b/helm/kanister-operator/templates/_helpers.tpl index b9d9ab4688..a535f530a2 100644 --- a/helm/kanister-operator/templates/_helpers.tpl +++ b/helm/kanister-operator/templates/_helpers.tpl @@ -111,3 +111,12 @@ Define a custom kanister-tools image {{- define "kanister-tools.image" -}} {{- printf "%s:%s" (.Values.kanisterToolsImage.image) (.Values.kanisterToolsImage.tag) -}} {{- end -}} + +{{/* +Define a security Context at Container level +*/}} +{{- define "controller.containerSecurityContext" -}} +{{- if .Values.controller.containerSecurityContext -}} +{{ toYaml .Values.controller.containerSecurityContext | indent 10 }} +{{- end -}} +{{- end -}} \ No newline at end of file