Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dvalinrh
Copy link
Contributor

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.

@dvalinrh dvalinrh requested a review from a team September 10, 2024 16:17
bin/utils/terraform_ops Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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)

bin/burden Show resolved Hide resolved
bin/utils/terraform_ops Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants