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

feat(manager/helmv3): add support for ECR credentials #24432

Merged
merged 7 commits into from
Sep 23, 2023
Merged

feat(manager/helmv3): add support for ECR credentials #24432

merged 7 commits into from
Sep 23, 2023

Conversation

ezzatron
Copy link
Contributor

@ezzatron ezzatron commented Sep 15, 2023

Changes

This PR allows Renovate to use helm registry login to sign in with an AWS ECR token when updating Helm dependencies.

Context

Addresses the discussion in #19241.

Prior to this change, Helm library chart updates from AWS ECR could be detected by Renovate so long as AWS credentials were configured in hostRules, but when attempting to run helm dependency update, the update would always fail, because Helm itself was not signed in to the registry. This PR re-uses some code from the docker manager for acquiring an ECR token, and uses the token to sign in to the registry.

We have Helm library charts in an AWS ECR registry at my workplace, and I have run this code against one of our repos which was previously failing with an error like:

Command failed: helm dependency update charts
Error: could not download oci://123456789.dkr.ecr.us-east-1.amazonaws.com/some-library: unexpected status from HEAD request to https://123456789.dkr.ecr.us-east-1.amazonaws.com/v2/some-library/manifests/1.0.6: 401 Unauthorized

After these changes, the Renovate PR was successfully created.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

lib/modules/manager/helmv3/artifacts.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/helmv3/artifacts.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/helmv3/artifacts.spec.ts Show resolved Hide resolved
lib/modules/manager/helmv3/artifacts.ts Outdated Show resolved Hide resolved
lib/modules/manager/helmv3/common.ts Outdated Show resolved Hide resolved
lib/modules/manager/helmv3/common.ts Outdated Show resolved Hide resolved
@viceice viceice changed the title feat(manager/helmv3): add support for ECR credentials (#19241) feat(manager/helmv3): add support for ECR credentials Sep 15, 2023
lib/modules/manager/helmv3/artifacts.spec.ts Show resolved Hide resolved
lib/modules/manager/helmv3/artifacts.spec.ts Show resolved Hide resolved
lib/modules/manager/helmv3/common.ts Outdated Show resolved Hide resolved
lib/modules/manager/helmv3/common.ts Outdated Show resolved Hide resolved
@ezzatron ezzatron requested a review from viceice September 15, 2023 08:32
lib/modules/manager/helmfile/utils.ts Show resolved Hide resolved
lib/modules/manager/helmv3/artifacts.ts Outdated Show resolved Hide resolved
lib/modules/manager/helmv3/common.ts Outdated Show resolved Hide resolved
@ezzatron ezzatron requested a review from secustor September 18, 2023 21:56
@rarkins rarkins added this pull request to the merge queue Sep 23, 2023
Merged via the queue into renovatebot:main with commit a975be8 Sep 23, 2023
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 36.104.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ezzatron ezzatron deleted the feat/19241-helm-ecr-credentials branch September 23, 2023 11:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECR OCI Credentials for Docker and Helm repositories
5 participants