Skip to content

Commit a2c862b

Browse files
authored
#54 ignore the occasional post delete cluster (#79)
Signed-off-by: Jerry Chen <[email protected]>
1 parent 1307bb2 commit a2c862b

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

.github/workflows/test.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,20 @@ jobs:
100100
run: |
101101
kubectl cluster-info
102102
kubectl get nodes
103+
104+
test-with-ignore-failed-clean:
105+
runs-on: ubuntu-latest
106+
steps:
107+
- name: Checkout
108+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
109+
110+
- name: Create kind cluster with custom name
111+
uses: ./
112+
with:
113+
kubectl_version: "v1.24.6"
114+
ignore_failed_clean: true
115+
116+
- name: Test
117+
run: |
118+
kubectl cluster-info
119+
kubectl get nodes

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ For more information on inputs, see the [API Documentation](https://developer.gi
2323
- `verbosity`: info log verbosity, higher value produces more output
2424
- `kubectl_version`: The kubectl version to use (default: v1.26.4)
2525
- `install_only`: Skips cluster creation, only install kind (default: false)
26+
- `ignore_failed_clean`: Whether to ignore the post delete cluster action failing (default: false)
2627

2728
### Example Workflow
2829

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ inputs:
3434
install_only:
3535
description: "Skips cluster creation, only install kind (default: false)"
3636
required: false
37+
ignore_failed_clean:
38+
description: "Whether to ignore the post-delete the cluster (default: false)"
39+
default: false
40+
required: false
3741
runs:
3842
using: "node16"
3943
main: "main.js"

cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ main() {
2929
args+=(--name "${DEFAULT_CLUSTER_NAME}")
3030
fi
3131

32-
kind delete cluster "${args[@]}"
32+
kind delete cluster "${args[@]}" || "${INPUT_IGNORE_FAILED_CLEAN}"
3333
}
3434

3535
main

0 commit comments

Comments
 (0)