Conversation
|
Hi @stevefan1999-personal, I don't understand why to delete k3d clusters in post-event if the whole workflow run will be deleted after it finishes. |
| local name=${CLUSTER_NAME} | ||
| local arguments=${ARGS:-} | ||
| local k3dVersion=${K3D_VERSION:-${DEFAULT_K3D_VERSION}} | ||
|
|
||
| if [[ -z "${CLUSTER_NAME}" ]]; then | ||
| panic "CLUSTER_NAME must be set" | ||
| fi | ||
|
|
||
| echo -e "${YELLOW}Downloading ${CYAN}k3d@${k3dVersion} ${NC}see: ${K3D_URL}" | ||
| curl --silent --fail ${K3D_URL} | TAG=${k3dVersion} bash | ||
|
|
||
| echo -e "\existing_network${YELLOW}Teardown cluster ${CYAN}$name ${NC}" |
There was a problem hiding this comment.
I'm not sure if there is a need to re-download the k3d binary that is already there.
There was a problem hiding this comment.
Well, at least for some reason it was needed for https://github.com/nektos/act
There was a problem hiding this comment.
I think you mentioned kind action in a related issue. Teardown also does not install kind again.
There was a problem hiding this comment.
Thanks for the PR, it's an excellent idea and I don't mind adding this feature, but I'd like GitHub events to run in GitHub as before. I guess there's no reason to download k3d again on post or use 3rd party action inside ours.
Please, squash your commits.
We have tests in .github/workflows. If teardown could be set explicitly, it would be good to see evidence of it running as it should.
In the case of explicit execution , extra documentation will be needed.
| - uses: gacts/run-and-post-run@v1 | ||
| with: | ||
| run: | | ||
| ${{ github.action_path }}/run.sh deploy | ||
| post: | | ||
| ${{ github.action_path }}/run.sh teardown |
There was a problem hiding this comment.
I'm afraid that this would be an unnecessary way to run teardown over and over again in VM-based workflows. Could it be done differently?
There was a problem hiding this comment.
Well, I think you shouldn't assume it will be VM based since you can run act locally -- given you just have Docker access, and act pretty much replicates 60% of GHA to let you run it locally so that you can test the workflow before it goes live on master.
| local name=${CLUSTER_NAME} | ||
| local arguments=${ARGS:-} | ||
| local k3dVersion=${K3D_VERSION:-${DEFAULT_K3D_VERSION}} | ||
|
|
||
| if [[ -z "${CLUSTER_NAME}" ]]; then | ||
| panic "CLUSTER_NAME must be set" | ||
| fi | ||
|
|
||
| echo -e "${YELLOW}Downloading ${CYAN}k3d@${k3dVersion} ${NC}see: ${K3D_URL}" | ||
| curl --silent --fail ${K3D_URL} | TAG=${k3dVersion} bash | ||
|
|
||
| echo -e "\existing_network${YELLOW}Teardown cluster ${CYAN}$name ${NC}" |
There was a problem hiding this comment.
I think you mentioned kind action in a related issue. Teardown also does not install kind again.
This should clean-up the k3s cluster running (if any), so that https://github.com/nektos/act can be used repeatedly.