-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Implement WithImagePullPolicy #606
Conversation
…o 'Missing' and add WithImagePullPolicy builder method
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 for your contribution. PR looks good. I have just one question below.
I am not sure how I should proceed with tests – ideally I would want to for example test if
PullPolicy.Never
is working
You can try to pull an image we do not use, like alpine:edge
. StartAsync
will thrown an exception that it could not find the image.
Thanks for the suggestion, yes using an image we don't use would make sense for |
Lets skip that for now. If |
tests/Testcontainers.Tests/Unit/Containers/Unix/TestcontainersContainerTest.cs
Outdated
Show resolved
Hide resolved
tests/Testcontainers.Tests/Unit/Containers/Unix/TestcontainersContainerTest.cs
Outdated
Show resolved
Hide resolved
tests/Testcontainers.Tests/Unit/Containers/Unix/TestcontainersContainerTest.cs
Outdated
Show resolved
Hide resolved
Sorry, I only had access to my corporate PC where I can't pull public GitHub repos, so I ended up winging it in the online vscode editor 😅 Finally got the chance to fix it, should be okay now. Excuse my commit history, it's a bit all over the place. |
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.
Excuse my commit history, it's a bit all over the place.
No worries, we squash it anyway. Thanks again for your contribution.
Trying to implement
WithImagePullPolicy
mentioned in #601. I tried to keep similar functionality to the Java counterpart where you can write a custom policy depending on the information about the cached image (e. g. policy that pulls the image if the currently cached image'sCreated
property is 3 days old). Of course there's still the presetsPullPolicy.Never
,PullPolicy.Missing
(default) andPullPolicy.Always
like withdocker run
argument--pull
.I am not sure how I should proceed with tests – ideally I would want to for example test if
PullPolicy.Never
is working, so I would need to somehow delete the image if it's cached/pulled, but I am not sure how to do that, since I can't access the Docker.DotNet client underneath. Any suggestions appreciated.How is this looking @HofmeisterAn ?