Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
While looking into #7390 and digging into the legacy mode check for LocalStack I stumbled upon an issue when using specific latest images, like:
localstack/localstack:s3-latest (a minimal image which basically only contains S3)
localstack/localstack-pro:latest-bigdata (a LocalStack Pro image which contains disk-space heavy packages which would otherwise be downloaded on demand)
If this is the case, the default fallback currently is to jump back to useLegacyMode=true which is not compatible with up-to-date images.
In the long run, I would propose to change the default fallback (as mentioned in https://github.com/testcontainers/testcontainers-java/issues/7390#issuecomment-2163055356), but this PR aims at fixing the issue for these specific tags for now.
Changes
Extends the "latest check" such that multiple variations of the "latest" tags are possible (see above).
Adds a unit test which tests various version strings with the shouldRunInLegacyMode action (and makes the function package private to allow directly testing it).
Motivation
While looking into #7390 and digging into the legacy mode check for LocalStack I stumbled upon an issue when using specific
latest
images, like:localstack/localstack:s3-latest
(a minimal image which basically only contains S3)localstack/localstack-pro:latest-bigdata
(a LocalStack Pro image which contains disk-space heavy packages which would otherwise be downloaded on demand)If this is the case, the default fallback currently is to jump back to
useLegacyMode=true
which is not compatible with up-to-date images. In the long run, I would propose to change the default fallback (as mentioned in https://github.com/testcontainers/testcontainers-java/issues/7390#issuecomment-2163055356), but this PR aims at fixing the issue for these specific tags for now.Changes
shouldRunInLegacyMode
action (and makes the function package private to allow directly testing it).