New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune named but untagged images if danglingOnly=true #30330

Merged
merged 1 commit into from Jan 25, 2017

Conversation

Projects
None yet
6 participants
@mlaventure
Contributor

mlaventure commented Jan 20, 2017

Signed-off-by: Kenfe-Mickael Laventure mickael.laventure@gmail.com

--
Closes #30307

@cpuguy83

Maybe we can add a quick test (do we already have a pull-by-digest test somewhere?) for this?

Show outdated Hide outdated daemon/prune.go Outdated
Show outdated Hide outdated daemon/prune.go Outdated
Prune named but untagged images if danglingOnly=true
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Jan 23, 2017

Contributor

@cpuguy83 have a look at this version, it's indeed cleaner, thanks.

Contributor

mlaventure commented Jan 23, 2017

@cpuguy83 have a look at this version, it's indeed cleaner, thanks.

continue
shouldDelete := !danglingOnly
if !shouldDelete {
hasTag := false

This comment has been minimized.

@cpuguy83

cpuguy83 Jan 23, 2017

Contributor

This is really an extra variable since you can set shouldDelete in the loop below.

@cpuguy83

cpuguy83 Jan 23, 2017

Contributor

This is really an extra variable since you can set shouldDelete in the loop below.

This comment has been minimized.

@mlaventure

mlaventure Jan 23, 2017

Contributor

shouldDelete needs to stay false in that case. I only want to set it to true if there's no NamedTagged. If I were to set to true here it would delete all images.

@mlaventure

mlaventure Jan 23, 2017

Contributor

shouldDelete needs to stay false in that case. I only want to set it to true if there's no NamedTagged. If I were to set to true here it would delete all images.

This comment has been minimized.

@cpuguy83

cpuguy83 Jan 23, 2017

Contributor

Oh yes, missed that subtlety.

@cpuguy83

cpuguy83 Jan 23, 2017

Contributor

Oh yes, missed that subtlety.

@cpuguy83

LGTM

@LK4D4

This comment has been minimized.

Show comment
Hide comment
@LK4D4

LK4D4 Jan 25, 2017

Contributor

LGTM

Contributor

LK4D4 commented Jan 25, 2017

LGTM

@LK4D4 LK4D4 merged commit a76572b into moby:master Jan 25, 2017

4 checks passed

dco-signed All commits are signed
experimental Jenkins build Docker-PRs-experimental 29897 has succeeded
Details
janky Jenkins build Docker-PRs 38498 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 9528 has succeeded
Details

@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Jan 25, 2017

@mlaventure mlaventure deleted the mlaventure:prune-named-untagged branch Feb 13, 2017

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