From 6e9f5f8fafc58888dbc524c57d60b38728e7d2be Mon Sep 17 00:00:00 2001 From: ayushmaheshwari Date: Fri, 13 Dec 2024 17:18:12 +0530 Subject: [PATCH 1/5] fixing chart download issue for chart repo --- chart-sync/pkg/RepoManager.go | 7 +----- chart-sync/util/HttpUtil.go | 40 +++-------------------------------- 2 files changed, 4 insertions(+), 43 deletions(-) diff --git a/chart-sync/pkg/RepoManager.go b/chart-sync/pkg/RepoManager.go index ca90d0d72..e575fad46 100644 --- a/chart-sync/pkg/RepoManager.go +++ b/chart-sync/pkg/RepoManager.go @@ -79,12 +79,7 @@ func (impl *HelmRepoManagerImpl) ValuesJson(repoUrl string, version *repo.ChartV } var byteBuffer *bytes.Buffer - if len(username) > 0 && len(password) > 0 { - byteBuffer, err = util.GetFromPrivateUrlWithRetry(repoUrl, absoluteChartURL, username, password, allowInsecureConnection) - } else { - byteBuffer, err = util.GetFromPublicUrlWithRetry(absoluteChartURL) - } - + byteBuffer, err = util.GetFromUrlWithRetry(repoUrl, absoluteChartURL, username, password, allowInsecureConnection) if err != nil { fmt.Println("err", err) return "", "", "", "", err diff --git a/chart-sync/util/HttpUtil.go b/chart-sync/util/HttpUtil.go index bc581ee03..a5c9e6cc3 100644 --- a/chart-sync/util/HttpUtil.go +++ b/chart-sync/util/HttpUtil.go @@ -19,60 +19,26 @@ package util import ( "bytes" - "fmt" "github.com/devtron-labs/chart-sync/internals/sql" "github.com/pkg/errors" "helm.sh/helm/v3/pkg/cli" "helm.sh/helm/v3/pkg/getter" - "io/ioutil" - "net/http" "net/url" - "strconv" "time" ) -func GetFromPublicUrlWithRetry(url string) (*bytes.Buffer, error) { - var ( - err error - response *http.Response - retries = 3 - ) - - for retries > 0 { - response, err = http.Get(url) - if err != nil { - retries -= 1 - time.Sleep(1 * time.Second) - } else { - break - } - } - if response != nil { - defer response.Body.Close() - statusCode := response.StatusCode - if statusCode != http.StatusOK { - return nil, errors.New(fmt.Sprintf("Error in getting content from url - %s. Status code : %s", url, strconv.Itoa(statusCode))) - } - body, err := ioutil.ReadAll(response.Body) - if err != nil { - return nil, err - } - return bytes.NewBuffer(body), nil - } - return nil, err -} - -func GetFromPrivateUrlWithRetry(baseurl string, absoluteUrl string, username string, password string, allowInsecureConnection bool) (*bytes.Buffer, error) { +func GetFromUrlWithRetry(baseurl string, absoluteUrl string, username string, password string, allowInsecureConnection bool) (*bytes.Buffer, error) { var ( err, errInGetUrl error response *bytes.Buffer retries = 3 ) getters := getter.All(&cli.EnvSettings{}) - u, err := url.Parse(baseurl) + u, err := url.Parse(absoluteUrl) if err != nil { return nil, errors.Errorf("invalid chart URL format: %s", baseurl) } + client, err := getters.ByScheme(u.Scheme) if err != nil { From 18034016bc584b8c974e4ffa109da14ec49a0cf7 Mon Sep 17 00:00:00 2001 From: Shivam-nagar23 Date: Fri, 13 Dec 2024 17:50:35 +0530 Subject: [PATCH 2/5] vendor dep update oss update --- chart-sync/go.mod | 2 +- chart-sync/go.sum | 4 ++-- chart-sync/vendor/modules.txt | 4 ++-- ci-runner/go.mod | 2 +- ci-runner/go.sum | 4 ++-- ci-runner/vendor/modules.txt | 4 ++-- git-sensor/go.mod | 2 +- git-sensor/go.sum | 4 ++-- git-sensor/vendor/modules.txt | 4 ++-- image-scanner/go.mod | 2 +- image-scanner/go.sum | 4 ++-- image-scanner/vendor/modules.txt | 4 ++-- kubelink/go.mod | 2 +- kubelink/go.sum | 4 ++-- kubelink/vendor/modules.txt | 4 ++-- kubewatch/go.mod | 2 +- kubewatch/go.sum | 4 ++-- kubewatch/vendor/modules.txt | 4 ++-- lens/go.mod | 2 +- lens/go.sum | 4 ++-- lens/vendor/modules.txt | 4 ++-- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/chart-sync/go.mod b/chart-sync/go.mod index 47e33afed..1ad390cb4 100644 --- a/chart-sync/go.mod +++ b/chart-sync/go.mod @@ -5,7 +5,7 @@ go 1.22.4 toolchain go1.22.6 replace ( - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 helm.sh/helm/v3 v3.14.3 => github.com/devtron-labs/helm/v3 v3.14.1-0.20240401080259-90238cf69e42 ) diff --git a/chart-sync/go.sum b/chart-sync/go.sum index 2657a8951..7243953d8 100644 --- a/chart-sync/go.sum +++ b/chart-sync/go.sum @@ -54,8 +54,8 @@ github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/devtron-labs/helm/v3 v3.14.1-0.20240401080259-90238cf69e42 h1:pJmK44QaSztOiZe0iQHNf0sdy5KwkAeceydyhOG4RaY= github.com/devtron-labs/helm/v3 v3.14.1-0.20240401080259-90238cf69e42/go.mod h1:v6myVbyseSBJTzhmeE39UcPLNv6cQK6qss3dvgAySaE= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= diff --git a/chart-sync/vendor/modules.txt b/chart-sync/vendor/modules.txt index 646ba41a6..96d6e5997 100644 --- a/chart-sync/vendor/modules.txt +++ b/chart-sync/vendor/modules.txt @@ -93,7 +93,7 @@ github.com/containerd/platforms # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/helmLib/registry github.com/devtron-labs/common-lib/utils/http @@ -785,4 +785,4 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/ci-runner/go.mod b/ci-runner/go.mod index ec26ba801..d0a52f027 100644 --- a/ci-runner/go.mod +++ b/ci-runner/go.mod @@ -4,7 +4,7 @@ go 1.21 toolchain go1.21.8 -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 require ( github.com/Knetic/govaluate v3.0.0+incompatible diff --git a/ci-runner/go.sum b/ci-runner/go.sum index 97a0b434f..ad8c99fc4 100644 --- a/ci-runner/go.sum +++ b/ci-runner/go.sum @@ -57,8 +57,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= diff --git a/ci-runner/vendor/modules.txt b/ci-runner/vendor/modules.txt index a95994fae..62a49e5cd 100644 --- a/ci-runner/vendor/modules.txt +++ b/ci-runner/vendor/modules.txt @@ -118,7 +118,7 @@ github.com/cespare/xxhash/v2 # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew -# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/constants @@ -841,4 +841,4 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/git-sensor/go.mod b/git-sensor/go.mod index 4b7cbc4e3..28ba1844c 100644 --- a/git-sensor/go.mod +++ b/git-sensor/go.mod @@ -4,7 +4,7 @@ go 1.21 toolchain go1.22.4 -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/git-sensor/go.sum b/git-sensor/go.sum index 67f34be9c..4ce71a8cf 100644 --- a/git-sensor/go.sum +++ b/git-sensor/go.sum @@ -29,8 +29,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/devtron-labs/protos v0.0.3-0.20240809072909-83171af34169 h1:9OMZv0/fOWKK9s9BLTofFL/BO79TdyvC1Sc1HsC4esQ= github.com/devtron-labs/protos v0.0.3-0.20240809072909-83171af34169/go.mod h1:1TqULGlTey+VNhAu/ag7NJuUvByJemkqodsc9L5PHJk= github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= diff --git a/git-sensor/vendor/modules.txt b/git-sensor/vendor/modules.txt index d4f34960c..55afadfba 100644 --- a/git-sensor/vendor/modules.txt +++ b/git-sensor/vendor/modules.txt @@ -62,7 +62,7 @@ github.com/cyphar/filepath-securejoin # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/git-manager @@ -487,4 +487,4 @@ gopkg.in/yaml.v3 # mellium.im/sasl v0.3.1 ## explicit; go 1.18 mellium.im/sasl -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/image-scanner/go.mod b/image-scanner/go.mod index a009f1c95..1d6dd8781 100644 --- a/image-scanner/go.mod +++ b/image-scanner/go.mod @@ -74,4 +74,4 @@ require ( mellium.im/sasl v0.3.1 // indirect ) -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/image-scanner/go.sum b/image-scanner/go.sum index bcd8bbfda..6a2901840 100644 --- a/image-scanner/go.sum +++ b/image-scanner/go.sum @@ -280,8 +280,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= diff --git a/image-scanner/vendor/modules.txt b/image-scanner/vendor/modules.txt index 1981e1534..c4d080d2e 100644 --- a/image-scanner/vendor/modules.txt +++ b/image-scanner/vendor/modules.txt @@ -72,7 +72,7 @@ github.com/cespare/xxhash/v2 github.com/coreos/clair/api/v3/clairpb github.com/coreos/clair/database github.com/coreos/clair/ext/versionfmt -# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/git-manager @@ -438,4 +438,4 @@ google.golang.org/protobuf/types/known/wrapperspb # mellium.im/sasl v0.3.1 ## explicit; go 1.18 mellium.im/sasl -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/kubelink/go.mod b/kubelink/go.mod index 83a7d32ae..7bde92e23 100644 --- a/kubelink/go.mod +++ b/kubelink/go.mod @@ -177,7 +177,7 @@ require ( ) replace ( - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.18.0 // https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-505627280 k8s.io/api => k8s.io/api v0.29.0 diff --git a/kubelink/go.sum b/kubelink/go.sum index a979053f8..aa705256e 100644 --- a/kubelink/go.sum +++ b/kubelink/go.sum @@ -79,8 +79,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/distribution/distribution/v3 v3.0.0-beta.1 h1:X+ELTxPuZ1Xe5MsD3kp2wfGUhc8I+MPfRis8dZ818Ic= diff --git a/kubelink/vendor/modules.txt b/kubelink/vendor/modules.txt index 36dd70a0e..7cbe0f9f9 100644 --- a/kubelink/vendor/modules.txt +++ b/kubelink/vendor/modules.txt @@ -127,7 +127,7 @@ github.com/cyphar/filepath-securejoin # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -1353,7 +1353,7 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 # go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.18.0 # k8s.io/api => k8s.io/api v0.29.0 # k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.29.0 diff --git a/kubewatch/go.mod b/kubewatch/go.mod index 637cbb9a8..2ed0f3b10 100644 --- a/kubewatch/go.mod +++ b/kubewatch/go.mod @@ -245,4 +245,4 @@ replace ( k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.29.7 ) -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/kubewatch/go.sum b/kubewatch/go.sum index 2d43dc255..9f598d223 100644 --- a/kubewatch/go.sum +++ b/kubewatch/go.sum @@ -719,8 +719,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= diff --git a/kubewatch/vendor/modules.txt b/kubewatch/vendor/modules.txt index 3dc33ae4c..625cfeb40 100644 --- a/kubewatch/vendor/modules.txt +++ b/kubewatch/vendor/modules.txt @@ -211,7 +211,7 @@ github.com/cyphar/filepath-securejoin # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/git-manager/util @@ -1753,4 +1753,4 @@ upper.io/db.v3/postgresql # k8s.io/mount-utils => k8s.io/mount-utils v0.29.7 # k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.29.7 # k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.29.7 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/lens/go.mod b/lens/go.mod index 1d81cb310..482ccb40d 100644 --- a/lens/go.mod +++ b/lens/go.mod @@ -59,4 +59,4 @@ require ( github.com/onsi/gomega v1.18.1 // indirect ) -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 diff --git a/lens/go.sum b/lens/go.sum index fc68e729c..e6fd596bd 100644 --- a/lens/go.sum +++ b/lens/go.sum @@ -22,8 +22,8 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWH github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 h1:PGHwOCDVEVQ8OOYS1BW9iJf1EKlEJ3Fe9zAFIf/MSok= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 h1:ERDCM94Ly3EQTtXZAuyfYuFvDNQVZJABsS+Q5J5rVOY= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5/go.mod h1:NJSMdv+zTUK3p7rML12RZSeAUKHeLaoY3sR/oK0xhwo= github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb h1:CkfQQgZc950/hTPqtQSiHV2RmZgkBLGCzwR02FZYjAU= github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb/go.mod h1:pjLjgoa1GzbkOkvbMyP4SAKsaiK7eG6GoQCNauG03JA= github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= diff --git a/lens/vendor/modules.txt b/lens/vendor/modules.txt index 450b741bc..0564e029e 100644 --- a/lens/vendor/modules.txt +++ b/lens/vendor/modules.txt @@ -7,7 +7,7 @@ github.com/caarlos0/env # github.com/cespare/xxhash/v2 v2.2.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 -# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/git-manager/util @@ -282,4 +282,4 @@ google.golang.org/protobuf/types/known/timestamppb # mellium.im/sasl v0.3.1 ## explicit; go 1.18 mellium.im/sasl -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213060339-52713b6c7bc0 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241213114812-6e9f5f8fafc5 From 491a3ed93681d95aa29a23eade949571f4c188b9 Mon Sep 17 00:00:00 2001 From: ayushmaheshwari Date: Fri, 13 Dec 2024 19:12:45 +0530 Subject: [PATCH 3/5] adding options based on condition --- chart-sync/util/HttpUtil.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/chart-sync/util/HttpUtil.go b/chart-sync/util/HttpUtil.go index a5c9e6cc3..7769c78da 100644 --- a/chart-sync/util/HttpUtil.go +++ b/chart-sync/util/HttpUtil.go @@ -46,11 +46,20 @@ func GetFromUrlWithRetry(baseurl string, absoluteUrl string, username string, pa } for retries > 0 { - response, errInGetUrl = client.Get(absoluteUrl, - getter.WithURL(baseurl), - getter.WithInsecureSkipVerifyTLS(allowInsecureConnection), - getter.WithBasicAuth(username, password), - ) + + var options []getter.Option + + if allowInsecureConnection { + options = append(options, getter.WithInsecureSkipVerifyTLS(allowInsecureConnection)) + } + if len(username) > 0 && len(password) > 0 { + options = append(options, getter.WithBasicAuth(username, password)) + } + if len(baseurl)>0{ + options = append(options,)getter.WithURL(baseurl) + } + + response, errInGetUrl = client.Get(absoluteUrl, options...) if errInGetUrl != nil { retries -= 1 From 97846448c02f00c77d725e1d592a671d495c6703 Mon Sep 17 00:00:00 2001 From: ayushmaheshwari Date: Fri, 13 Dec 2024 19:13:19 +0530 Subject: [PATCH 4/5] adding options based on condition --- chart-sync/util/HttpUtil.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart-sync/util/HttpUtil.go b/chart-sync/util/HttpUtil.go index 7769c78da..349b18914 100644 --- a/chart-sync/util/HttpUtil.go +++ b/chart-sync/util/HttpUtil.go @@ -55,8 +55,8 @@ func GetFromUrlWithRetry(baseurl string, absoluteUrl string, username string, pa if len(username) > 0 && len(password) > 0 { options = append(options, getter.WithBasicAuth(username, password)) } - if len(baseurl)>0{ - options = append(options,)getter.WithURL(baseurl) + if len(baseurl) > 0 { + options = append(options, getter.WithURL(baseurl)) } response, errInGetUrl = client.Get(absoluteUrl, options...) From d34ae5c2be4f58744be464386670fcea02d349b1 Mon Sep 17 00:00:00 2001 From: ayushmaheshwari Date: Fri, 13 Dec 2024 19:14:03 +0530 Subject: [PATCH 5/5] make --- chart-sync/wire_gen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart-sync/wire_gen.go b/chart-sync/wire_gen.go index 92e4203e8..a17c7ac6a 100644 --- a/chart-sync/wire_gen.go +++ b/chart-sync/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject