-
Notifications
You must be signed in to change notification settings - Fork 40k
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 image related functions to use docker engine-api #23800
Conversation
GCE e2e build/test passed for commit 6091a1a6f88a66bf5e12e3909c456791fbeeaf49. |
GCE e2e build/test passed for commit 3f2000a3e3ccb7f7397e73bd93f09a48ee9822b4. |
@resouer Thanks a lot! Really appreciate your help~ Will review today. :) |
) | ||
|
||
// APIImage is the container information returned by ContainerList | ||
type APIImage dockertypes.Image |
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.
I decided not to define our own types to make the interface cleaner. (See #23699)
Maybe just use dockertypes.Image
instead. :)
Some type naming nits, aside from that LGTM. My plan is to finish most work this week. If you have time, you could work on InspectImage and RemoveImage as well. I'll work on other functions first, and come back to these two functions if you don't have time to do that. :) |
@Random-Liu I am doing image related functions and will update here |
@resouer Could you leave the |
@Random-Liu Sure, I will remove that commit. |
GCE e2e build/test passed for commit e37da602b7083582e6dda628d409dff65bb93054. |
@resouer |
GCE e2e build/test passed for commit 22e8b5f3cf22da07020c0fa694940722493266f5. |
opts := docker.PullImageOptions{ | ||
Repository: repoToPull, | ||
Tag: tag, | ||
// opts := docker.PullImageOptions{ |
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.
Remove the commented code.
GCE e2e build/test passed for commit 6faff2221f90929f229a5c6b0ea0fa2155cf7107. |
RegistryAuth: base64Auth, | ||
}, nil) | ||
opts.RegistryAuth = base64Auth | ||
resp, err := d.client.ImagePull(getDefaultContext(), opts, nil) |
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.
Something wrong when rebasing, see https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockertools/kube_docker_client.go#L204-L218 and #24101.
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.
@resouer Could you please fix this? After this we could get this PR merged as soon as possible. :)
RemoveImage(image string) error | ||
InspectImage(image string) (*dockertypes.ImageInspect, error) | ||
ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.Image, error) | ||
PullImage(image string, auth dockertypes.AuthConfig, opts dockertypes.ImagePullOptions) error |
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.
Same question as by others below.
Why are we adding an image
argument when the opts
contain the image information.
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.
@MHBauer We do this, because:
- Engine-api has moved image out of
ImagePullOptions
Make required arguments required. docker/engine-api#162, it will be easier to bump up the engine-api version later. - This is more intuitive Make required arguments required - optional arguments should be optional docker/engine-api#137. :)
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.
okay.
GCE e2e build/test passed for commit a393947. |
@resouer Thanks a lot! LGTM. |
GCE e2e build/test passed for commit a393947. |
GCE e2e build/test failed for commit a393947. Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake. |
GCE e2e build/test passed for commit a393947. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit a393947. |
Automatic merge from submit-queue |
UPSTREAM: 82697: Fix TestBlockMapperMapDeviceNotSupportAttach informer sync race Origin-commit: 4dd18181ce98cd4d866bb7acdfe3c49961119384
ref #23563
cc @Random-Liu will add more work after initial review.