@@ -231,16 +231,13 @@ true
231231
232232{ {/*
233233 This function checks if the response_actions feature is enabled for the host.
234- It first checks the additional_settings and then the features .
235- If neither is found, it defaults to false .
234+ It checks features.respond or features.responding for response_actions .
235+ If not found, it defaults to false .
236236*/} }
237237{ {- define " host.response_actions_enabled" } }
238- { {- $feature_respond := dig " respond" (dict) .Values.features } }
239- { {- $additional_features := dig " features" (dict) .Values.host.additional_settings } }
240- { {- $additional_respond := dig " respond" (dict) $additional_features } }
241- { {- if hasKey $additional_respond " response_actions" } }
242- { {- dig " response_actions" " enabled" false $additional_respond -} }
243- { {- else if hasKey $feature_respond " response_actions" } }
238+ { {- $respondKey := include " host.respond_key" .Values.features } }
239+ { {- $feature_respond := dig $respondKey (dict) .Values.features } }
240+ { {- if hasKey $feature_respond " response_actions" } }
244241{ {- dig " response_actions" " enabled" false $feature_respond -} }
245242{ {- end } }
246243{ {- end } }
@@ -252,13 +249,10 @@ true
252249*/} }
253250{ {- define " host.response_actions_needs_higher_privileges" } }
254251{ {- if eq (include " host.response_actions_enabled" .) " true" } }
255- { {- $feature_respond := dig " respond" (dict) .Values.features } }
256- { {- $additional_features := dig " features" (dict) .Values.host.additional_settings } }
257- { {- $additional_respond := dig " respond" (dict) $additional_features } }
252+ { {- $respondKey := include " host.respond_key" .Values.features } }
253+ { {- $feature_respond := dig $respondKey (dict) .Values.features } }
258254{ {- $response_actions := dict } }
259- { {- if hasKey $additional_respond " response_actions" } }
260- { {- $response_actions = get $additional_respond " response_actions" } }
261- { {- else if hasKey $feature_respond " response_actions" } }
255+ { {- if hasKey $feature_respond " response_actions" } }
262256 { {- $response_actions = get $feature_respond " response_actions" } }
263257{ {- end } }
264258{ {- $file_acquire_trigger := dig " file_acquire" " trigger" " all" $response_actions } }
0 commit comments