Repository navigation
fix(deploy): kates deploy no longer deletes ~/.cache/helm - #391
Merged
Merged
Conversation
To refresh the API server's schema cache after installing CRDs, deploy deleted ~/.kube/cache/discovery and ~/.cache/helm. The second is no discovery cache: on Linux it is Helm's repository cache. The kyverno/kyverno upgrade that wires Kyverno into Prometheus later in the same deploy runs with no repo add before it, so it could fail with "no cached repo found", and every deploy emptied the user's own `helm search repo`. macOS keeps Helm's cache in ~/Library/Caches/helm, which is why it went unnoticed there. Deploy now deletes only ~/.kube/cache/discovery, and a comment says why ~/.cache/helm stays.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 1.4 of the CLI performance and stability plan (finding F12). Independent of the other Wave 1 PRs.
Why
At the end of Group A,
kates deployrefreshes the API server's schema cache by deleting~/.kube/cache/discoveryand~/.cache/helm(cli/cmd/deploy_components.go:1013-1018on main, 6f4cf61). The second is no discovery cache. On Linux it is Helm's repository cache ($XDG_CACHE_HOME/helm), where each repo's index lives.kyvernorepo and installs Kyverno, and then the cache goes.wireKyvernoScrapelater runshelm upgrade kyverno kyverno/kyverno(cli/cmd/deploy_monitoring.go:96) with norepo addorrepo updatebefore it. Without its index, Helm fails with "no cached repo found".helm search repo.~/Library/Caches/helm, which is why it goes unnoticed there.The status is PLAUSIBLE, with high confidence: it is Helm's documented cache layout, but it was not run on Linux.
Changes
cli/cmd/deploy_components.go: theos.RemoveAllof~/.cache/helmis gone.~/.kube/cache/discovery, the cache that was meant, is still deleted, and a comment says why the Helm cache stays.Tests
None added, as the plan says for this item: the line is deleted, and nothing read it.
Run locally, passing:
cd cli && go test ./...,go test -race ./cmd,go vet ./....golangci-lint run --new-from-rev=origin/main ./...: 0 issues.scripts/check-cli-style.shandscripts/check-cli-compat.sh: OK.cli/**triggers (Build & Test): this PR touches nothing underkates/../mvnw teston main'skates/tree ran 1,254 tests with 0 failures and 0 errors, once for all of Wave 1.Skipped locally:
govulncheck, asgo.modis unchanged.CI only:
./mvnw verifywith the*ITtests, the Kind and Docker jobs, CodeQL and Trivy.