Skip to content

Commit

Permalink
Delete Pod even if previous step times out
Browse files Browse the repository at this point in the history
(Also increase timeout)
  • Loading branch information
asmacdo committed Sep 25, 2024
1 parent 0993129 commit 87027d2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ jobs:
# Step 5: Wait for Pod to Complete
- name: Wait for Hello World Pod to complete
run: |
kubectl wait --for=condition=Ready pod/hello-world-pod --timeout=60s
kubectl wait --for=condition=Ready pod/hello-world-pod --timeout=300s # 5 minutes
continue-on-error: true # Allow the workflow to continue even if this step fails

# Step 6: Get Pod Logs to verify it ran successfully
# Step 6: Get Pod Logs to verify it ran successfully, only if Step 5 succeeds
- name: Get Hello World Pod logs
run: |
kubectl logs hello-world-pod
if: ${{ success() }} # Only run this step if the previous step was successful

# Step 7: Cleanup - Delete the Pod
# Step 7: Cleanup - Always run this step, even if previous steps fail
- name: Delete Hello World Pod
run: |
kubectl delete pod hello-world-pod
if: ${{ always() }} # Always run this step, even if other steps fail

0 comments on commit 87027d2

Please sign in to comment.