-
Notifications
You must be signed in to change notification settings - Fork 456
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
Pull image on container creation #496
Conversation
cmd/crictl/container.go
Outdated
@@ -432,13 +446,19 @@ func CreateContainer(client pb.RuntimeServiceClient, opts createOptions) (string | |||
} | |||
} | |||
|
|||
// Try to pull the image before container creation | |||
image := config.GetImage().GetImage() | |||
if _, err := PullImage(iClient, image, nil); err != 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.
I like the idea, but if local image is used, the pull operation would fail depending on the runtime implementations.
So, I think we'd better add an option here, so that the pull can be skipped in some cases?
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.
Yes, I agree. I added the option to no-pull
as well as the pull authentication related options (this should work too I guess).
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.
thanks
906244c
to
e9a70f4
Compare
Signed-off-by: Sascha Grunert <[email protected]>
e9a70f4
to
7ae8d91
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
But the command is create container not pull image. Oh man.. this is a "potential" performance hit and a "potential" behavior change, by default. Kublet has image pull policies.. did they add --no-pull? quick check.. nope.. but that's is ok because kubelet calls the container runtime directly.. edited to reduce severity |
Hm okay to which "they" are you referring? |
kublet, the maintainers of kublet... |
sry just trying to figure out what this means... |
Okay, the main intention of such PRs, like this one or the one added Sometimes avoiding breaking changes is not that easily achievable in conjunction with semver because we're just following k8s versions. :-/ |
perhaps a new config flag to use the old default.. eg by setting the default to no pull.. |
crictl run.. yeah makes sense there as trying to mimic docker run.. but most of the time I think kubelet is trying to follow pull policy in this regard. Some users want to run disconnected for example, others don't want to update their images regardless of if connected. |
Yeah I see the point. We probably should turn it off by default. 👍 |
suggest adding the new default config flag... and pushing that backwards via service. Sorry didn't see this when it was pushed. So busy so many projects :-) Thx @saschagrunert |
crictl isn't being used by kublet for create so this isn't as important as I thought it might be |
I'm not sure if there were already some discussions if we want this or not, so I'd like to propose this one: We now try to pull the image from the container manifest before actually creating the container. This makes the overall usability a bit nicer.