Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Failing to remove an image, will not remove the image name/tag.#7963

Merged
crosbymichael merged 1 commit into
moby:masterfrom
jessfraz:7845-remove-image-fail-dont-untag
Sep 12, 2014
Merged

Failing to remove an image, will not remove the image name/tag.#7963
crosbymichael merged 1 commit into
moby:masterfrom
jessfraz:7845-remove-image-fail-dont-untag

Conversation

@jessfraz

Copy link
Copy Markdown
Contributor

Fixes #7845 and #7801, and a real pain point I had :)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle [email protected] (github: jfrazelle)

@jessfraz jessfraz force-pushed the 7845-remove-image-fail-dont-untag branch from c68d81a to ed8de6d Compare September 10, 2014 00:37
@jessfraz jessfraz changed the title Removing an image that fails, also removes the container name/tag. Removing an image that fails, also removes the image name/tag. Sep 10, 2014
@estesp

estesp commented Sep 10, 2014

Copy link
Copy Markdown
Contributor

I don't have a vote, but this looks good to me, and the test addition/refactor looks good...I had been noticing this earlier so had a vested interested in seeing this fixed! I saw some debug code left in earlier, but looks like the commit was updated to clean that up.

@jessfraz

Copy link
Copy Markdown
Contributor Author

Comment thread daemon/image_delete.go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if this is the right logic here, but I am trying to see if they are just removing an image "tag" or removing the whole image, basically I want to know up here if it will make it to line #108

@jessfraz jessfraz changed the title Removing an image that fails, also removes the image name/tag. Failing to remove an image, will not remove the image name/tag. Sep 10, 2014
@erikh

erikh commented Sep 10, 2014

Copy link
Copy Markdown
Contributor

LGTM, but I don't know this code very well.

@crosbymichael

Copy link
Copy Markdown
Contributor

I'm getting a test failure

--- FAIL: TestImageRemoveWithContainerFails (0.50 seconds)
        docker_cli_rmi_test.go:13: images before: "REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE\n<none>
   <none>              79f8664169cf        2 seconds ago        2.433 MB\n<none>              <none>              488a6b58928c        43 seconds ago       4.351 MB
\nttytest             latest              e24efe0bff1a        About a minute ago   2.433 MB\n<none>              <none>              18b5ac756b10        2 minutes
ago        2.435 MB\n<none>              <none>              dd53e62bb7ee        2 minutes ago        16 B\nnocontext           latest              e8897c054881
     2 minutes ago        2.433 MB\n<none>              <none>              5b1047c25b07        2 minutes ago        5 B\n<none>              <none>              9
7344479e2f6        2 minutes ago        81 B\n<none>              <none>              945d393c7492        2 minutes ago        88 B\n<none>              <none>
          746ea3b86a3a        2 minutes ago        87 B\n<none>              <none>              e5899268adcf        2 minutes ago        81 B\n<none>
 <none>              fd60b84ffbe8        2 minutes ago        2.433 MB\n<none>              <none>              3bb144b26338        2 minutes ago        0 B\n<none
>              <none>              94e36a7fd364        3 minutes ago        2.433 MB\n<none>              <none>              fd3668ba12e1        3 minutes ago
    5 B\nbusybox             latest              a9eb17255234        3 months ago         2.433 MB\nscratch             latest              511136ea3c5a        15
months ago        0 B\n"
        docker_cli_rmi_test.go:28: Container "c5f7b189b8a196207be95f113e778cd56f69496e2d99601357c4e7fe841347de" is using image, error message should contain "becau
se the running container": Error response from daemon: Conflict, cannot delete a9eb17255234 because the container c5f7b189b8a1 is using it, use -f to force
                2014/09/10 20:45:41 Error: failed to remove one or more images

@jessfraz jessfraz force-pushed the 7845-remove-image-fail-dont-untag branch from ed8de6d to c6cd0c5 Compare September 10, 2014 23:49
@jessfraz

Copy link
Copy Markdown
Contributor Author

updated, the string I was comparing the error to was "running container is using it" which it is not always a running container, so I changed it to fit all use cases

@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

@jessfraz

Copy link
Copy Markdown
Contributor Author

@unclejack @LK4D4 can you guys take a look at this one too :)

Comment thread integration-cli/docker_cli_rmi_test.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is redundant else, because Fatalf stops test immediately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should it just be an if on it's own line? it's making sure that it failed with the right error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yup, should be on it's own line.

@LK4D4

LK4D4 commented Sep 11, 2014

Copy link
Copy Markdown
Contributor

LGTM apart from style things.

@jessfraz jessfraz force-pushed the 7845-remove-image-fail-dont-untag branch from c6cd0c5 to fb83324 Compare September 11, 2014 16:59
Fixes moby#7845 and moby#7801, and a real pain point I had :)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <[email protected]> (github: jfrazelle)
@jessfraz jessfraz force-pushed the 7845-remove-image-fail-dont-untag branch from fb83324 to b2efdc5 Compare September 11, 2014 18:29
@jessfraz

Copy link
Copy Markdown
Contributor Author

updated

@SvenDowideit

Copy link
Copy Markdown
Contributor

on reviewing the man and cli.md, I'm saddened to note that i don't think there is any documentation that covers the existing functionality - so there's probably no docs updates needed :(

@jessfraz

Copy link
Copy Markdown
Contributor Author

@SvenDowideit :(

@jessfraz

Copy link
Copy Markdown
Contributor Author

is this good to merge? @LK4D4 @crosbymichael

@crosbymichael

Copy link
Copy Markdown
Contributor

Yep

crosbymichael added a commit that referenced this pull request Sep 12, 2014
…ntag

Failing to remove an image, will not remove the image name/tag.
@crosbymichael crosbymichael merged commit 32b5d14 into moby:master Sep 12, 2014
@jessfraz jessfraz deleted the 7845-remove-image-fail-dont-untag branch October 10, 2014 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removing an image that's in-use (by a container)

6 participants