-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eks): fix helm deploy for public-ecr repositories #23176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -109,8 +109,8 @@ def get_oci_cmd(repository, version): | |||||||||||||||||||||||
f"helm registry login --username AWS --password-stdin {registry}; helm pull {repository} --version {version} --untar" | ||||||||||||||||||||||||
] | ||||||||||||||||||||||||
elif registry.startswith(public_ecr): | ||||||||||||||||||||||||
logger.info("Found AWS public repository, will use default region as deployment") | ||||||||||||||||||||||||
region = os.environ.get('AWS_REGION', 'us-east-1') | ||||||||||||||||||||||||
logger.info("Found AWS public repository, will use region 'us-east-1' as deployment") | ||||||||||||||||||||||||
region = 'us-east-1' | ||||||||||||||||||||||||
Comment on lines
-112
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's two valid regions, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the Amazon ECR public registries documentation the region should always be https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth so I think we should always make it aws-cdk/packages/@aws-cdk/aws-eks/lib/kubectl-handler/helm/__init__.py Lines 111 to 121 in c0b1019
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
cmnd = [ | ||||||||||||||||||||||||
f"aws ecr-public get-login-password --region {region} | " \ | ||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a change to the unit tests for this; could you add a unit test for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through the previous commits for this lambda handler but didn't see any unit tests (unless I missed those) for these functions, so not sure what to add exactly here. What kind of unit test are you looking for?
Note that the integration test https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-eks/test/integ.eks-helm-asset.ts#L54 should already cover the behaviour change here as well, which I think makes more sense than a unit test in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, this is a custom resource lambda. We have no unit tests for these, so disregard this.