Skip to content

Fix behaviour of rmi -f with unexpected errors - #654

Merged
vdemeester merged 2 commits into
docker:masterfrom
dnephin:pr-fix-image-rm
Oct 31, 2017
Merged

Fix behaviour of rmi -f with unexpected errors#654
vdemeester merged 2 commits into
docker:masterfrom
dnephin:pr-fix-image-rm

Conversation

@dnephin

@dnephindnephin commented Oct 30, 2017

Copy link
Copy Markdown
Contributor

Carry #418
Closes#418
Closes#567

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #654 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@ Coverage Diff @@## master #654 +/- ##
==========================================
+ Coverage 50.02% 50.03% +0.01% 
==========================================
Files 216 216 Lines 17676 17680 +4 ==========================================
+ Hits 8842 8846 +4 
Misses 8391 8391 Partials 443 443

@dnephindnephin left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First commit from #418 LGTM

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for carrying!

@vdemeestervdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐮

@vdemeester
vdemeester merged commit 6e04da3 into docker:masterOct 31, 2017
@GordonTheTurtleGordonTheTurtle added this to the 17.11.0 milestone Oct 31, 2017
@thaJeztahthaJeztah modified the milestones: 17.11.0, 17.12.0Oct 31, 2017
@dnephin
dnephin deleted the pr-fix-image-rm branch October 31, 2017 14:50
@asottile

Copy link
Copy Markdown

Noticed this PR while trying to debug the following oddity (missing trailing newline):

$ docker --version
Docker version 17.09.0-ce, build afdb6d4
$ docker rmi doesnt_exist -f
Error: No such image: doesnt_exist$ 

This patch (or something related to it) fixes that but changes the exit code:

root@91136c2cdac6:/go/src/github.com/docker/docker# docker rmi -f doesnt_exist; echo $?
Error response from daemon: No such image: doesnt_exist:latest
1

From this it seems intentional, but perhaps unfortunate:
this is now inconsistent behaviour from what I would expect with (coreutils) rm ... vs rm -f ... (the latter exiting 0 even if the thing doesn't exist).

@dnephin

Copy link
Copy Markdown
ContributorAuthor

This PR should actually fix the problem you see in 17.09. It'll be in 17.12

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@dnephin@codecov-io@asottile@vdemeester@thaJeztah@GordonTheTurtle@adshmh