Add utility class to allow image names to be configured …#277
Conversation
7bbff66 to
17e9eb6
Compare
| public String vncRecordedContainerImage = "richnorth/vnc-recorder:latest"; | ||
|
|
||
| // No public constructor - must use getInstance() method. | ||
| private TestcontainersConfiguration() { |
There was a problem hiding this comment.
can be replaced with NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
|
|
||
| public AmbassadorContainer(LinkableContainer otherContainer, String serviceName, int servicePort) { | ||
| super("richnorth/ambassador:latest"); | ||
| super(TestcontainersConfiguration.getInstance().ambassadorContainerImage); |
There was a problem hiding this comment.
I think it's more conventional to use getters
There was a problem hiding this comment.
You're right - I even put the @Data annotation on for that reason! Whoops.
17e9eb6 to
015a32c
Compare
|
Squashed and pushed updates. |
| try (final InputStream inputStream = configOverrides.openStream()) { | ||
| properties.load(inputStream); | ||
|
|
||
| config.ambassadorContainerImage = properties.getProperty("ambassador.container.image", config.ambassadorContainerImage); |
There was a problem hiding this comment.
I just realized that if file if present, it will override both properties. What if user will override ambassador.container.image, but not vncrecorder? We probably should add a check for it
There was a problem hiding this comment.
I think it should be OK - this is why I provided the current value (default) as the 2nd, default, parameter to properties.getProperty(...). The intention is that if the user only provides one property, the other stays the same.
015a32c to
40ddc29
Compare
... via a classpath file
Replace static string names for ambassador and vnc recorder container images with classpath lookup.
Add note to readme re overriding hardcoded image names
Refs #259, #276