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

Make ensure-availability a bulk API call. #115

Merged
merged 1 commit into from Jun 19, 2014
Merged

Make ensure-availability a bulk API call. #115

merged 1 commit into from Jun 19, 2014

Conversation

tasdomas
Copy link
Contributor

Makin ensure-availability a bulk API call.

return params.StateServersChanges{}, fmt.Errorf("invalid environment tag: %v", err)
}
_, err := c.api.state.FindEntity(spec.EnvironTag)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Please use an inline err check like is done in the ParseEnvironTag call above

@wallyworld
Copy link
Member

Looks pretty good. We are missing some testing coverage though for the case where an invalid environ tag is passed in.
Also, this change will break compatibility with older 1.19 clients. Since 1.19 is a dev release, this is ok but we need to ensure the release notes include information on the incompatibility.

@perrito666
Copy link

I am not so savvy on this part of juju to pass a more meaningful review, but my 2c here, ill agree with @wallyworld I see a not so trivial set of changes and you did not touch a single test file, I would have expected some tests broken after this, if not it is a great opportunity to increase coverage.

@tasdomas
Copy link
Contributor Author

wallyworld, perito666 - thanks for the reviews, I've fixed the style issues and added a test for a call with an invalid environment tag

@@ -772,14 +772,22 @@ func (c *Client) APIHostPorts() ([][]network.HostPort, error) {

// EnsureAvailability ensures the availability of Juju state servers.
func (c *Client) EnsureAvailability(numStateServers int, cons constraints.Value, series string) (params.StateServersChanges, error) {
var result params.StateServersChanges
var results params.StateServersChangeResults
args := params.StateServersSpec{

Choose a reason for hiding this comment

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

I'd just do:

args := params.StateServersSpecs{
    Specs: []params.StateServersSpec{{
        EnvironTag:           c.st.EnvironTag(),
        NumStateServers: numStateServers,
        Constraints:           cons,
        Series:                   series,
}}}

@dimitern
Copy link

A few comments about making the API changes more consistent, but otherwise looks good.


// StateServersChangeResult contains the results
// of a single EnsureAvailability API call, or
// the error..

Choose a reason for hiding this comment

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

s/the error../an error./

@dimitern
Copy link

Thank you! LGTM with tiny a doc comment change.

@tasdomas
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jun 19, 2014

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

jujubot added a commit that referenced this pull request Jun 19, 2014
Make ensure-availability a bulk API call.

Makin ensure-availability a bulk API call.
@jujubot jujubot merged commit 0204369 into juju:master Jun 19, 2014
@tasdomas tasdomas deleted the ensure-availability-bulk-api branch July 1, 2014 15:46
ericsnowcurrently pushed a commit to ericsnowcurrently/juju that referenced this pull request May 26, 2015
laszlokajtar pushed a commit to laszlokajtar/juju that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants