Skip to content

Commit

Permalink
fix(cloudauth): allow success on response OK, Created, Accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeers committed Oct 29, 2023
1 parent b6b3ddf commit 07d67e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sysdig/internal/client/v2/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (client *Client) CreateOrganizationSecure(ctx context.Context, org *Organiz
}
defer response.Body.Close()

if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated {
if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated && response.StatusCode != http.StatusAccepted {
err = client.ErrorFromResponse(response)
return nil, err
}
Expand Down Expand Up @@ -88,7 +88,7 @@ func (client *Client) UpdateOrganizationSecure(ctx context.Context, orgID string
}
defer response.Body.Close()

if response.StatusCode != http.StatusOK {
if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated && response.StatusCode != http.StatusAccepted {
errStatus, err := client.ErrorAndStatusFromResponse(response)
return nil, errStatus, err
}
Expand Down

0 comments on commit 07d67e5

Please sign in to comment.