From 3d81ea22ac74e667b98a26eb80a5d427d75f7009 Mon Sep 17 00:00:00 2001 From: Jakub Warczarek Date: Wed, 21 Dec 2022 19:47:13 +0100 Subject: [PATCH] Fix after CR Signed-off-by: Jakub Warczarek --- pkg/cli/environment.go | 8 +++----- pkg/downloader/chart_downloader.go | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index c4a738824..dac2a4bc1 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -/*Package cli describes the operating environment for the Helm CLI. +/* +Package cli describes the operating environment for the Helm CLI. Helm's environment encapsulates all of the service dependencies Helm has. These dependencies are expressed as interfaces so that alternate implementations @@ -121,6 +122,7 @@ func New() *EnvSettings { config.Wrap(func(rt http.RoundTripper) http.RoundTripper { return &retryingRoundTripper{wrapped: rt} }) + config.UserAgent = version.GetUserAgent() return config }, } @@ -231,9 +233,5 @@ func (s *EnvSettings) SetNamespace(namespace string) { // RESTClientGetter gets the kubeconfig from EnvSettings func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter { - s.config.WrapConfigFn = func(c *rest.Config) *rest.Config { - c.UserAgent = version.GetUserAgent() - return c - } return s.config } diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index a95894e00..29a9d64c2 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -184,11 +184,11 @@ func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL, // // A version is a SemVer string (1.2.3-beta.1+f334a6789). // -// - For fully qualified URLs, the version will be ignored (since URLs aren't versioned) -// - For a chart reference -// - If version is non-empty, this will return the URL for that version -// - If version is empty, this will return the URL for the latest version -// - If no version can be found, an error is returned +// - For fully qualified URLs, the version will be ignored (since URLs aren't versioned) +// - For a chart reference +// * If version is non-empty, this will return the URL for that version +// * If version is empty, this will return the URL for the latest version +// * If no version can be found, an error is returned func (c *ChartDownloader) ResolveChartVersion(ref, version string) (*url.URL, error) { u, err := url.Parse(ref) if err != nil {