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

CHE-4197: Apply CHE_DOCKER_ALWAYS__PULL__IMAGE to container creation #5112

Merged
merged 3 commits into from
May 18, 2017

Conversation

mmorhun
Copy link
Contributor

@mmorhun mmorhun commented May 17, 2017

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 to false 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 property CHE_DOCKER_ALWAYS_PULL_IMAGEthat when sent to false will ensure that Che only checks the local (private) registry for the Docker image. The default value is true and in this case Che will always check DockerHub for a newer image version before creating the container.

@codenvy-ci
Copy link

@@ -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) ||

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)

Copy link
Contributor Author

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>
@bmicklea bmicklea added the kind/enhancement A feature request - must adhere to the feature request template. label May 17, 2017
Copy link

@bmicklea bmicklea left a 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.

@codenvy-ci
Copy link

Build # 2619 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2619/ to view the results.

@mmorhun mmorhun merged commit 064fdcb into master May 18, 2017
@mmorhun mmorhun deleted the CHE-4197 branch May 18, 2017 10:05
@vkuznyetsov vkuznyetsov added this to the 5.11.0 milestone May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants