From 07d67e579683066f8b7080862762f864c8d8016d Mon Sep 17 00:00:00 2001 From: Christopher Geers Date: Sat, 28 Oct 2023 23:33:10 -0500 Subject: [PATCH] fix(cloudauth): allow success on response OK, Created, Accepted --- sysdig/internal/client/v2/organization.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdig/internal/client/v2/organization.go b/sysdig/internal/client/v2/organization.go index 5b5c6ad62..4c9342077 100644 --- a/sysdig/internal/client/v2/organization.go +++ b/sysdig/internal/client/v2/organization.go @@ -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 } @@ -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 }