Skip to content

Commit 78628d6

Browse files
committed
Fix frr-k8s-statuscleaner crash: move $(LOG_LEVEL) to end of args
The frr-k8s-statuscleaner pod was crashing with "invalid namespace for secret" error during startup. The root cause was that none of the command-line flags were being parsed. The LOG_LEVEL env var is sourced from the optional "env-overrides" ConfigMap which doesn't exist by default. When a ConfigMap referenced with optional:true doesn't exist, Kubernetes leaves the env var undefined. When $(LOG_LEVEL) is used in args and the env var is undefined, Kubernetes passes the literal string "$(LOG_LEVEL)" instead of substituting a value. Inspecting the container at runtime with crictl showed: ["/statuscleaner", "$(LOG_LEVEL)", "--disable-cert-rotation=true", "--namespace=openshift-frr-k8s", "--webhook-port=9123", "--frrk8s-selector=component=frr-k8s"] Go's flag.Parse() stops processing at the first non-flag argument. Since "$(LOG_LEVEL)" was the first argument, flag parsing stopped immediately and all subsequent flags (--disable-cert-rotation, --namespace, etc.) were never parsed. The program ran with default values, causing the crash. Moving $(LOG_LEVEL) to the end of the args list ensures all real flags are parsed before flag.Parse() encounters the literal string. The unrecognized positional argument is then silently ignored, matching the pattern already used successfully in frr-k8s.yaml. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Riccardo Ravaioli <rravaiol@redhat.com>
1 parent d2a643e commit 78628d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bindata/network/frr-k8s/node-status-cleaner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ spec:
2424
- command:
2525
- /statuscleaner
2626
args:
27-
- $(LOG_LEVEL)
2827
- --disable-cert-rotation=true
2928
- --namespace=$(NAMESPACE)
3029
- --webhook-port=9123
3130
- --frrk8s-selector=component=frr-k8s
31+
- $(LOG_LEVEL)
3232
env:
3333
- name: NAMESPACE
3434
valueFrom:

0 commit comments

Comments
 (0)