@@ -86,6 +86,17 @@ Return eBPF configuration required if enabled
8686{ {- end -} }
8787{ {- end -} }
8888
89+ { {/*
90+ Return Low Power Mode configuration required if enabled
91+ */} }
92+ { {- define " threatstack-agent.daemonset-lowPowerMode-config" -} }
93+ { {- if .Values.daemonset.enableLowPowerMode -} }
94+ { {- " low_power true" -} }
95+ { {- else -} }
96+ { {- " low_power false" -} }
97+ { {- end -} }
98+ { {- end -} }
99+
89100{ {/*
90101Return runtime config if docker is disabled
91102*/} }
@@ -115,14 +126,24 @@ Return runtime config if containerd is disabled
115126{ {- end -} }
116127
117128{ {/*
118- Return low-power config if setting is enabled
129+ Return Service Account Name if rbac is enabled
119130*/} }
120- { {- define " threatstack-agent.daemonset-lowpower-config" -} }
121- { {- if kindIs " invalid" .Values.daemonset.enableLowPowerMode -} }
131+ { {- define " threatstack-agent.serviceAccountName" -} }
132+ { {- if .Values.rbac.create -} }
133+ { { include " threatstack-agent.name" . } }
122134{ {- else -} }
123- { {- if eq .Values.daemonset.enableLowPowerMode false -} }
124- { {- else -} }
125- { {- default " --low_power=true" -} }
135+ { { .Values.rbac.serviceAccountName } }
136+ { {- end -} }
126137{ {- end -} }
138+
139+ { {/*
140+ Return Additional Runtime Config for Daemonset
141+ */} }
142+ { {- define " threatstack-agent.daemonset-runtimeConfig" -} }
143+ { {- $runtimeConfig := list (include " threatstack-agent.docker-config" .) (include " threatstack-agent.containerd-config" .) -} }
144+ { {- $runtimeConfig = append $runtimeConfig (include " threatstack-agent.daemonset-lowPowerMode-config" .) -} }
145+ { {- $runtimeConfig = append $runtimeConfig (include " threatstack-agent.daemonset-ebpf-config" .) -} }
146+ { {- $runtimeConfig = append $runtimeConfig .Values.daemonset.additionalRuntimeConfig -} }
147+
148+ { { $runtimeConfig | join " " } }
127149{ {- end -} }
128- { {- end -} }
0 commit comments