@@ -12,18 +12,28 @@ import (
1212)
1313
1414func  TestAcceptSecureVulnerabilityRisk (t  * testing.T ) {
15- 	resource .ParallelTest (t , resource.TestCase {
15+ 	// Temporal hack to validate the resource in the CI. 
16+ 	// The endpoint https://secure.sysdig.com cannot be used for this, and is the default if the env var is not provided. 
17+ 	// 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. 
18+ 	// We only need this for the tests to pass. A workaround for this bug can be applied by users by specifying a new alias 
19+ 	// provider and specifying the concrete url for this alias provider. 
20+ 	url , urlSet  :=  os .LookupEnv ("SYSDIG_SECURE_URL" )
21+ 	if  url  ==  "https://secure.sysdig.com"  ||  url  ==  ""  {
22+ 		os .Setenv ("SYSDIG_SECURE_URL" , "https://api.us1.sysdig.com" )
23+ 	}
24+ 
25+ 	defer  func () {
26+ 		if  urlSet  {
27+ 			os .Setenv ("SYSDIG_SECURE_URL" , url )
28+ 		} else  {
29+ 			os .Unsetenv ("SYSDIG_SECURE_URL" )
30+ 		}
31+ 	}()
32+ 
33+ 	resource .Test (t , resource.TestCase {
1634		PreCheck : preCheckAnyEnv (t , SysdigSecureApiTokenEnv ),
1735		ProviderFactories : map [string ]func () (* schema.Provider , error ){
1836			"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- 				}
2737				return  sysdig .Provider (), nil 
2838			},
2939		},
0 commit comments