-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
PostgreSQLContainer does not honor withCommand #937
Comments
Hi @kellen, However I don't think removing the What about doing |
Ok, I was following the model set by #767. The three cases I can see are:
If the user wants the default container command is the intention that they do not ever call
Do you mean the |
Oh you are right, for some containers it's the solution since the underlying image already has the correct command, and I think your PR in #938 is fine, thanks for this. Your 3 use case also seem to fit. But also we can merge 1 and 3, since 3 is powerful enough to allow 1.
In this case I meant the Testcontainers default. |
Ok, great. For the other container types, since |
Since using the setters should happen before the actual container creation, we can normally assume, that |
Ok, so the other usages of |
The postgres container does not honor
withCommand
because it is overridden inconfigure()
:This seems like it would also be a problem for several other containers using
setCommand
inconfigure
, includingNginxContainer
,BrowserWebDriverContainer
, andVncRecordingContainer
.In the case of
PostgreSQLContainer
, the command can just be removed, but in these other cases I'm not sure what the best behavior would be; possibly moving the defaultsetCommand
to the constructor or calling it whenever the container's internal configuration changes (e.g. when setting thevncPassword
).The text was updated successfully, but these errors were encountered: