-
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
cmd/destroy: delete cluster asset after destroying cluster #547
cmd/destroy: delete cluster asset after destroying cluster #547
Conversation
0815032
to
be114d3
Compare
be114d3
to
eef9713
Compare
/retest |
eef9713
to
6e402c1
Compare
Needs a rebase, now that #579 has landed and also touched |
6e402c1
to
b12c1f5
Compare
@wking green again :P |
Save and Purge functions don't really seem to belong to Store interface. Fetch fetches the asset, checkpoints the state file to disk and consumes all the assets that were loaded from disk to create the asset. Also fixes the error in save() where it would only save the assets in memory and drops all the other assets present in the state file but were not fetched into the store's asset map eg: ```console ./openshift-install ign configs # state has everything ./openshift-install install-config # state now only has assets uptill install-config, all the ign config assets are lost from statefile ./openshift-install ign configs # state has everything ./openshift-install install-config # state still includes all the state from 'ign-config' run. ``` Destroy deletes the asset from all the possible sources, state file and disk.
regarding changes to cmd/create.go, each target is a variable to preserve the order when creating subcommands and still allow other functions to directly access each target individually. If could have stored them in maps, but maps returns in random order causing the cli options to look different on each run
b12c1f5
to
b686588
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, 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 |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
I'd expected us to recurse through parents when pruning, but testing this now I see: $ openshift-install --dir=wking --log-level=debug destroy cluster
DEBUG Deleting libvirt network
...
DEBUG goroutine deleteNetwork complete
DEBUG Purging asset "Terraform Variables" from disk
DEBUG Purging asset "Kubeconfig Admin" from disk
DEBUG Purging asset "Cluster" from disk So it looks like we only remove the writeable assets. At least, there's certainly still a lot in the state file: $ jq keys wking/.openshift_install_state.json
[
"*bootstrap.Bootstrap",
"*installconfig.InstallConfig",
"*installconfig.baseDomain",
"*installconfig.clusterID",
"*installconfig.clusterName",
"*installconfig.emailAddress",
"*installconfig.password",
"*installconfig.platform",
"*installconfig.pullSecret",
"*installconfig.sshPublicKey",
"*kubeconfig.Kubelet",
"*machine.Master",
"*machine.Worker",
"*machines.ClusterK8sIO",
"*machines.Master",
"*machines.Worker",
"*manifests.Manifests",
"*manifests.Tectonic",
"*manifests.kubeAddonOperator",
"*manifests.networkOperator",
"*tls.APIServerCertKey",
"*tls.APIServerProxyCertKey",
"*tls.AdminCertKey",
"*tls.AggregatorCA",
"*tls.EtcdCA",
"*tls.EtcdClientCertKey",
"*tls.IngressCertKey",
"*tls.KubeCA",
"*tls.KubeletCertKey",
"*tls.MCSCertKey",
"*tls.RootCA",
"*tls.ServiceAccountKeyPair",
"*tls.ServiceServingCA"
] Was that intentional? Won't those entries (e.g. the 30-minute-valid kubelet cert) still pollute subsequent runs unless the state file is removed? |
Save and Purge functions don't really seem to belong to Store interface.
Fetch fetches the asset, checkpoints the state file to disk and consumes
all the assets that were loaded from disk to create the asset.
Also fixes the error in save() where it would only save the assets in memory and
drops all the other assets present in the state file but were not fetched into the store's
asset map
eg:
asset/store: add Destroy func to Store interface that allows destroying asset
Destroy deletes the asset from all the possible sources, state file and disk.
cmd/destroy: delete cluster asset after destroying cluster
Regarding changes to
cmd/create.go
, each target is a variable to preserve the order whencreating subcommands and still allow other functions to directly access each target individually.
If could have stored them in maps, but maps returns in random order causing the cli options to look
different on each run
/cc @rajatchopra @crawford