-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
refactor: remove docker image list reference filter #1501
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1501 +/- ##
==========================================
+ Coverage 61.22% 61.44% +0.21%
==========================================
Files 46 46
Lines 7141 7148 +7
==========================================
+ Hits 4372 4392 +20
+ Misses 2462 2450 -12
+ Partials 307 306 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
||
imageListOptions := types.ImageListOptions{ | ||
Filters: filters, | ||
inspectImage, _, err := cli.ImageInspectWithRaw(ctx, imageName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One docker inpect call is enough, no container list needed with non portable filters
Docker beta only, they may contribute the filter to containerd
return false, err | ||
} | ||
|
||
cli, err := GetDockerClient(ctx) | ||
if err != nil { | ||
return false, err | ||
} | ||
defer cli.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I forget this leak or is it new? Should be closed.
Seems like it got lost, my fork has a close instruction and, I have made the last change in this file.
It is better to keep two return values
We have a CI issue, not shure if it is permanent
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@ChristopherHX this pull request has failed checks 🛠 |
Should I preserve the public ImageExistsLocally signature and make a private helper function?, reverted the new return value.This uses docker inspect and remove docker list.
You cannot have multiple images of the same name+tag, regardless of platform metadata
Fixes #1390