Skip to content

Commit

Permalink
Expect correct http status codes from discovery service
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Feb 21, 2016
1 parent 368c8f6 commit 0764c2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discovery/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ func Add(ctx context.Context, baseURL string, n *Machine) (bool, error) {
return false, err
}
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode == http.StatusConflict {
if resp.StatusCode == http.StatusConflict || resp.StatusCode == http.StatusOK {
return false, nil
}
if resp.StatusCode != http.StatusOK {
if resp.StatusCode != http.StatusCreated {
body, _ := ioutil.ReadAll(resp.Body)
return false, fmt.Errorf("status code %d on PUT for %q: %s", resp.StatusCode, u, body)
}
Expand Down

0 comments on commit 0764c2e

Please sign in to comment.