Skip to content

Commit 0764c2e

Browse files
committed
Expect correct http status codes from discovery service
1 parent 368c8f6 commit 0764c2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discovery/endpoints.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ func Add(ctx context.Context, baseURL string, n *Machine) (bool, error) {
9292
return false, err
9393
}
9494
defer func() { _ = resp.Body.Close() }()
95-
if resp.StatusCode == http.StatusConflict {
95+
if resp.StatusCode == http.StatusConflict || resp.StatusCode == http.StatusOK {
9696
return false, nil
9797
}
98-
if resp.StatusCode != http.StatusOK {
98+
if resp.StatusCode != http.StatusCreated {
9999
body, _ := ioutil.ReadAll(resp.Body)
100100
return false, fmt.Errorf("status code %d on PUT for %q: %s", resp.StatusCode, u, body)
101101
}

0 commit comments

Comments
 (0)