argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

fix(reposerver): fix OCI repository matching (#12436)

Open MioOgbeni opened this issue 10 months ago • 1 comments

When an OCI repository is used as a Helm Chart dependency, there must not be an exact match for the dependency URL and the repo URL. This PR fixes usage for OCI registry located deeper in the registry structure.

I also created a unit test for this case

Fixes #12436

This issue is also in older version v2.10.7, it would be great if the PR was cherry-picked into the v2.10.x patch.

Checklist:

  • [x] Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • [x] The title of the PR states what changed and the related issues number (used for the release note).
  • [x] The title of the PR conforms to the Toolchain Guide
  • [x] I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • [ ] I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • [ ] Does this PR require documentation updates?
  • [ ] I've updated documentation as required by this PR.
  • [x] I have signed off all my commits as required by DCO
  • [x] I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • [x] My build is green (troubleshooting builds).
  • [ ] My new feature complies with the feature status guidelines.
  • [x] I have added a brief description of why this PR is necessary and/or what this PR solves.
  • [x] Optional. My organization is added to USERS.md.
  • [x] Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

MioOgbeni avatar Apr 24 '24 12:04 MioOgbeni

Any progress on this? The code change looks simple enough, and without this OCI Helm charts that require credentials are not really usable.

LordGaav avatar May 13 '24 09:05 LordGaav

Still without review :/ It's really simple fix, can someone look at this?

MioOgbeni avatar May 17 '24 11:05 MioOgbeni

Hello, I am using ArgoCD version v2.12.0+ec30a48. The deployment goes through, but ArgoCD still shows an error:

ComparisonError: Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = Manifest generation error (cached): helm dependency build failed exit status 1: Error: could not download oci://ghcr.io/example/app-values/base: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Aexample%2Fapp-values%2Fbase%3Apull&service=ghcr.io: 403 Forbidden

DjinNO avatar Aug 09 '24 06:08 DjinNO

i'm getting same issue in version v2.11.7 and v2.12.0

Hello, I am using ArgoCD version v2.12.0+ec30a48. The deployment goes through, but ArgoCD still shows an error:

ComparisonError: Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = Manifest generation error (cached): helm dependency build failed exit status 1: Error: could not download oci://ghcr.io/example/app-values/base: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Aexample%2Fapp-values%2Fbase%3Apull&service=ghcr.io: 403 Forbidden

PhamQuang-512 avatar Aug 15 '24 16:08 PhamQuang-512