mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix libhelm error message (#10502)
This commit is contained in:
parent
7c91780eb7
commit
7e4d113fda
1 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue