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.
This commit is contained in:
Andreas Schrammel
2025-06-01 07:39:18 -06:00
committed by GitHub
parent ecb52b562e
commit c2bbcd4c72
+1 -1
View File
@@ -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