forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/asset/cluster: Pull metadata into the Cluster asset
Terraform can die part-way through launching a cluster for many reasons, and we want it to be easy for users to clean up. destroy-cluster gets its teardown information from metadata.json, but before this commit we were only writing the file after a successful Terraform run. That left users with failed Terraform runs scrambling to delete their cluster on their own (e.g. with virsh-cleanup.sh or other external tools). One solution to this problem would be to move the Metadata asset before the Cluster asset in targetAssets. But Abhinav wants: * To provide metadata about the cluster (e.g. bootstrap and master IPs) that is only available after Terraform wraps up. * To minimize the number of assets, so no pre-terraform-metadata.json and post-terraform-metadata.json as separate assets. This commit squashes the metadata file into the Cluster asset, so we can fill it in as we go. I've also updated openshift-install to write any files from failed assets before exiting, so we can land the metadata and recovered Terraform state where the user can find them before we die. To avoid nil-dereference panics after this change, I've also updated a number of Files() implementations to avoid returning a [<nil>] slice. The SilenceError and SilenceUsage additions work around [1]. [1]: spf13/cobra#340
- Loading branch information
Showing
13 changed files
with
112 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters