Skip to content

Commit

Permalink
chore: use chainsaw wait operation (keptn#3155)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
Signed-off-by: vickysomtee <[email protected]>
  • Loading branch information
eddycharly authored and Vickysomtee committed Apr 22, 2024
1 parent 1db7bac commit ac83090
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
22 changes: 12 additions & 10 deletions test/chainsaw/integration/expose-keptn-metric/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ spec:
export SVCNAME=$( kubectl get svc -n keptn-system -l control-plane=metrics-operator -ojsonpath="{ .items[0].metadata.name }" )
echo "installing first job pointing to ${SVCNAME}"
envsubst < job-no-metric.yaml | kubectl apply -f -
- script:
- wait:
timeout: 5m
content: |
export NAME=$( echo $NAMESPACE | tr -d -)
echo "asserting first job: ${NAME}"
kubectl wait --for=condition=complete job $NAME-job1 -n $NAMESPACE
resource: job
selector: kind=no-metric
for:
condition:
name: complete
- name: step-01
try:
- script:
Expand All @@ -29,9 +30,10 @@ spec:
export SVCNAME=$( kubectl get svc -n keptn-system -l control-plane=metrics-operator -ojsonpath="{ .items[0].metadata.name }" )
echo "installing second job pointing to ${SVCNAME}"
envsubst < job-existing-metric.yaml | kubectl apply -f -
- script:
- wait:
timeout: 5m
content: |
export NAME=$( echo $NAMESPACE | tr -d -)
echo "asserting second job: $NAME"
kubectl wait --for=condition=complete job $NAME-job2 -n $NAMESPACE
resource: job
selector: kind=existing-metric
for:
condition:
name: complete
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ kind: Job
metadata:
name: $NAME-job2
namespace: $NAMESPACE
labels:
kind: existing-metric
spec:
backoffLimit: 5
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: Job
metadata:
name: $NAME-job1
namespace: $NAMESPACE
labels:
kind: no-metric
spec:
backoffLimit: 0
template:
Expand Down

0 comments on commit ac83090

Please sign in to comment.