-
Notifications
You must be signed in to change notification settings - Fork 7k
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: do not error for remote chart if there's a missing local repo cache #11963
base: main
Are you sure you want to change the base?
Conversation
I'm moving this back to draft to add in some minor changes to increase performance (as suggested by @MichaelMorrisEst in #11961). |
Looking at the comments in |
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.
Change looks good, as does the new test.
Manually testing the change locally shows that it works correctly.
I have also verified that the new test fails on the old code, and passes with this change.
New test
Test failing on old code:
Test passing on new code:
Manually testing locally
Before this change:
After adding a repo (ingress-nginx) then clearing the Helm cache (note the unexpected reference to ingress-nginx-index.yaml
):
$ helm template traefik --repo https://helm.traefik.io/traefik
Error: no cached repo found. (try 'helm repo update'): open /Users/mark/Library/Caches/helm/repository/ingress-nginx-index.yaml: no such file or directory
After this change:
After adding a repo (ingress-nginx) then clearing the Helm cache:
$ helm template traefik --repo https://helm.traefik.io/traefik
---
# Source: traefik/templates/rbac/serviceaccount.yaml
kind: ServiceAccount
apiVersion: v1
metadata:
name: release-name-traefik
... etc
@mikeseese Looks like there's some CI issue, might be worth a merge from main? |
Signed-off-by: Mike Seese <seesemichaelj@gmail.com>
2f4b43e
to
2532fc8
Compare
Thanks @MissedTheMark for the review! I just rebased off of |
What this PR does / why we need it:
This PR closes #11961 by continuing to
scanReposForURL
if one of the local repos doesn't have a cache rather than erroring. This PR also adds the hint tohelm repo update
toErrNoOwnerRepo
to catch cases that are expecting to find it in the local cache (i.e.u := localrepo/cache
).Ultimately, this makes it so that a full HTTP URL for the chart will never fail because in
chart_downloader.go
it will proceed to downloading it ifscanReposForUrl
returnsErrNoOwnerRepo
(line 216):This PR also adds a test that tests for the case where there's a non-empty repository config but an empty repository cache.
Special notes for your reviewer:
I verified this actually fixes #11961 by using the reproduction steps listed there compared with the released/installed version of
helm
and the manually built version located inbin/helm
(after runningmake build
). Here was the final output of that:If applicable: