Skip to content

Commit a828d10

Browse files
committed
fix(ci): use the api.us1.sysdig.com url in case of secure.sysdig.com
1 parent 627b8ab commit a828d10

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sysdig/resource_sysdig_secure_accept_vulnerability_risk_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package sysdig_test
44

55
import (
6+
"os"
67
"testing"
78

89
"github.com/draios/terraform-provider-sysdig/sysdig"
@@ -15,6 +16,14 @@ func TestAcceptSecureVulnerabilityRisk(t *testing.T) {
1516
PreCheck: preCheckAnyEnv(t, SysdigSecureApiTokenEnv),
1617
ProviderFactories: map[string]func() (*schema.Provider, error){
1718
"sysdig": func() (*schema.Provider, error) {
19+
// Temporal hack to validate the resource in the CI.
20+
// The endpoint https://secure.sysdig.com cannot be used for this, and is the default if the env var is not provided.
21+
// It works in all other regions but US1, in US1 you need to specify https://api.us1.sysdig.com. The fix is on it's way.
22+
// We only need this for the tests to pass. A workaround for this bug can be applied by users by specifying a new alias
23+
// provider and specifying the concrete url for this alias provider.
24+
if url := os.Getenv("SYSDIG_SECURE_URL"); url == "https://secure.sysdig.com" || url == "" {
25+
os.Setenv("SYSDIG_SECURE_URL", "https://api.us1.sysdig.com")
26+
}
1827
return sysdig.Provider(), nil
1928
},
2029
},

0 commit comments

Comments
 (0)