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
Conversation
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.
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
machines
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
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
1896bb0
to
ba13a3d
Compare
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
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:
apiserver.highavailability.EnableHASingle
function has been hidden.EnableHA
API call will now fail if given more than one controller spec. Passing more than one makes no sense. This allowedEnableHA
to be somewhat simplified.model-tag
field previously validated (but not used) by theEnableHA
API. This will not break old clients if they send it, but it is no longer checked.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 thedefault
model was selected.Also confirmed that an rc3 client can enable HA as before using
juju enable-ha -m controller
.