fix libhelm error message (#10502)

pull/10445/head
Prabhat Khera 1 year ago committed by GitHub
parent 7c91780eb7
commit 7e4d113fda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,16 +33,15 @@ func ValidateHelmRepositoryURL(repoUrl string, client *http.Client) error {
}
}
const invalidChartRepo = "%s is not a valid chart repository or cannot be reached: %w"
response, err := client.Head(url.String())
if err != nil {
return fmt.Errorf(invalidChartRepo, repoUrl, err)
return fmt.Errorf("%s is not a valid chart repository or cannot be reached: %w", repoUrl, err)
}
// Success is indicated with 2xx status codes. 3xx status codes indicate a redirect.
statusOK := response.StatusCode >= 200 && response.StatusCode < 300
if !statusOK {
return fmt.Errorf(invalidChartRepo, repoUrl, err)
return fmt.Errorf("%s is not a valid chart repository or cannot be reached", repoUrl)
}
return nil

Loading…
Cancel
Save