-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Add json support for index.yaml file #10542 #12151
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
Conversation
|
@smmhatami please fix the DCO issue. maybe it's a breaking change? |
Signed-off-by: Seyed Mohammad Mahdi Hatami <hatamik7@gmail.com>
Signed-off-by: Seyed Mohammad Mahdi Hatami <hatamik7@gmail.com>
|
Changes LGTM |
| } | ||
|
|
||
| resp, err := r.Client.Get(indexURL, | ||
| resp, err := r.Client.Get(jsonIndexURL, |
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.
If the file does not exist (HTTP 404), this would return an error and it would not fallback to loading the index.yaml. See also
Lines 91 to 93 in 4e447d8
| if resp.StatusCode != http.StatusOK { | |
| return nil, errors.Errorf("failed to fetch %s : %s", href, resp.Status) | |
| } |
In addition, on a successful retrieval any parsing error would be swallowed by an attempt to fetch and load the index.yaml (which may not exist). Yielding absolutely no information to the user to figure out what went wrong.
Given this, I think it would be better to not perform a fallback based on loading errors. But to rather fall back based on the error from r.Client.Get, which may require introducing a typed error in httpgetter.go to distinguish a HTTP 404 from transient errors.
|
In addition, this lacks any configuration options to generate an
|
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com> Signed-off-by: Seyed Mohammad Mahdi Hatami <62210297+smmhatami@users.noreply.github.com>
|
@smmhatami do you think you would be able to continue with this attempt based on my comments? Otherwise I would be happy to take it over, as I think it would be beneficial to Helm given the growing number of (bigger) indexes. |
|
Given the other PR has been merged, this can be closed. |
This is a fix to solve Issue 10542. Resolves #10542. With these changes one can use json formatted index file instead of yaml. the code now looks for index.json file as default and switches to index.yaml if not found.