-
Notifications
You must be signed in to change notification settings - Fork 286
/
packages.go
43 lines (36 loc) · 899 Bytes
/
packages.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package e2e
import (
"os"
"regexp"
e2etests "github.com/aws/eks-anywhere/test/framework"
)
const (
packagesRegex = `^.*CuratedPackages.*$`
certManagerRegex = "^.*CuratedPackagesCertManager.*$"
)
func (e *E2ESession) setupPackagesEnv(testRegex string) error {
re := regexp.MustCompile(packagesRegex)
if !re.MatchString(testRegex) {
return nil
}
requiredEnvVars := e2etests.RequiredPackagesEnvVars()
for _, eVar := range requiredEnvVars {
if val, ok := os.LookupEnv(eVar); ok {
e.testEnvVars[eVar] = val
}
}
return nil
}
func (e *E2ESession) setupCertManagerEnv(testRegex string) error {
re := regexp.MustCompile(certManagerRegex)
if !re.MatchString(testRegex) {
return nil
}
requiredEnvVars := e2etests.RequiredCertManagerEnvVars()
for _, eVar := range requiredEnvVars {
if val, ok := os.LookupEnv(eVar); ok {
e.testEnvVars[eVar] = val
}
}
return nil
}