fix: correctly parse ECR URIs and tags to OSMLContainer #163
+290
−104
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.
Issue #, if available: n/a
Notes
Fix: Correctly Support ECR Repository ARN and CONTAINER_URI tags as OSMLContainer configuration options.
This PR enhances the
buildFromRepository()
method by adding support for importing ECR repositories via ARN (REPOSITORY_ARN
) and improving the extraction and handling of container image URIs. Previously, the code:CONTAINER_URI
."latest"
even when a tag was present in theCONTAINER_URI
.Changes
REPOSITORY_ARN
, allowing users to provide an ECR repository ARN instead of a full image URI.CONTAINER_URI
orREPOSITORY_ARN
is provided, preventing misconfigurations.CONTAINER_URI
(e.g.,repo-name:tag
).buildFromRepository()
into multiple helper methods for better readability and maintainability.OSMLContainer
construct including new options.Example Fixes
REPOSITORY_ARN
was not accepted)REPOSITORY_ARN
123456789012.dkr.ecr.us-east-1.amazonaws.com/my-repo:1.2.3
was incorrectly assumed to be Docker Hub (docker.io/library/...
)CONTAINER_URI
, it was ignored and"latest"
was always usedImpact
REPOSITORY_ARN
.:latest
when an explicit tag is provided.This update ensures that users can seamlessly use either an ECR repository ARN or a container image URI, improving flexibility and correctness. 🚀
Checklist
Before you submit a pull request, please make sure you have the following:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.