Improve error message for invalid Helm chart repository URLs#2063
Open
ogulcanaydogan wants to merge 1 commit into
Open
Improve error message for invalid Helm chart repository URLs#2063ogulcanaydogan wants to merge 1 commit into
ogulcanaydogan wants to merge 1 commit into
Conversation
Wrap the errors from CacheIndex() and LoadFromPath() in reconcileSource with a helm-CLI-style message that includes the configured repository URL. When the index cannot be fetched or fails to parse (e.g. server returns HTML instead of YAML), the user now sees: looks like "https://example.com" is not a valid chart repository or cannot be reached: <underlying error> instead of the cryptic YAML parse error or generic fetch failure. Fixes fluxcd#654 Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
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.
What's changed
Wrap the two error paths in the HelmRepository reconciler with a helm-CLI-style message that includes the repository URL:
CacheIndex failure (e.g. 404 from upstream): the underlying HTTPGetter error already carries the URL and status, but the operator event only showed
failed to fetch Helm repository index. Users had to correlate the URL from the HelmRepository spec manually.LoadFromPath failure (e.g. server returns HTML at 200): IndexFromBytes fails to unmarshal the index YAML, but the error only said
failed to load Helm repository from index YAMLwith no URL context.Both cases now surface:
The format mirrors what
helm repo addemits and what was requested in #654.How to test
Ready=Falsecondition message will include the repository URL.Related
Closes #654
Precedent: #2013 / commit 790be38 (improved SSH key error message, same pattern).