Skip to content
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 all images, not just dangling images #25

Merged
merged 1 commit into from
Apr 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func prune(cli *client.Client, deathNote map[string]bool) {
})

try.Do(func(attempt int) (bool, error) {
args.Add("dangling", "false")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

args is shared across all prunes (container/network, etc). This only works because we prune images last. I'm not familiar with Go, but ideally what I'd love is to pass a copy of args with an extra field, smth like:

cli.ImagesPrune(context.Background(),{ ...args, dangling: "false" })

Not sure if its possible/if it matters.

imagesPruneReport, err := cli.ImagesPrune(context.Background(), args)
for _, image := range imagesPruneReport.ImagesDeleted {
deletedImages[image.Deleted] = true
Expand Down