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
parent
ecb52b562e
commit
c2bbcd4c72
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue