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

Allow enable-ha to work regardless of selected model #6421

Merged
merged 8 commits into from Oct 11, 2016

Conversation

mjs
Copy link

@mjs mjs commented Oct 11, 2016

juju enable-ha now just works without requiring the controller model be selected.

There were a number of things done to make this work and some cleanup too:

  • The HighAvailability facade is now available for controller logins. It is also still available for model logins for compatibility with clients outside of Juju.
  • The unnecessarily exposed apiserver.highavailability.EnableHASingle function has been hidden.
  • The EnableHA API call will now fail if given more than one controller spec. Passing more than one makes no sense. This allowed EnableHA to be somewhat simplified.
  • Support has been removed for the model-tag field previously validated (but not used) by the EnableHA API. This will not break old clients if they send it, but it is no longer checked.
  • The client side highavailability facade no longer sends the model tag.
  • The juju enable-ha command is now a controller command instead of a model command. This means that -m controller is no longer necessary and the -c arg is now available if needed.

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

QA

Ran juju enable-ha with various arguments when the default model was selected.

Also confirmed that an rc3 client can enable HA as before using juju enable-ha -m controller.

Menno Smits added 2 commits October 11, 2016 11:15
This closes a small testing gap.
This facade should have always been for controller logins only, but it
has been left exposed for model only logins for compatibility reasons.
Copy link
Member

@wallyworld wallyworld left a comment

Choose a reason for hiding this comment

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

Did you also test with a rc3 client which still expects the facade to be a model facade? To simulate what externals clients would be calling.

@@ -54,23 +54,32 @@ func NewHighAvailabilityAPI(st *state.State, resources facade.Resources, authori
}, nil
}

// EnableHA adds controller machines as necessary to ensure the
// controller has the number of machine specified.
Copy link
Member

Choose a reason for hiding this comment

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

machines

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -27,6 +27,7 @@ var controllerFacadeNames = set.NewStrings(
var commonFacadeNames = set.NewStrings(
"Pinger",
"Bundle",
"HighAvailability", // Exposed for model logins for backwards compatibility.
Copy link
Member

Choose a reason for hiding this comment

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

Can you make this a bug TODO to fix once we very that no external clients use it. Target the bug to 2.0.1

Copy link
Author

Choose a reason for hiding this comment

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

Done.

to ensure that the specified number of controllers are made available.
must itself be highly available. The enable-ha command will ensure
that the specified number of controller machines are used to make up the
controller.
Copy link
Member

Choose a reason for hiding this comment

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

... are used to make up the controller cluster.

Perhaps? TBH, "...the specified number of controllers...." reads ok to me.

Copy link
Author

Choose a reason for hiding this comment

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

As per IRC, I'm pretty sure that "controller" is supposed to refer to the cluster (if any).

Menno Smits added 6 commits October 11, 2016 14:54
This function is no longer called outside the package. Removed the
misleading docstring too.
There is no way that EnableHA could support anything but one controller
so return an error if more than one controller spec is passed. Limiting
handling to just one spec also allowed signficant simplification of the
EnableHA function.
The model tag field accepted by EnableHA was optional and validated but
not actually used for anything. It didn't make sense anyway and wasnt'
being tested.

Removing it won't break older clients. The field will just be ignored.
It never made sense and is no longer checked server side. It wasn't
being tested here either.
The enable-ha command is now a controller command instead of a model
command. This means it can be issued regardless of the currently
selected model.

Also improved the command help text slightly.

Fixes https://bugs.launchpad.net/juju/+bug/1607170
@mjs
Copy link
Author

mjs commented Oct 11, 2016

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Oct 11, 2016

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

@jujubot jujubot merged commit 0a51043 into juju:master Oct 11, 2016
@mjs mjs deleted the 1607170-enable-ha-args branch October 11, 2016 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants