Fix LocalStack Dev Service failures on non-localhost Docker hosts for amazon-quickstarts #1584
+8
−4
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.
This PR fixes test failures in Quarkus Quickstarts (like amazon-dynamodb-quickstart, amazon-kms-quickstart,...) that use LocalStack Dev Services on Windows.
Failures were discovered in our Jenkins job rhbq-3.27-win22-jdk17-quickstarts-ts-jvm
When tests were running on a Windows machine using Quarkus Dev Services for LocalStack, these failed.
But the failures could occur in environments where the Docker host is configured on a non-localhost IP (e.g., when using Minikube).
The Java tests fail with ResourceNotFoundException, indicating that the init scripts never created the AWS resources (like DynamoDB tables):
The LocalStack container logs show the init scripts are executing, but the awslocal command fails with a connection error.
It is trying to connect to the external Docker Host IP (e.g., 192.168.0.10) from within the container, instead of using the container's internal localhost.
Investigating seems related to a breaking change introduced in quarkus-amazon-services 3.4.0 (PR #1557 quarkiverse/quarkus-amazon-services#1557 )
Now in 3.4.0, the shared network is only configured when explicitly enabled via
quarkus.devservices.launch-on-shared-network=true, but that on Linux environments would fail.Adding the following property to src/test/resources/application.properties:
quarkus.aws.devservices.localstack.container-properties.LOCALSTACK_HOST=127.0.0.1ensures the init scripts run successfully on Windows and on the rest of the environments.