From 5f002fbba12ec0c961c486d738e95e8122b3e906 Mon Sep 17 00:00:00 2001 From: fadecore Date: Thu, 28 Apr 2022 09:44:10 +0200 Subject: [PATCH 1/5] add proxy envs to helmclassic --- pkg/client/repo/helmclassic/helmclassic.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/client/repo/helmclassic/helmclassic.go b/pkg/client/repo/helmclassic/helmclassic.go index 2fcc2e9c..e0a428e2 100644 --- a/pkg/client/repo/helmclassic/helmclassic.go +++ b/pkg/client/repo/helmclassic/helmclassic.go @@ -53,6 +53,12 @@ var reloadIndex = func(r *Repo) error { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) res, err := client.Do(req) if err != nil { return errors.Annotate(err, "fetching index.yaml") @@ -185,6 +191,12 @@ func (r *Repo) Fetch(name string, version string) (string, error) { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) res, err := client.Do(req) if err != nil { return "", errors.Annotatef(err, "fetching %s:%s chart", name, version) From 1125a41a5d7f982ac6a8e0f166ac5266b86bc02c Mon Sep 17 00:00:00 2001 From: fadecore Date: Thu, 28 Apr 2022 09:47:55 +0200 Subject: [PATCH 2/5] Update oci.go add proxy envs --- pkg/client/repo/oci/oci.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/client/repo/oci/oci.go b/pkg/client/repo/oci/oci.go index 8c29abe3..0c3413ac 100644 --- a/pkg/client/repo/oci/oci.go +++ b/pkg/client/repo/oci/oci.go @@ -126,6 +126,12 @@ func (r *Repo) getTagManifest(name, version string) (*ocispec.Manifest, error) { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) resp, err := client.Do(req) if err != nil { return nil, errors.Trace(err) @@ -190,6 +196,12 @@ func (r *Repo) ListChartVersions(name string) ([]string, error) { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) resp, err := client.Do(req) if err != nil { return nil, errors.Trace(err) @@ -271,6 +283,12 @@ func (r *Repo) Fetch(name string, version string) (string, error) { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) res, err := client.Do(req) if err != nil { return "", errors.Annotatef(err, "fetching %s:%s chart", name, version) From a35653bb7915cba38bd13b2a4b65e983a41f944e Mon Sep 17 00:00:00 2001 From: fadecore Date: Thu, 28 Apr 2022 09:48:38 +0200 Subject: [PATCH 3/5] Update harbor.go add proxy envs --- pkg/client/repo/harbor/harbor.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/client/repo/harbor/harbor.go b/pkg/client/repo/harbor/harbor.go index 5bbc3b69..e174068d 100644 --- a/pkg/client/repo/harbor/harbor.go +++ b/pkg/client/repo/harbor/harbor.go @@ -118,6 +118,12 @@ func (r *Repo) Upload(file string, _ *chart.Metadata) error { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) res, err := client.Do(req) if err != nil { return errors.Annotatef(err, "uploading %q chart", file) From bcce0c84154120833d9007bb072c309c0e9a67eb Mon Sep 17 00:00:00 2001 From: fadecore Date: Thu, 28 Apr 2022 09:49:11 +0200 Subject: [PATCH 4/5] Update chartmuseum.go add proxy env --- pkg/client/repo/chartmuseum/chartmuseum.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/client/repo/chartmuseum/chartmuseum.go b/pkg/client/repo/chartmuseum/chartmuseum.go index a42de301..d8a234b4 100644 --- a/pkg/client/repo/chartmuseum/chartmuseum.go +++ b/pkg/client/repo/chartmuseum/chartmuseum.go @@ -119,6 +119,12 @@ func (r *Repo) Upload(file string, _ *chart.Metadata) error { } client = &http.Client{Transport: tr} } + r.once.Do(func() { + r.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) res, err := client.Do(req) if err != nil { return errors.Annotatef(err, "uploading %q chart", file) From 8080ce23dff51c60f5d43ab4120e7d1dc630401a Mon Sep 17 00:00:00 2001 From: fadecore Date: Thu, 28 Apr 2022 09:54:54 +0200 Subject: [PATCH 5/5] Update resolver.go add proxy envs --- internal/indexer/resolver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/indexer/resolver.go b/internal/indexer/resolver.go index 5719e9b2..ef2e5266 100644 --- a/internal/indexer/resolver.go +++ b/internal/indexer/resolver.go @@ -18,6 +18,12 @@ func newDockerResolver(u *url.URL, username, password string, insecure bool) rem }, } } + client.once.Do(func() { + client.transport = &http.Transport{ + DisableCompression: true, + Proxy: http.ProxyFromEnvironment, + } + }) opts := docker.ResolverOptions{ Hosts: func(s string) ([]docker.RegistryHost, error) { return []docker.RegistryHost{