-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
pkg/asset/cluster: Don't read empty-string state files #954
pkg/asset/cluster: Don't read empty-string state files #954
Conversation
bffc929
to
68e550f
Compare
Avoid the confusing: ERROR Failed to read tfstate: open : no such file or directory and backing syscall when terraform.Apply returns an empty string. We're not exiting immediately on Apply errors (and are instead attempting to recover the Terraform state regardless of Apply errors) since 78c3118 (pkg: add ClusterMetadata asset,type that can be used for destroy, 2018-09-25, openshift#324). The goal there is to retain the current resource state in case the user wants to investigate the resources associated with the partially-launched cluster and potentially invoke Terraform themselves to finish the install instead of deleting and re-creating their cluster. Apply can return an empty-string state file since 3f4fe57 (cmd/openshift-install: Add 'destroy bootstrap' command, 2018-10-18, leave the temporary directory without a terraform state file. And we don't care about recovering the state file in those cases, because we haven't created any external resources at that point (before the apply call). Also flatten some unnecessary nesting in the err2 handling by using an 'else if' clause.
68e550f
to
9d30577
Compare
All the tests that matter are green :). |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: staebler, wking The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Looks like e2e-aws 3446 succeeded, so... /refresh |
Ah, well. Giving up on job 3446... /test e2e-aws |
/test e2e-aws |
Avoid the confusing:
and backing syscall when
terraform.Apply
returns an empty string.