-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement teardown action #51
base: main
Are you sure you want to change the base?
Changes from 8 commits
ffe861b
73cc0bb
bd92cb2
81f4c0a
c47a901
1d20158
031b06b
7e18408
e068df7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,22 @@ deploy(){ | |
wait_for_nodes | ||
} | ||
|
||
teardown(){ | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, at least for some reason it was needed for https://github.com/nektos/act There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you mentioned kind action in a related issue. Teardown also does not install kind again. |
||
eval "k3d cluster delete $name" | ||
} | ||
|
||
# waits until all nodes are ready | ||
wait_for_nodes(){ | ||
echo -e "${YELLOW}wait until all agents are ready${NC}" | ||
|
@@ -121,6 +137,9 @@ case "$1" in | |
"deploy") | ||
deploy | ||
;; | ||
"teardown") | ||
teardown | ||
;; | ||
# "<put new command here>") | ||
# command_handler | ||
# ;; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.