Image pull policy (#1345) - #2024
Merged
Merged
Conversation
* get exitcode from inspectExecCmd * Update core/src/main/java/org/testcontainers/containers/Container.java Co-Authored-By: dmarkhas <minimizer@gmail.com> * Update core/src/main/java/org/testcontainers/containers/Container.java Co-Authored-By: dmarkhas <minimizer@gmail.com> * Update core/src/main/java/org/testcontainers/containers/Container.java Co-Authored-By: dmarkhas <minimizer@gmail.com> * Use Lombok's `@Value` in `ExecResult` * Update Container.java * Add image pull policy * dont expose docker-java Image directly * fixed pullingNonExistentImageFailsGracefully test * fixed failing tests * use OffsetDateTime instead of System.currentMillis * use java.time.Instant * make Wait and PullPolicy non-instantiable * code review changes * fixed failing tests * use hamcreset anyOf * fix ImagePullPolicyTest * make ImageData an interface * revert ContainerCreationTest.java * use java.time.Instant * revert an unrelated change in ContainerLogsTest * use java.time.Instant * use redis instead of alpine in example * use OptionalLong instead of Long in ImageData * resolve conflict with master * resolve conflict with master * resolve conflict with master * resolve conflict with master
bsideup
marked this pull request as ready for review
November 3, 2019 15:33
Member
Author
|
Hey @dmarkhas, Could you please take a look and tell us if this implementation will cover your use cases? Thanks! |
Contributor
rnorth
reviewed
Nov 9, 2019
| Logger logger = DockerLoggerFactory.getLogger(imageName.toString()); | ||
|
|
||
| // Does our cache already know the image? | ||
| ImageData imageData = LOCAL_IMAGES_CACHE.get(imageName); |
Member
There was a problem hiding this comment.
I'm half tempted to suggest having an additional boolean that can be used in line 27, e.g. something like:
if (isCached && !shouldPullCached(...
Alternatively, perhaps renaming this to cachedImageData would be equivalently clear.
rnorth
reviewed
Nov 9, 2019
| return false; | ||
| } | ||
|
|
||
| log.trace("Should pull image: {}", imageName); |
Member
There was a problem hiding this comment.
I have the feeling that we should always log, maybe at debug level, about the pull decision (including if we've decided not to pull!)
|
Also covers case described in #2048 |
rnorth
approved these changes
Nov 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1345 by @dmarkhas
Fixes #1324