From 7e4d113fdadf7c0ae3761fb5addae29abb689964 Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:20:49 +1300 Subject: [PATCH] fix libhelm error message (#10502) --- pkg/libhelm/validate_repo.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/libhelm/validate_repo.go b/pkg/libhelm/validate_repo.go index 984329bc4..6823f72eb 100644 --- a/pkg/libhelm/validate_repo.go +++ b/pkg/libhelm/validate_repo.go @@ -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