mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-03 23:51:54 +02:00
@@ -0,0 +1,4 @@
|
||||
FROM debian:9.11
|
||||
|
||||
# Testing that any HTTP failure is handled properly
|
||||
ADD https://httpstat.us/404 .
|
||||
@@ -545,6 +545,11 @@ func DownloadFileToDest(rawurl, dest string, uid, gid int64) error {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode >= 400 {
|
||||
return fmt.Errorf("%s failed with %d", rawurl, resp.StatusCode)
|
||||
}
|
||||
|
||||
if err := CreateFile(dest, resp.Body, 0600, uint32(uid), uint32(gid)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user