Always ask controller about models to migrate. #6592

Merged
merged 1 commit into from Nov 23, 2016

Conversation

Projects
None yet
3 participants
Owner

howbazaar commented Nov 22, 2016

Rather than rely on the admin's locally cached info, always ask the controller about the models when determining the model uuid to migrate.

@howbazaar howbazaar changed the base branch from staging to develop Nov 22, 2016

Owner

howbazaar commented Nov 22, 2016

QA

Bootstrapped two lxd controllers, source and target
Added a user to both of them
For the user, gave it a different XDG_DATA_HOME, and registered the users and added a model.
Then from the admin's source, set up the migration.
It migrated.

mjs approved these changes Nov 22, 2016

Thanks for sorting this out. Looks good - just a couple of suggestions.

+ // with that name.
+ owner := ""
+ name := c.model
+ if strings.Contains(name, "/") {
@mjs

mjs Nov 22, 2016

Contributor

There's no helper for this already?

@howbazaar

howbazaar Nov 23, 2016

Owner

It appears not.

cmd/juju/commands/migrate.go
+ if owner != "" && model.Owner != owner {
+ continue
+ }
+ matches = append(matches, model)
@mjs

mjs Nov 22, 2016

Contributor

I would have done:

if model.Name == name && (owner == "" || model.Owner == owner) {
     matches = append(matches, model)
}

perhaps with a helper for the owner matching part.

Owner

howbazaar commented Nov 23, 2016

$$merge$$

Contributor

jujubot commented Nov 23, 2016

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

Contributor

jujubot commented Nov 23, 2016

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

Owner

howbazaar commented Nov 23, 2016

intermittent failure:
FAIL: pinger_test.go:104: pingerSuite.TestAgentConnectionDelaysShutdownWithPing

$$merge$$

Contributor

jujubot commented Nov 23, 2016

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

@jujubot jujubot merged commit 1cbd051 into juju:develop Nov 23, 2016

@howbazaar howbazaar deleted the howbazaar:migration-others-model branch Nov 23, 2016

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