Merge branch 'master' of github.com:GoogleCloudPlatform/k8s-container-builder into env-replacement
This commit is contained in:
commit
f6139f249a
4
Makefile
4
Makefile
|
|
@ -48,3 +48,7 @@ test: out/executor out/kbuild
|
||||||
.PHONY: integration-test
|
.PHONY: integration-test
|
||||||
integration-test: out/executor out/kbuild
|
integration-test: out/executor out/kbuild
|
||||||
@ ./integration-test.sh
|
@ ./integration-test.sh
|
||||||
|
|
||||||
|
.PHONY: images
|
||||||
|
images: out/executor out/kbuild
|
||||||
|
docker build -t $(REGISTRY)/executor:latest -f deploy/Dockerfile .
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -116,7 +117,7 @@ func main() {
|
||||||
// Build executor image
|
// Build executor image
|
||||||
buildExecutorImage := step{
|
buildExecutorImage := step{
|
||||||
Name: dockerImage,
|
Name: dockerImage,
|
||||||
Args: []string{"build", "-t", executorImage, "-f", "integration_tests/executor/Dockerfile", "."},
|
Args: []string{"build", "-t", executorImage, "-f", "deploy/Dockerfile", "."},
|
||||||
}
|
}
|
||||||
y := testyaml{
|
y := testyaml{
|
||||||
Steps: []step{containerDiffStep, containerDiffPermissions, structureTestsStep, structureTestPermissions, buildExecutorImage},
|
Steps: []step{containerDiffStep, containerDiffPermissions, structureTestsStep, structureTestPermissions, buildExecutorImage},
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ type EnvCommand struct {
|
||||||
|
|
||||||
func (e *EnvCommand) ExecuteCommand(config *manifest.Schema2Config) error {
|
func (e *EnvCommand) ExecuteCommand(config *manifest.Schema2Config) error {
|
||||||
logrus.Info("cmd: ENV")
|
logrus.Info("cmd: ENV")
|
||||||
|
|
||||||
envString := envToString(e.cmd)
|
envString := envToString(e.cmd)
|
||||||
newEnvs := e.cmd.Env
|
newEnvs := e.cmd.Env
|
||||||
for index, pair := range newEnvs {
|
for index, pair := range newEnvs {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ func Test_EnvExecute(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "$path",
|
Key: "$path",
|
||||||
Value: "$home",
|
Value: "$home/",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -103,7 +103,7 @@ func Test_EnvExecute(t *testing.T) {
|
||||||
"path=/some/path",
|
"path=/some/path",
|
||||||
"home=/root",
|
"home=/root",
|
||||||
"HOME=/root",
|
"HOME=/root",
|
||||||
"/usr/=/root",
|
"/usr/=/root/",
|
||||||
}
|
}
|
||||||
err := envCmd.ExecuteCommand(cfg)
|
err := envCmd.ExecuteCommand(cfg)
|
||||||
testutil.CheckErrorAndDeepEqual(t, false, err, expectedEnvs, cfg.Env)
|
testutil.CheckErrorAndDeepEqual(t, false, err, expectedEnvs, cfg.Env)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ func ResolveEnvironmentReplacementList(command string, values, envs []string, is
|
||||||
var resolvedValues []string
|
var resolvedValues []string
|
||||||
for _, value := range values {
|
for _, value := range values {
|
||||||
resolved, err := ResolveEnvironmentReplacement(command, value, envs, isFilepath)
|
resolved, err := ResolveEnvironmentReplacement(command, value, envs, isFilepath)
|
||||||
logrus.Infof("Resolved %s to %s", value, resolved)
|
logrus.Debugf("Resolved %s to %s", value, resolved)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue