Skip to content
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

Register the alternative name for lxd #9468

Merged
merged 3 commits into from
Nov 20, 2018

Conversation

SimonRichardson
Copy link
Member

Description of change

The following registers the alternative name for the localhost
lxd provider. This way we can bootstrap juju just using the
alternative name "lxd" rather than the perceived more popular one
"localhost".

The question of if this is correct or not is a bit of a concern.
Why we don't reconcile both localhost and lxd names and normalise
them to mean the same one when bootstrapping seems a mystery.

Anyway, I'll supply a good deal of Cunningham's Law to this and
see what the fallout to that is.

QA steps

juju bootstrap lxd

Documentation changes

This is a regression from 2.4, where you could bootstrap using
"lxd" correctly.

Bug reference

N/A

The following registers the alternative name for the localhost
lxd provider. This way we can bootstrap juju just using the
alternative name "lxd" rather than the perceived more popular one
"localhost".

The question of if this is correct or not is a bit of a concern.
Why we don't reconcile both localhost and lxd names and normalise
them to mean the same one when bootstrapping seems a mystery.

Anyway, I'll supply a good deal of Cunningham's Law to this and
see what the fallout to that is.
Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally RegisterCredentials would be told information about the cloud that is being used, and it would only register credentials for that cloud. It seems odd that
juju bootstrap lxd-otherhost

would end up trying to connect to my local lxd and generate 'localhost' credentials.

@SimonRichardson
Copy link
Member Author

Also check if there is no lxd present locally, to allow bootstrapping.

@SimonRichardson
Copy link
Member Author

Also check if there is no lxd present locally, to allow bootstrapping.

Disabling lxd (via a snap) and attempting to bootstrap to a local provider works the same as 2.4, which is to say that it outputs the following https://pastebin.canonical.com/p/7WnvnT92v8/

Only register clouds that we're certain we actually need, so in this
instance, if you're registering "lxd-test" (a remote server) then the
idea is not to register "localhost" or "lxd" credentials.
provider/lxd/credentials.go Outdated Show resolved Hide resolved
provider/lxd/credentials.go Outdated Show resolved Hide resolved
The following commit changes the signature of RegisterCredentials.
Now the method takes a cloud.Cloud, which should allow other providers
to take advantage of possible things like auth types etc. This makes
the method a lot more generic and less focused on just the lxd
provider.
Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the tweaks

@SimonRichardson
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit 9b1bc1d into juju:develop Nov 20, 2018
@SimonRichardson SimonRichardson deleted the register-lxd branch February 19, 2019 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants