destroy-environment no longer removes .jenv
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Andrew Wilkins |
Bug Description
Running "juju destroy-
Steps to reproduce:
1. Install a fresh ubuntu server inside a KVM to use as a bootstrap node.
2. run "juju init; juju switch null"
3. edit ~/.juju/
4. run "juju bootstrap". Since step 3 introduced a typo, the environment fails to bootstrap.
5. correct the typo.
6. Run "juju destroy-
7. Run "juju bootstrap" again.
What happens:
The first Ip address entered is used in all subsequent bootstraps. Juju destroy-environment 's behavior is not consistent with other providers implementations.
What was expected:
The juju destroy-environment command should remove the ~/.juju/
Subjective comment:
It is reasonable to assume that "juju destroy-
ADDENDUM
This affects several providers
Related branches
- Juju Engineering: Pending requested
-
Diff: 936 lines (+564/-49)19 files modifiedcmd/juju/destroyenvironment.go (+12/-4)
cmd/jujud/machine.go (+3/-0)
environs/manual/provisioner.go (+1/-1)
provider/dummy/environs.go (+3/-1)
provider/null/environ.go (+1/-1)
state/api/client.go (+6/-0)
state/api/machiner/environ.go (+41/-0)
state/api/machiner/machine.go (+2/-20)
state/api/machiner/machiner.go (+39/-3)
state/api/params/internal.go (+6/-0)
state/apiserver/client/destroyjuju.go (+126/-0)
state/apiserver/client/destroyjuju_test.go (+118/-0)
state/apiserver/machine/machiner.go (+31/-3)
state/environ.go (+64/-12)
state/interface.go (+1/-0)
state/state.go (+23/-2)
state/state_test.go (+36/-0)
state/watcher.go (+5/-0)
worker/machiner/machiner.go (+46/-2)
tags: | added: landscape |
summary: |
- Juju manual provider does not destroy the .jenv file when running - destroy-environment + destroy-environment no longer removes .jenv |
Changed in juju-core: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 1.17.0 |
tags: | added: destroy-environment |
tags: | added: charmers |
description: | updated |
Changed in juju-core: | |
assignee: | nobody → Andrew Wilkins (axwalk) |
milestone: | 1.17.0 → 2.0 |
Changed in juju-core: | |
status: | In Progress → Won't Fix |
status: | Won't Fix → Fix Committed |
milestone: | 2.0 → 1.17.1 |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
tags: | added: micro-cluster |
[I'm going to assume that the destroy-environment command
above printed an error message and failed - if not, my assumptions
are faulty and there's another problem going on that I have not
identified]
I think there are at least two issues going on here:
Firstly: if the bootstrap fails and the .jenv file has been
created as a result of bootstrapping, it's not removed.
I think it should.
Secondly: if destroy-environment fails to talk to the
provider, the .jenv file is not removed. This is more arguable.
It may be that the error is transient, and that running
destroy-environment again may succeed. In that
case, do we really want to destroy the .jenv file,
which may be our only handle on the environment,
including references to resources that need to be cleaned up?
To solve the second issue, perhaps we should have a --force
flag on destroy-environment which forces removal of the
.jenv file even if we cannot talk to the environment That is
slightly awkward though, as we already have a --yes flag which could
be construed as similar.
As another passing thought, we could potentially have a
"juju forget-environment" command that just removes the .jenv file without attempting
to destroy the environment. When people are passing .jenv
files around a lot, perhaps this might make sense. I'm
not keen currently though.