mirror of https://github.com/portainer/portainer
fix libhelm error message (#10502)
parent
7c91780eb7
commit
7e4d113fda
|
@ -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())
|
response, err := client.Head(url.String())
|
||||||
if err != nil {
|
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.
|
// Success is indicated with 2xx status codes. 3xx status codes indicate a redirect.
|
||||||
statusOK := response.StatusCode >= 200 && response.StatusCode < 300
|
statusOK := response.StatusCode >= 200 && response.StatusCode < 300
|
||||||
if !statusOK {
|
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
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue