Skip to content

Fix ECR repository URL replacement for LocalStack 3.4 compatibility#26

Open
MiguelBCosta wants to merge 1 commit intolocalstack:masterfrom
MiguelBCosta:fix/localstack-ecr-endpoint-replacement
Open

Fix ECR repository URL replacement for LocalStack 3.4 compatibility#26
MiguelBCosta wants to merge 1 commit intolocalstack:masterfrom
MiguelBCosta:fix/localstack-ecr-endpoint-replacement

Conversation

@MiguelBCosta
Copy link

As mentioned in PR #20, LocalStack version 3.4 introduced the ECR_ENDPOINT_STRATEGY variable, which changed how ECR endpoints are generated. This update affected the current domain replacement logic, resulting in invalid image repository names when using LocalStack’s ECR.

For example:

  • Correct image name:
    000000000000.dkr.ecr.us-east-1.amazonaws.com/sample5e8ff9bf/samplefunction757ff6efrepo

  • Endpoint returned by LocalStack:
    000000000000.dkr.ecr.us-east-1.localhost.localstack.cloud:4566/sample5e8ff9bf/samplefunction757ff6efrepo

  • Incorrect result after the current replace:
    000000000000.dkr.ecr.us-east-1.000000000000.dkr.ecr.us-east-1.localhost.localstack.cloud:4566/sample5e8ff9bf/samplefunction757ff6efrepo

  • Expected result after replace:
    000000000000.dkr.ecr.us-east-1.localhost.localstack.cloud:4566/sample5e8ff9bf/samplefunction757ff6efrepo

This incorrect replacement causes a "repository not found" error when uploading the image to the local ECR.

This PR updates the domain replacement logic to ensure compatibility with the changes introduced in LocalStack 3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants