From 485113eef4f4883b06667e315a2c7e700b4fdaa6 Mon Sep 17 00:00:00 2001 From: Vikram Singh Date: Thu, 19 Jun 2025 15:37:58 +0530 Subject: [PATCH] vendor update for release 38 --- 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 ++-- .../devtron-labs/common-lib/utils/k8s/bean.go | 11 +++++++++-- .../common-lib/utils/k8s/helper.go | 18 ++++++++++++++++++ kubelink/vendor/modules.txt | 4 ++-- kubewatch/go.mod | 2 +- kubewatch/go.sum | 4 ++-- .../devtron-labs/common-lib/utils/k8s/bean.go | 11 +++++++++-- .../common-lib/utils/k8s/helper.go | 18 ++++++++++++++++++ kubewatch/vendor/modules.txt | 4 ++-- lens/go.mod | 2 +- lens/go.sum | 4 ++-- lens/vendor/modules.txt | 4 ++-- 25 files changed, 89 insertions(+), 39 deletions(-) diff --git a/chart-sync/go.mod b/chart-sync/go.mod index 8e588174b..cf93e2175 100644 --- a/chart-sync/go.mod +++ b/chart-sync/go.mod @@ -4,7 +4,7 @@ go 1.24.0 toolchain go1.24.3 -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/chart-sync/go.sum b/chart-sync/go.sum index 2dea6ec7e..e4fa3692f 100644 --- a/chart-sync/go.sum +++ b/chart-sync/go.sum @@ -43,8 +43,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-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= 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 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM= diff --git a/chart-sync/vendor/modules.txt b/chart-sync/vendor/modules.txt index 338cf5d2a..59153a6c3 100644 --- a/chart-sync/vendor/modules.txt +++ b/chart-sync/vendor/modules.txt @@ -95,7 +95,7 @@ github.com/containerd/platforms # 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.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -967,4 +967,4 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/goyaml.v3 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/ci-runner/go.mod b/ci-runner/go.mod index 72f9f1929..7b69e3db2 100644 --- a/ci-runner/go.mod +++ b/ci-runner/go.mod @@ -4,7 +4,7 @@ go 1.24.0 toolchain go1.24.3 -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a require ( github.com/Knetic/govaluate v3.0.0+incompatible diff --git a/ci-runner/go.sum b/ci-runner/go.sum index 33078e5ed..049d614ba 100644 --- a/ci-runner/go.sum +++ b/ci-runner/go.sum @@ -114,8 +114,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-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= 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 v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k= diff --git a/ci-runner/vendor/modules.txt b/ci-runner/vendor/modules.txt index b46eaf043..98122a23c 100644 --- a/ci-runner/vendor/modules.txt +++ b/ci-runner/vendor/modules.txt @@ -298,7 +298,7 @@ github.com/cncf/xds/go/xds/type/v3 # 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.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/constants @@ -1194,4 +1194,4 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.12 sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/git-sensor/go.mod b/git-sensor/go.mod index c77186fde..05982b750 100644 --- a/git-sensor/go.mod +++ b/git-sensor/go.mod @@ -4,7 +4,7 @@ go 1.24.0 toolchain go1.24.3 -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/git-sensor/go.sum b/git-sensor/go.sum index 38ae009ac..61bf99264 100644 --- a/git-sensor/go.sum +++ b/git-sensor/go.sum @@ -26,8 +26,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-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs= github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e/go.mod h1:1TqULGlTey+VNhAu/ag7NJuUvByJemkqodsc9L5PHJk= github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k= diff --git a/git-sensor/vendor/modules.txt b/git-sensor/vendor/modules.txt index b4cba5d00..06b586533 100644 --- a/git-sensor/vendor/modules.txt +++ b/git-sensor/vendor/modules.txt @@ -66,7 +66,7 @@ github.com/cyphar/filepath-securejoin # 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.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -472,4 +472,4 @@ gopkg.in/yaml.v3 # mellium.im/sasl v0.3.2 ## explicit; go 1.20 mellium.im/sasl -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/image-scanner/go.mod b/image-scanner/go.mod index 6a4e41c02..8043c8490 100644 --- a/image-scanner/go.mod +++ b/image-scanner/go.mod @@ -70,4 +70,4 @@ require ( mellium.im/sasl v0.3.2 // indirect ) -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/image-scanner/go.sum b/image-scanner/go.sum index 864ab4c49..4244feef6 100644 --- a/image-scanner/go.sum +++ b/image-scanner/go.sum @@ -279,8 +279,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= 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 90904477a..33859d88d 100644 --- a/image-scanner/vendor/modules.txt +++ b/image-scanner/vendor/modules.txt @@ -74,7 +74,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-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -456,4 +456,4 @@ google.golang.org/protobuf/types/known/wrapperspb # mellium.im/sasl v0.3.2 ## explicit; go 1.20 mellium.im/sasl -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/kubelink/go.mod b/kubelink/go.mod index 0122e95cb..17ece23a1 100644 --- a/kubelink/go.mod +++ b/kubelink/go.mod @@ -168,4 +168,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect ) -replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/kubelink/go.sum b/kubelink/go.sum index 5caac0345..602da5163 100644 --- a/kubelink/go.sum +++ b/kubelink/go.sum @@ -65,8 +65,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-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= 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 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM= diff --git a/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go b/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go index afd05a320..c5dc1a033 100644 --- a/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go +++ b/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go @@ -20,6 +20,7 @@ import ( "errors" "fmt" "github.com/caarlos0/env" + "github.com/devtron-labs/common-lib/utils" "github.com/devtron-labs/common-lib/utils/k8sObjectsUtil" "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" v1 "k8s.io/api/core/v1" @@ -43,10 +44,16 @@ type ClusterConfig struct { RemoteConnectionConfig *bean.RemoteConnectionConfigBean } +var logger, _ = utils.NewSugardLogger() + func (clusterConfig *ClusterConfig) PopulateTlsConfigurationsInto(restConfig *rest.Config) { - restConfig.TLSClientConfig = rest.TLSClientConfig{Insecure: clusterConfig.InsecureSkipTLSVerify} + serverName, err := GetServerNameFromServerUrl(clusterConfig.Host) + if err != nil { + // making it non-blocking to avoid blocking the flow + logger.Errorw("Error parsing server URL:", "err", err, "clusterConfig.Host", clusterConfig.Host) + } + restConfig.TLSClientConfig = rest.TLSClientConfig{Insecure: clusterConfig.InsecureSkipTLSVerify, ServerName: serverName} if clusterConfig.InsecureSkipTLSVerify == false { - restConfig.TLSClientConfig.ServerName = restConfig.ServerName restConfig.TLSClientConfig.KeyData = []byte(clusterConfig.KeyData) restConfig.TLSClientConfig.CertData = []byte(clusterConfig.CertData) restConfig.TLSClientConfig.CAData = []byte(clusterConfig.CAData) diff --git a/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go b/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go index 892979931..157f3edd2 100644 --- a/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go +++ b/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go @@ -36,7 +36,9 @@ import ( "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + "net" "net/http" + "net/url" "strings" ) @@ -226,3 +228,19 @@ func OverrideK8sHttpClientWithTracer(restConfig *rest.Config) (*http.Client, err httpClientFor.Transport = otelhttp.NewTransport(httpClientFor.Transport) return httpClientFor, nil } + +func GetServerNameFromServerUrl(serverURL string) (string, error) { + u, err := url.Parse(serverURL) + if err != nil { + return "", err + } + + host := u.Host + if strings.Contains(host, ":") { + host, _, err = net.SplitHostPort(u.Host) + if err != nil { + return "", err + } + } + return host, nil +} diff --git a/kubelink/vendor/modules.txt b/kubelink/vendor/modules.txt index 638841988..b1c36849b 100644 --- a/kubelink/vendor/modules.txt +++ b/kubelink/vendor/modules.txt @@ -125,7 +125,7 @@ github.com/cyphar/filepath-securejoin # 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.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -1386,4 +1386,4 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/goyaml.v3 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/kubewatch/go.mod b/kubewatch/go.mod index ddba50ddc..5a0605241 100644 --- a/kubewatch/go.mod +++ b/kubewatch/go.mod @@ -238,5 +238,5 @@ require ( replace ( github.com/cyphar/filepath-securejoin v0.4.1 => github.com/cyphar/filepath-securejoin v0.3.6 // indirect - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ) diff --git a/kubewatch/go.sum b/kubewatch/go.sum index a8deb35c0..14b154ca4 100644 --- a/kubewatch/go.sum +++ b/kubewatch/go.sum @@ -129,8 +129,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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/denisenkom/go-mssqldb v0.12.3/go.mod h1:k0mtMFOnU+AihqFxPMiF05rtiDrorD1Vrm1KEz5hxDo= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 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= diff --git a/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go b/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go index afd05a320..c5dc1a033 100644 --- a/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go +++ b/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go @@ -20,6 +20,7 @@ import ( "errors" "fmt" "github.com/caarlos0/env" + "github.com/devtron-labs/common-lib/utils" "github.com/devtron-labs/common-lib/utils/k8sObjectsUtil" "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" v1 "k8s.io/api/core/v1" @@ -43,10 +44,16 @@ type ClusterConfig struct { RemoteConnectionConfig *bean.RemoteConnectionConfigBean } +var logger, _ = utils.NewSugardLogger() + func (clusterConfig *ClusterConfig) PopulateTlsConfigurationsInto(restConfig *rest.Config) { - restConfig.TLSClientConfig = rest.TLSClientConfig{Insecure: clusterConfig.InsecureSkipTLSVerify} + serverName, err := GetServerNameFromServerUrl(clusterConfig.Host) + if err != nil { + // making it non-blocking to avoid blocking the flow + logger.Errorw("Error parsing server URL:", "err", err, "clusterConfig.Host", clusterConfig.Host) + } + restConfig.TLSClientConfig = rest.TLSClientConfig{Insecure: clusterConfig.InsecureSkipTLSVerify, ServerName: serverName} if clusterConfig.InsecureSkipTLSVerify == false { - restConfig.TLSClientConfig.ServerName = restConfig.ServerName restConfig.TLSClientConfig.KeyData = []byte(clusterConfig.KeyData) restConfig.TLSClientConfig.CertData = []byte(clusterConfig.CertData) restConfig.TLSClientConfig.CAData = []byte(clusterConfig.CAData) diff --git a/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go b/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go index 892979931..157f3edd2 100644 --- a/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go +++ b/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/helper.go @@ -36,7 +36,9 @@ import ( "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + "net" "net/http" + "net/url" "strings" ) @@ -226,3 +228,19 @@ func OverrideK8sHttpClientWithTracer(restConfig *rest.Config) (*http.Client, err httpClientFor.Transport = otelhttp.NewTransport(httpClientFor.Transport) return httpClientFor, nil } + +func GetServerNameFromServerUrl(serverURL string) (string, error) { + u, err := url.Parse(serverURL) + if err != nil { + return "", err + } + + host := u.Host + if strings.Contains(host, ":") { + host, _, err = net.SplitHostPort(u.Host) + if err != nil { + return "", err + } + } + return host, nil +} diff --git a/kubewatch/vendor/modules.txt b/kubewatch/vendor/modules.txt index ce583b961..0caaa6612 100644 --- a/kubewatch/vendor/modules.txt +++ b/kubewatch/vendor/modules.txt @@ -251,7 +251,7 @@ github.com/cyphar/filepath-securejoin # 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.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -1981,4 +1981,4 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/goyaml.v3 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a diff --git a/lens/go.mod b/lens/go.mod index 91394a36c..22336d016 100644 --- a/lens/go.mod +++ b/lens/go.mod @@ -59,6 +59,6 @@ require ( ) replace ( - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 ) diff --git a/lens/go.sum b/lens/go.sum index 115023412..8133cce3c 100644 --- a/lens/go.sum +++ b/lens/go.sum @@ -17,8 +17,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-20250616120524-fc7dd34a7903 h1:JuUR0v/y0x3heX2FhhCWNoYxbxAFAeFC7+cYUxjx7D8= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= github.com/devtron-labs/protos v0.0.3-0.20240912111807-605886d90b8d h1:IV6FWU6eWSfKq67Fs2DBx3LjkX/wtjMj9QB3ufZgga4= github.com/devtron-labs/protos v0.0.3-0.20240912111807-605886d90b8d/go.mod h1:1TqULGlTey+VNhAu/ag7NJuUvByJemkqodsc9L5PHJk= github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k= diff --git a/lens/vendor/modules.txt b/lens/vendor/modules.txt index acfcd2a22..ef58b595e 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.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 -# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -302,4 +302,4 @@ google.golang.org/protobuf/types/known/timestamppb # mellium.im/sasl v0.3.2 ## explicit; go 1.20 mellium.im/sasl -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250616120524-fc7dd34a7903 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a