This commit is contained in:
Tejal Desai 2020-06-05 23:47:31 -07:00
parent 58276274e8
commit 01c3a1bcf3
2 changed files with 22 additions and 26 deletions

View File

@ -273,13 +273,11 @@ func (d *DockerFileBuilder) BuildImageWithContext(config *integrationTestConfig,
kanikoImage := GetKanikoImage(imageRepo, dockerfile)
timer = timing.Start(dockerfile + "_kaniko")
out, err := buildKanikoImage(dockerfilesPath, dockerfile, buildArgs, additionalKanikoFlags, kanikoImage,
contextDir, gcsBucket, serviceAccount, true)
if err != nil {
if _, err := buildKanikoImage(dockerfilesPath, dockerfile, buildArgs, additionalKanikoFlags, kanikoImage,
contextDir, gcsBucket, serviceAccount, true); err != nil {
return err
}
timing.DefaultRun.Stop(timer)
fmt.Println(out)
d.filesBuilt[dockerfile] = struct{}{}
@ -454,6 +452,5 @@ func buildKanikoImage(
return "", fmt.Errorf("Output check failed for image %s with kaniko command : %s %s", kanikoImage, err, string(out))
}
}
fmt.Println("kaniko command\n", string(out))
return benchmarkDir, nil
}

View File

@ -142,26 +142,26 @@ func buildRequiredImages() error {
name: "Building kaniko image",
command: []string{"docker", "build", "-t", ExecutorImage, "-f", "../deploy/Dockerfile", ".."},
},
//{
// name: "Building cache warmer image",
// command: []string{"docker", "build", "-t", WarmerImage, "-f", "../deploy/Dockerfile_warmer", ".."},
//},
//{
// name: "Building onbuild base image",
// command: []string{"docker", "build", "-t", config.onbuildBaseImage, "-f", fmt.Sprintf("%s/Dockerfile_onbuild_base", dockerfilesPath), "."},
//},
//{
// name: "Pushing onbuild base image",
// command: []string{"docker", "push", config.onbuildBaseImage},
//},
//{
// name: "Building hardlink base image",
// command: []string{"docker", "build", "-t", config.hardlinkBaseImage, "-f", fmt.Sprintf("%s/Dockerfile_hardlink_base", dockerfilesPath), "."},
//},
//{
// name: "Pushing hardlink base image",
// command: []string{"docker", "push", config.hardlinkBaseImage},
//},
{
name: "Building cache warmer image",
command: []string{"docker", "build", "-t", WarmerImage, "-f", "../deploy/Dockerfile_warmer", ".."},
},
{
name: "Building onbuild base image",
command: []string{"docker", "build", "-t", config.onbuildBaseImage, "-f", fmt.Sprintf("%s/Dockerfile_onbuild_base", dockerfilesPath), "."},
},
{
name: "Pushing onbuild base image",
command: []string{"docker", "push", config.onbuildBaseImage},
},
{
name: "Building hardlink base image",
command: []string{"docker", "build", "-t", config.hardlinkBaseImage, "-f", fmt.Sprintf("%s/Dockerfile_hardlink_base", dockerfilesPath), "."},
},
{
name: "Pushing hardlink base image",
command: []string{"docker", "push", config.hardlinkBaseImage},
},
}
for _, setupCmd := range setupCommands {
@ -294,7 +294,6 @@ func TestGitBuildcontextSubPath(t *testing.T) {
kanikoCmd := exec.Command("docker", dockerRunFlags...)
out, err = RunCommandWithoutTest(kanikoCmd)
fmt.Println(out)
if err != nil {
t.Errorf("Failed to build image %s with kaniko command %q: %v %s", dockerImage, kanikoCmd.Args, err, string(out))
}