Skip to content
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): update private ecr repo url regex #31394

Merged
merged 7 commits into from
Sep 14, 2024

Conversation

natekruse-aws
Copy link
Contributor

@natekruse-aws natekruse-aws commented Sep 10, 2024

Issue # (if applicable)

Reason for this change

The regex for private ECR repos currently excludes some supported URLs in AWS regions. Updating the regex to be more inclusive of all AWS regions.

Description of changes

Modified private ECR repo URL to be domain agnostic.

Description of how you validated changes

All existing tests pass:

  • npx cdk -a test/aws-eks/test/integ.eks-helm-asset.js deploy --all
  • yarn test aws-eks
  • yarn integ --directory test/aws-eks/test

Manually updated lambda function highside to verify change works in isolated regions as well.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Sep 10, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team September 10, 2024 22:25
@github-actions github-actions bot added the p2 label Sep 10, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@natekruse-aws
Copy link
Contributor Author

Exemption Request

Integ test changes not required due to how small the change is. Existing tests still work.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Sep 10, 2024
@natekruse-aws natekruse-aws marked this pull request as ready for review September 10, 2024 22:37
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 10, 2024
@shikha372 shikha372 self-assigned this Sep 12, 2024
@shikha372
Copy link
Contributor

shikha372 commented Sep 12, 2024

No change flagged in integration test due to modification in private repo URL only, but there are manual integration steps defined to check for private repo here.
Also, asked user to add unit tests to verify that this is working for all expected domains.

@shikha372
Copy link
Contributor

verified that there is no change in integration snapshot with yarn integ under aws-cdk/packages/@aws-cdk-testing/framework-integ/test.

Manually verified the changes for private repo with deployment in us-east-1

// there is no opinionated way of testing charts from private ECR, so there is description of manual steps needed to reproduce:
    // 1. `export AWS_PROFILE=youraccountprofile; aws ecr create-repository --repository-name helm-charts-test/s3-chart --region YOUR_REGION`
    // 2. `helm pull oci://public.ecr.aws/aws-controllers-k8s/s3-chart --version v0.1.0`
    // 3. Login to ECR (howto: https://docs.aws.amazon.com/AmazonECR/latest/userguide/push-oci-artifact.html )
    // 4. `helm push s3-chart-v0.1.0.tgz oci://YOUR_ACCOUNT_ID.dkr.ecr.YOUR_REGION.amazonaws.com/helm-charts-test/`
    // 5. Change `repository` in above test to oci://YOUR_ACCOUNT_ID.dkr.ecr.YOUR_REGION.amazonaws.com/helm-charts-test
    // 6. Run integration tests as usual

Results:

Verifying integration test snapshots...

  CHANGED    aws-eks/test/integ.eks-helm-asset 1.447s
      Resources
[~] Custom::AWSCDK-EKS-HelmChart Clustercharttestocichart9C188967 
 └─ [~] Repository
     ├─ [-] oci://public.ecr.aws/aws-controllers-k8s/s3-chart
     └─ [+] oci://<account>.dkr.ecr.us-east-1.amazonaws.com/helm-charts-test/s3-chart


Running in parallel across regions: us-east-1, us-east-2, us-west-2
Running test /Users/shikagg/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js in us-east-1
  SUCCESS    aws-eks/test/integ.eks-helm-asset-aws-cdk-eks-helm/DefaultTest 1390.33s
       NO ASSERTIONS

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 13, 2024
@shikha372
Copy link
Contributor

@Mergifyio update

Copy link
Contributor

mergify bot commented Sep 13, 2024

update

✅ Branch has been successfully updated

@shikha372 shikha372 added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Sep 13, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 13, 2024 23:44

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Contributor

mergify bot commented Sep 13, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 7336880
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 386fca3 into aws:main Sep 14, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Sep 14, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2024
@natekruse-aws natekruse-aws deleted the fix-ecr-repo-regex branch September 14, 2024 14:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants