Skip to content

Commit

Permalink
test: add k8s test for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
andylibrian committed Oct 10, 2021
1 parent 186e927 commit 0331f21
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/k8s/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,18 @@ tarianctl get constraints

# test register constraint using annotation
tarianctl get constraints | grep run=nginx2

# action
tarianctl add action --name nginx-delete --match-labels=run=nginx --action=delete-pod

tarianctl get actions

# expect the pod to be killed
kubectl exec -ti nginx -c nginx -- sleep 15 || true

kubectl get pods
sleep 10s
kubectl get pods

echo $'(kubectl get pods -o json | jq \'.items | any(.metadata.name=="nginx")\') == "false"'
test $(kubectl get pods -o json | jq '.items | any(.metadata.name=="nginx")') == "false"

0 comments on commit 0331f21

Please sign in to comment.