-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Description
We want to use a universal shell-operator image that contains a set of hooks. In different Kubernetes clusters, different sets of hooks need to be activated.
This can be done, for example, through environment variables, but if we return an empty JSON object or exit code 0 when calling a hook with the --config flag, we get the following error:
hook::config() {
if [ "$ENABLE_HOOK_CUSTOM_LOGGING_FLOW" == "true" ]; then
cat <<EOF
{
"configVersion":"v1",
"kubernetes": [
{
"apiVersion": "logging.banzaicloud.io/v1beta1",
"kind": "flow",
"executeHookOnEvent": [
"Added",
"Modified"
],
}
]
}
EOF
else
exit 0
fi
}{"level":"fatal","logger":"shell-operator","msg":"assemble shell operator","error":"initialize HookManager fail: MAIN Fatal: initialize hook manager: creating hook '100-custom-logging-flow/add_or_update_flow.sh': load hook '100-custom-logging-flow/add_or_update_flow.sh' config: 1 error occurred:\n\t* should have at least 1 property\n\n\nhook --config output: ","time":"2025-03-09T11:50:25Z"}Could a parameter like enabled be added in the hook-level settings to allow disabling specific hooks?
A similar question is present in the discussion.
Metadata
Metadata
Assignees
Labels
No labels