-
Notifications
You must be signed in to change notification settings - Fork 2
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
Move the terraform delete and terraform list to util #111
base: main
Are you sure you want to change the base?
Conversation
originally, changes where present.
@@ -4104,14 +4029,14 @@ fi | |||
# Does not return | |||
# | |||
if [ $gl_tf_terminate -eq 1 ]; then | |||
tf_terminate | |||
source $UTILS_DIR/terraform_ops --terminate_list $gl_tf_term_list |
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.
Does this need to be source
'd in?
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.
Yes we want burden to terminate when the script is done. We could duplicate the logic, but then would have to deal with rtcs coming back.
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.
Wouldn't it make more sense to have this logic as a function, then source the script as if it's a library and call the function?
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.
Part of the idea, is these are also standalone. So you are able to call terraform_ops outside of burden.
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.
If it was truly standalone, it would be essentially a script you call, check the exit code of, and handle appropriately. As it is now, it relies on stuff within Zathras (cleanup_and_exit
)
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.
Let's nudge this one.
I think it would be clearer for this to be it's own standalone script that can be used elsewhere.
Move the terraform list and terraform delete code from burden into its own script. burden will go these scripts to perform the operation. Note, this is only used if we told Zathras not to tear down the cloud image upon completion of the test. Zathras will still use the ansible roles tf_delete if we are to tear down the image at the completion of the test.