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.
mine
Andreas Schrammel 2025-06-01 15:39:18 +02:00 committed by GitHub
parent ecb52b562e
commit c2bbcd4c72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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