Skip to content

Commit

Permalink
#54 ignore the occasional post delete cluster (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Chen <jerry153fish@gmail.com>
  • Loading branch information
jerry153fish committed Jul 11, 2023
1 parent 1307bb2 commit a2c862b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,20 @@ jobs:
run: |
kubectl cluster-info
kubectl get nodes
test-with-ignore-failed-clean:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- name: Create kind cluster with custom name
uses: ./
with:
kubectl_version: "v1.24.6"
ignore_failed_clean: true

- name: Test
run: |
kubectl cluster-info
kubectl get nodes
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ For more information on inputs, see the [API Documentation](https://developer.gi
- `verbosity`: info log verbosity, higher value produces more output
- `kubectl_version`: The kubectl version to use (default: v1.26.4)
- `install_only`: Skips cluster creation, only install kind (default: false)
- `ignore_failed_clean`: Whether to ignore the post delete cluster action failing (default: false)

### Example Workflow

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ inputs:
install_only:
description: "Skips cluster creation, only install kind (default: false)"
required: false
ignore_failed_clean:
description: "Whether to ignore the post-delete the cluster (default: false)"
default: false
required: false
runs:
using: "node16"
main: "main.js"
Expand Down
2 changes: 1 addition & 1 deletion cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ main() {
args+=(--name "${DEFAULT_CLUSTER_NAME}")
fi

kind delete cluster "${args[@]}"
kind delete cluster "${args[@]}" || "${INPUT_IGNORE_FAILED_CLEAN}"
}

main

0 comments on commit a2c862b

Please sign in to comment.