-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenvironment.go
More file actions
70 lines (53 loc) · 1.8 KB
/
Copy pathenvironment.go
File metadata and controls
70 lines (53 loc) · 1.8 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package local
import (
config "github.com/DataDog/test-infra-definitions/common/config"
"github.com/DataDog/test-infra-definitions/common/namer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
const (
localNamerNamespace = "local"
// local Infra (local)
DDInfraDefaultPublicKeyPath = "local/defaultPublicKeyPath"
DDInfraOpenShiftPullSecretPath = "local/openshift/pullSecretPath"
)
type Environment struct {
*config.CommonEnvironment
Namer namer.Namer
}
var _ config.Env = (*Environment)(nil)
func NewEnvironment(ctx *pulumi.Context) (Environment, error) {
env := Environment{
Namer: namer.NewNamer(ctx, localNamerNamespace),
}
commonEnv, err := config.NewCommonEnvironment(ctx)
if err != nil {
return Environment{}, err
}
env.CommonEnvironment = &commonEnv
return env, nil
}
// Cross Cloud Provider config
// InternalRegistry returns the internal registry.
func (e *Environment) InternalRegistry() string {
return "none"
}
// InternalDockerhubMirror returns the internal Dockerhub mirror.
func (e *Environment) InternalDockerhubMirror() string {
return "registry-1.docker.io"
}
// InternalRegistryImageTagExists returns true if the image tag exists in the internal registry.
func (e *Environment) InternalRegistryImageTagExists(_, _ string) (bool, error) {
return true, nil
}
// InternalRegistryFullImagePathExists returns true if the image and tag exists in the internal registry.
func (e *Environment) InternalRegistryFullImagePathExists(_ string) (bool, error) {
return true, nil
}
// Common
func (e *Environment) DefaultPublicKeyPath() string {
return e.InfraConfig.Get(DDInfraDefaultPublicKeyPath)
}
// OpenShiftPullSecretPath returns the path to the OpenShift pull secret file
func (e *Environment) OpenShiftPullSecretPath() string {
return e.InfraConfig.Get(DDInfraOpenShiftPullSecretPath)
}