-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a local environment that implements config.Env interface (#831)
- Loading branch information
1 parent
3b71e7f
commit ef99991
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package local | ||
|
||
import ( | ||
"github.com/DataDog/test-infra-definitions/common/config" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
type Environment struct { | ||
// CommonEnvironment is the common environment for all the components | ||
// in the test-infra-definitions. | ||
*config.CommonEnvironment | ||
} | ||
|
||
var _ config.Env = (*Environment)(nil) | ||
|
||
// NewEnvironment creates a new local environment. | ||
func NewEnvironment(ctx *pulumi.Context) (Environment, error) { | ||
env := Environment{} | ||
|
||
commonEnv, err := config.NewCommonEnvironment(ctx) | ||
if err != nil { | ||
return Environment{}, err | ||
} | ||
|
||
env.CommonEnvironment = &commonEnv | ||
|
||
return env, nil | ||
} | ||
|
||
// 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" | ||
} |