provider/lxd: cache certs in juju/lxd dir #6903

Merged
merged 2 commits into from Feb 2, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Feb 2, 2017

Description of change

When bootstrapping LXD, we will now cache the generated credential in ~/.local/share/juju/lxd. This allows us to use the same certificates each time we bootstrap, rather than a fresh one each time. Since we'll only generate one, and upload it once, we no longer need to remove certs on controller destruction.

QA steps

juju bootstrap localhost b
juju bootstrap localhost a
juju add-model foo
juju migrate foo b
(confirm model migrated)
juju destroy-controller -y a
juju destroy-controller -y b

juju bootstrap localhost (with juju 2.0)
juju destroy-controller -y localhost-localhost (with this branch)

juju bootstrap localhost (with juju 2.0)
juju upgrade-juju -m controller (with this branch)
juju destroy-controller -y localhost-localhost (with this branch)

Documentation changes

No change.

Bug reference

Fixes https://bugs.launchpad.net/juju/+bug/1661091

All that nice new lxd provider code from a day or so ago gone.

provider/lxd/credentials.go
+
+ // Next we look in the LXD config dir, in case the user has
+ // a client certificate/key pair for use with the "lxc" client
+ // application.A

axw added some commits Feb 2, 2017

provider/lxd: cache certs in juju/lxd dir
When finalizing partial cert credentials,
we will store any generated certificate
key pair in the ~/.local/share/juju/lxd
dir. Since we'll only generate one, and
upload it once, we no longer need to
remove certs on controller destruction.

Fixes https://bugs.launchpad.net/juju/+bug/1661091
cmd/modelcmd: finalize detected creds again
When bootstrapping with detected credentials,
we do not store the credential name in the
bootstrap config. Thus, when you run a command
like "destroy-controller" or "kill-controller"
that wants to get the credentials, we re-detect
them. We must also finalize those detected
credentials, like we do at bootstrap time.
Member

axw commented Feb 2, 2017

All that nice new lxd provider code from a day or so ago gone.

I like to think that it was replaced with nicer code at least ;)

Member

axw commented Feb 2, 2017

$$fixes-1661091$$

Contributor

jujubot commented Feb 2, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Feb 2, 2017

Build failed: Does not match ['fixes-1660877']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10176

Member

axw commented Feb 2, 2017

$$howaboutnow$$

Contributor

jujubot commented Feb 2, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Feb 2, 2017

Build failed: Does not match ['fixes-1660877']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10178

Owner

wallyworld commented Feb 2, 2017

$$JFDI$$

Contributor

jujubot commented Feb 2, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Feb 2, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10189

Member

axw commented Feb 2, 2017

$$JFDI$$

Contributor

jujubot commented Feb 2, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 87c32d9 into juju:2.1 Feb 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment