Skip to content

Commit d8d5217

Browse files
authored
feat(organization): add hidden async option to organizations endpoint to support onboarding of large organizations (#594)
* add async option to organizations endpoint * use async option when specific hidden environment variable is set
1 parent 513ca26 commit d8d5217

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sysdig/internal/client/v2/organization.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"net/http"
7+
"os"
78
)
89

910
const (
@@ -104,9 +105,17 @@ func (client *Client) UpdateOrganizationSecure(ctx context.Context, orgID string
104105
}
105106

106107
func (client *Client) organizationsURL() string {
107-
return fmt.Sprintf(organizationsPath, client.config.url)
108+
url := fmt.Sprintf(organizationsPath, client.config.url)
109+
if os.Getenv("SYSDIG_ORG_API_ASYNC") == "true" {
110+
url += "?async=true"
111+
}
112+
return url
108113
}
109114

110115
func (client *Client) organizationURL(orgId string) string {
111-
return fmt.Sprintf(organizationPath, client.config.url, orgId)
116+
url := fmt.Sprintf(organizationPath, client.config.url, orgId)
117+
if os.Getenv("SYSDIG_ORG_API_ASYNC") == "true" {
118+
url += "?async=true"
119+
}
120+
return url
112121
}

0 commit comments

Comments
 (0)