5
5
"os"
6
6
"regexp"
7
7
8
+ "github.com/scaleway/terraform-provider-scaleway/v2/internal/env"
8
9
"github.com/scaleway/terraform-provider-scaleway/v2/internal/logging"
9
10
)
10
11
@@ -22,11 +23,11 @@ var (
22
23
)
23
24
24
25
func init () {
25
- testDomainPtr := flag .String ("test-domain" , os .Getenv ("TF_TEST_DOMAIN" ), "Test domain" )
26
+ testDomainPtr := flag .String ("test-domain" , os .Getenv (env . TestDomain ), "Test domain" )
26
27
if testDomainPtr != nil && * testDomainPtr != "" {
27
28
TestDomain = * testDomainPtr
28
29
} else {
29
- logging .L .Infof ("environment variable TF_TEST_DOMAIN is required" )
30
+ logging .L .Infof ("environment variable %s is required" , env . TestDomain )
30
31
31
32
return
32
33
}
@@ -43,18 +44,18 @@ func init() {
43
44
}
44
45
45
46
if isReserved {
46
- logging .L .Warningf ("TF_TEST_DOMAIN cannot be a Scaleway required domain. Please use another one." )
47
+ logging .L .Warningf ("%s cannot be a Scaleway required domain. Please use another one." , env . TestDomain )
47
48
48
49
return
49
50
}
50
51
51
52
logging .L .Infof ("start domain record test with domain: %s" , TestDomain )
52
53
53
- testDomainZonePtr := flag .String ("test-domain-zone" , os .Getenv ("TF_TEST_DOMAIN_ZONE" ), "Test domain zone" )
54
+ testDomainZonePtr := flag .String ("test-domain-zone" , os .Getenv (env . TestDomainZone ), "Test domain zone" )
54
55
if testDomainZonePtr != nil && * testDomainZonePtr != "" {
55
56
TestDomainZone = * testDomainZonePtr
56
57
} else {
57
- logging .L .Infof ("environment variable TF_TEST_DOMAIN_ZONE is required" )
58
+ logging .L .Infof ("environment variable %s is required" , env . TestDomainZone )
58
59
59
60
return
60
61
}
0 commit comments