testcontainers/testcontainers-node

localstack: constructor ignores LOCALSTACK_HOST

joebowbeer opened this issue · 1 comments

The fix to allow wait strategy overrides broke hostname resolution. @cristianrgreco

Originally posted by @joebowbeer in #712 (comment)

The call to resolveHostname was moved into the constructor but it should be made after the environment has been assigned. There is no way to provide an environment before the constructor is called so resolveHostname will never resolve LOCALSTACK_HOST

Related preexisting issue: https://github.com/testcontainers/testcontainers-node/pull/640/files#r1752884907

The assignment in resolveHostname of the last network alias to the LOCALSTACK_HOST env var was being made directly, without calling withEnvironment, and was bypassing some code as a result.