mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-06 17:24:16 +02:00
fixup! fixup! add should fail on 40x
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
@@ -397,9 +397,9 @@ func TestBuildWithHTTPError(t *testing.T) {
|
||||
"-t", dockerImage,
|
||||
"-f", dockerfile,
|
||||
repo})...)
|
||||
out, err := RunCommandWithoutTest(dockerCmd)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
|
||||
_, err := RunCommandWithoutTest(dockerCmd)
|
||||
if err == nil {
|
||||
t.Fatalf("an error was expected")
|
||||
}
|
||||
|
||||
// Build with kaniko
|
||||
@@ -414,15 +414,10 @@ func TestBuildWithHTTPError(t *testing.T) {
|
||||
|
||||
kanikoCmd := exec.Command("docker", dockerRunFlags...)
|
||||
|
||||
out, err = RunCommandWithoutTest(kanikoCmd)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to build image %s with kaniko command %q: %v %s", dockerImage, kanikoCmd.Args, err, string(out))
|
||||
_, err = RunCommandWithoutTest(kanikoCmd)
|
||||
if err == nil {
|
||||
t.Fatalf("an error was expected")
|
||||
}
|
||||
|
||||
diff := containerDiff(t, daemonPrefix+dockerImage, kanikoImage, "--no-cache")
|
||||
|
||||
expected := fmt.Sprintf(emptyContainerDiff, dockerImage, kanikoImage, dockerImage, kanikoImage)
|
||||
checkContainerDiffOutput(t, diff, expected)
|
||||
}
|
||||
|
||||
func TestLayers(t *testing.T) {
|
||||
|
||||
+1
-1
@@ -547,7 +547,7 @@ func DownloadFileToDest(rawurl, dest string, uid, gid int64) error {
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode >= 400 {
|
||||
return fmt.Errorf("%s failed with %d", rawurl, resp.StatusCode)
|
||||
return fmt.Errorf("invalid response status %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
if err := CreateFile(dest, resp.Body, 0600, uint32(uid), uint32(gid)); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user