From c2bbcd4c7220095ad441af456159da2813fc2114 Mon Sep 17 00:00:00 2001 From: Andreas Schrammel Date: Sun, 1 Jun 2025 15:39:18 +0200 Subject: [PATCH] Add context flag to keda-toggle condition (#3371) Without having the context explicitly set, for me the condition is never met, no matter if the annotation is present or not. --- plugins/keda-toggle.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/keda-toggle.yaml b/plugins/keda-toggle.yaml index a4370c0f..3c3fcbf9 100644 --- a/plugins/keda-toggle.yaml +++ b/plugins/keda-toggle.yaml @@ -15,7 +15,7 @@ plugins: - | ANNOTATION="autoscaling.keda.sh/paused-replicas" - if kubectl get scaledobject $NAME -n $NAMESPACE -o yaml | grep -q "$ANNOTATION: \"0\""; then + if kubectl get scaledobject $NAME -n $NAMESPACE --context $CONTEXT -o yaml | grep -q "$ANNOTATION: \"0\""; then # If annotation found, remove it kubectl annotate scaledobject $NAME "$ANNOTATION"- -n $NAMESPACE --context $CONTEXT >/dev/null && echo "Keda autoscaling for $NAME enabled" else