-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CHE-4197: Apply CHE_DOCKER_ALWAYS__PULL__IMAGE to container creation #5112
Conversation
Signed-off-by: Mykola Morhun <mmorhun@codenvy.com>
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/2615/ |
@@ -518,7 +520,9 @@ protected void pullImage(CheServiceImpl service, | |||
|
|||
try { | |||
boolean isSnapshot = SNAPSHOT_LOCATION_PATTERN.matcher(dockerMachineSource.getLocation()).matches(); | |||
if (!isSnapshot || snapshotUseRegistry) { | |||
boolean isImageExistLocally = isDockerImageExistLocally(dockerMachineSource.getRepository()); | |||
if (!isSnapshot && (doForcePullImage || !isImageExistLocally) || |
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.
In my opinion, this code would be more clear if operands wouldn't rely on remembering operations priority. E.g. next equivalent code looks clearer for me:
(!isSnapshot && (doForcePullImage || !isImageExistLocally) || isSnapshot && snapshotUseRegistry)
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 divided this with new line, but I do not mind about brackets. Let be so.
Signed-off-by: Mykola Morhun <mmorhun@codenvy.com>
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.
updated release notes and changelog.
Build # 2619 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2619/ to view the results. |
What does this PR do?
Takes into account
CHE_DOCKER_ALWAYS__PULL__IMAGE
value when creating docker container for a workspace machine. This means, that if the property is set tofalse
then Che won't try to pull image for a container if it exists locally.What issues does this PR fix or reference?
#4197
Changelog
Respect the value of CHE_DOCKER_ALWAYS__PULL__IMAGE when creating containers.
Release Notes
We've improved the behavior of Che when it's run in a secure environment disconnected from the internet. In the
che.env
there is a propertyCHE_DOCKER_ALWAYS_PULL_IMAGE
that when sent tofalse
will ensure that Che only checks the local (private) registry for the Docker image. The default value istrue
and in this case Che will always check DockerHub for a newer image version before creating the container.