Skip to content

Commit

Permalink
fail on image not found without panic; add extra chmod case to test d…
Browse files Browse the repository at this point in the history
…ockerfile
  • Loading branch information
wagoodman committed Dec 2, 2018
1 parent 1baa942 commit 53b11f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM alpine:latest
ADD README.md /somefile.txt
RUN mkdir /root/example
RUN cp /somefile.txt /root/example/somefile1.txt
RUN chmod 444 /root/example/somefile1.txt
RUN cp /somefile.txt /root/example/somefile2.txt
RUN cp /somefile.txt /root/example/somefile3.txt
RUN mv /root/example/somefile3.txt /root/saved.txt
Expand Down
5 changes: 4 additions & 1 deletion image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,10 @@ func getImageReader(imageID string) (io.ReadCloser, int64) {
fmt.Println(" Fetching metadata...")

result, _, err := dockerClient.ImageInspectWithRaw(ctx, imageID)
check(err)
if err != nil {
fmt.Println(err.Error())
utils.Exit(1)
}
totalSize := result.Size

fmt.Println(" Fetching image...")
Expand Down

0 comments on commit 53b11f4

Please sign in to comment.