diff --git a/chart-sync/go.mod b/chart-sync/go.mod index 160b4e879..466edd814 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-20250702074224-9bda00b1f155 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/chart-sync/go.sum b/chart-sync/go.sum index 41d5ae2e2..b9c53aed7 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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 0a15a99ec..66d95a5ff 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/ci-runner/go.mod b/ci-runner/go.mod index 3033cd1cc..10aaa1f0d 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-20250702074224-9bda00b1f155 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c require ( github.com/Knetic/govaluate v3.0.0+incompatible diff --git a/ci-runner/go.sum b/ci-runner/go.sum index 46dab888b..fd24e6203 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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 600aecd28..24eeb73fa 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/common-lib/k8sResource/errors/constants.go b/common-lib/k8sResource/errors/constants.go new file mode 100644 index 000000000..3f961aa4a --- /dev/null +++ b/common-lib/k8sResource/errors/constants.go @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package errors + +import ( + "google.golang.org/grpc/codes" +) + +// list of error strings from Helm. These are part of the errors we check for presence in Helm's error messages. +const ( + ClusterUnreachableErrorMsg = "cluster unreachable" + CrdPreconditionErrorMsg = "ensure crds are installed first" + ArrayStringMismatchErrorMsg = "got array expected string" + NotFoundErrorMsg = "not found" //this is a generic type constant, an error could be namespace "ns1" not found or service "ser1" not found. + InvalidValueErrorMsg = "invalid value" + OperationInProgressErrorMsg = "another operation (install/upgrade/rollback) is in progress" + ForbiddenErrorMsg = "forbidden" +) + +// list of internal errors, these errors are easy for the users to understand +const ( + InternalClusterUnreachableErrorMsg = "cluster unreachable" + InternalOperationInProgressErrorMsg = "another operation (install/upgrade/rollback) is in progress" +) + +type errorGrpcCodeTuple struct { + errorMsg string + grpcCode codes.Code +} + +var helmErrorInternalErrorMap = map[string]errorGrpcCodeTuple{ + ClusterUnreachableErrorMsg: {errorMsg: InternalClusterUnreachableErrorMsg, grpcCode: codes.DeadlineExceeded}, + OperationInProgressErrorMsg: {errorMsg: InternalOperationInProgressErrorMsg, grpcCode: codes.FailedPrecondition}, +} + +var DynamicErrorMapping = map[string]codes.Code{ + NotFoundErrorMsg: codes.NotFound, + ForbiddenErrorMsg: codes.PermissionDenied, + InvalidValueErrorMsg: codes.InvalidArgument, + ArrayStringMismatchErrorMsg: codes.InvalidArgument, + CrdPreconditionErrorMsg: codes.FailedPrecondition, +} diff --git a/common-lib/k8sResource/errors/errors.go b/common-lib/k8sResource/errors/errors.go new file mode 100644 index 000000000..6d503e68c --- /dev/null +++ b/common-lib/k8sResource/errors/errors.go @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package errors + +import ( + "google.golang.org/grpc/status" + "strings" +) + +// ConvertHelmErrorToInternalError converts known error message from helm to internal error and also maps it with proper grpc code +func ConvertHelmErrorToInternalError(err error) error { + genericError := getInternalErrorForGenericErrorTypes(err) + if genericError != nil { + return genericError + } + var internalError error + for helmErrMsg, internalErr := range helmErrorInternalErrorMap { + if strings.Contains(err.Error(), helmErrMsg) { + internalError = status.New(internalErr.grpcCode, internalErr.errorMsg).Err() + } + } + return internalError +} + +// getInternalErrorForGenericErrorTypes returns all those kinds of errors which are generic in nature and also dynamic, make sure to return all generic and dynamic errors from this func. instead of putting them in helmErrorInternalErrorMap +func getInternalErrorForGenericErrorTypes(err error) error { + /* + for example:- + 1. if namespace is not found err is:- namespace "ns1" not found, + 2. in case ingress class not found error is of type ingress class: IngressClass.networking.k8s.io "ingress1" not found, + 3. when some resource is forbidden then err can be of many formats one of which is:- Unable to continue with install: could not get information about the resource Ingress "prakash-1-prakash-env3-ingress" in namespace "prakash-ns3": ingresses.networking.k8s.io "prakash-1-prakash-env3-ingress" is forbidden... + etc.. + */ + for errorMsg, code := range DynamicErrorMapping { + if strings.Contains(strings.ToLower(err.Error()), errorMsg) { + return status.New(code, err.Error()).Err() + } + } + + return nil +} diff --git a/common-lib/k8sResource/listChildObjects.go b/common-lib/k8sResource/listChildObjects.go index f79bda52e..f1a90ecd3 100644 --- a/common-lib/k8sResource/listChildObjects.go +++ b/common-lib/k8sResource/listChildObjects.go @@ -3,9 +3,11 @@ package k8sResource import ( "context" "errors" + customErr "github.com/devtron-labs/common-lib/k8sResource/errors" k8sUtils "github.com/devtron-labs/common-lib/utils/k8s" k8sCommonBean "github.com/devtron-labs/common-lib/utils/k8s/commonBean" coreV1 "k8s.io/api/core/v1" + errors2 "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -196,8 +198,15 @@ func (impl *K8sServiceImpl) getChildObject(client *dynamicClient.DynamicClient, filterListStartTime := time.Now() childrenObjectsList, k8sErr := childResourceClient.List(context.Background(), options) if k8sErr != nil { - impl.logger.Errorw("error in getting child listObjects", filterObjRequest.GetLoggerMetadata("counter", counter, "timeTaken", time.Since(filterListStartTime).Seconds(), "err", k8sErr)...) - return nil, k8sErr + statusError, matched := k8sErr.(*errors2.StatusError) + if !matched || statusError.ErrStatus.Reason != metaV1.StatusReasonNotFound { + internalErr := customErr.ConvertHelmErrorToInternalError(k8sErr) + if internalErr != nil { + k8sErr = internalErr + } + impl.logger.Errorw("error in getting child listObjects", filterObjRequest.GetLoggerMetadata("counter", counter, "timeTaken", time.Since(filterListStartTime).Seconds(), "err", k8sErr)...) + return nil, k8sErr + } } impl.logger.Debugw("listing child objects", filterObjRequest.GetLoggerMetadata("counter", counter, "timeTaken", time.Since(filterListStartTime).Seconds())...) filterObjRequest = filterObjRequest.WithListObjects(childrenObjectsList) diff --git a/git-sensor/go.mod b/git-sensor/go.mod index e9c7f33c2..c5408265d 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-20250702074224-9bda00b1f155 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/git-sensor/go.sum b/git-sensor/go.sum index 1b16bd2fc..9081c506d 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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 52dac8477..e3220c2ec 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/image-scanner/go.mod b/image-scanner/go.mod index 45ee54662..95f750da1 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-20250702074224-9bda00b1f155 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/image-scanner/go.sum b/image-scanner/go.sum index 7969cdf73..3c708903a 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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 8e293b1ec..1234ca833 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/kubelink/error/constants.go b/kubelink/error/constants.go index fd28472f2..612087ebf 100644 --- a/kubelink/error/constants.go +++ b/kubelink/error/constants.go @@ -16,42 +16,7 @@ package error -import ( - "google.golang.org/grpc/codes" -) - // list of error strings from Helm. These are part of the errors we check for presence in Helm's error messages. const ( - YAMLToJSONConversionError = "error converting YAML to JSON" - ClusterUnreachableErrorMsg = "cluster unreachable" - CrdPreconditionErrorMsg = "ensure crds are installed first" - ArrayStringMismatchErrorMsg = "got array expected string" - NotFoundErrorMsg = "not found" //this is a generic type constant, an error could be namespace "ns1" not found or service "ser1" not found. - InvalidValueErrorMsg = "invalid value" - OperationInProgressErrorMsg = "another operation (install/upgrade/rollback) is in progress" - ForbiddenErrorMsg = "forbidden" -) - -// list of internal errors, these errors are easy for the users to understand -const ( - InternalClusterUnreachableErrorMsg = "cluster unreachable" - InternalOperationInProgressErrorMsg = "another operation (install/upgrade/rollback) is in progress" + YAMLToJSONConversionError = "error converting YAML to JSON" ) - -type errorGrpcCodeTuple struct { - errorMsg string - grpcCode codes.Code -} - -var helmErrorInternalErrorMap = map[string]errorGrpcCodeTuple{ - ClusterUnreachableErrorMsg: {errorMsg: InternalClusterUnreachableErrorMsg, grpcCode: codes.DeadlineExceeded}, - OperationInProgressErrorMsg: {errorMsg: InternalOperationInProgressErrorMsg, grpcCode: codes.FailedPrecondition}, -} - -var DynamicErrorMapping = map[string]codes.Code{ - NotFoundErrorMsg: codes.NotFound, - ForbiddenErrorMsg: codes.PermissionDenied, - InvalidValueErrorMsg: codes.InvalidArgument, - ArrayStringMismatchErrorMsg: codes.InvalidArgument, - CrdPreconditionErrorMsg: codes.FailedPrecondition, -} diff --git a/kubelink/error/utils.go b/kubelink/error/utils.go index 8abe0ff10..2567319dc 100644 --- a/kubelink/error/utils.go +++ b/kubelink/error/utils.go @@ -17,39 +17,10 @@ package error import ( - "google.golang.org/grpc/status" - "strings" + customErr "github.com/devtron-labs/common-lib/k8sResource/errors" ) // ConvertHelmErrorToInternalError converts known error message from helm to internal error and also maps it with proper grpc code func ConvertHelmErrorToInternalError(err error) error { - genericError := getInternalErrorForGenericErrorTypes(err) - if genericError != nil { - return genericError - } - var internalError error - for helmErrMsg, internalErr := range helmErrorInternalErrorMap { - if strings.Contains(err.Error(), helmErrMsg) { - internalError = status.New(internalErr.grpcCode, internalErr.errorMsg).Err() - } - } - return internalError -} - -// getInternalErrorForGenericErrorTypes returns all those kinds of errors which are generic in nature and also dynamic, make sure to return all generic and dynamic errors from this func. instead of putting them in helmErrorInternalErrorMap -func getInternalErrorForGenericErrorTypes(err error) error { - /* - for example:- - 1. if namespace is not found err is:- namespace "ns1" not found, - 2. in case ingress class not found error is of type ingress class: IngressClass.networking.k8s.io "ingress1" not found, - 3. when some resource is forbidden then err can be of many formats one of which is:- Unable to continue with install: could not get information about the resource Ingress "prakash-1-prakash-env3-ingress" in namespace "prakash-ns3": ingresses.networking.k8s.io "prakash-1-prakash-env3-ingress" is forbidden... - etc.. - */ - for errorMsg, code := range DynamicErrorMapping { - if strings.Contains(strings.ToLower(err.Error()), errorMsg) { - return status.New(code, err.Error()).Err() - } - } - - return nil + return customErr.ConvertHelmErrorToInternalError(err) } diff --git a/kubelink/go.mod b/kubelink/go.mod index 8d60666ce..db60bb5fe 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-20250702074224-9bda00b1f155 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/kubelink/go.sum b/kubelink/go.sum index 468859d01..cc7be40cd 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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/k8sResource/errors/constants.go b/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/errors/constants.go new file mode 100644 index 000000000..3f961aa4a --- /dev/null +++ b/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/errors/constants.go @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package errors + +import ( + "google.golang.org/grpc/codes" +) + +// list of error strings from Helm. These are part of the errors we check for presence in Helm's error messages. +const ( + ClusterUnreachableErrorMsg = "cluster unreachable" + CrdPreconditionErrorMsg = "ensure crds are installed first" + ArrayStringMismatchErrorMsg = "got array expected string" + NotFoundErrorMsg = "not found" //this is a generic type constant, an error could be namespace "ns1" not found or service "ser1" not found. + InvalidValueErrorMsg = "invalid value" + OperationInProgressErrorMsg = "another operation (install/upgrade/rollback) is in progress" + ForbiddenErrorMsg = "forbidden" +) + +// list of internal errors, these errors are easy for the users to understand +const ( + InternalClusterUnreachableErrorMsg = "cluster unreachable" + InternalOperationInProgressErrorMsg = "another operation (install/upgrade/rollback) is in progress" +) + +type errorGrpcCodeTuple struct { + errorMsg string + grpcCode codes.Code +} + +var helmErrorInternalErrorMap = map[string]errorGrpcCodeTuple{ + ClusterUnreachableErrorMsg: {errorMsg: InternalClusterUnreachableErrorMsg, grpcCode: codes.DeadlineExceeded}, + OperationInProgressErrorMsg: {errorMsg: InternalOperationInProgressErrorMsg, grpcCode: codes.FailedPrecondition}, +} + +var DynamicErrorMapping = map[string]codes.Code{ + NotFoundErrorMsg: codes.NotFound, + ForbiddenErrorMsg: codes.PermissionDenied, + InvalidValueErrorMsg: codes.InvalidArgument, + ArrayStringMismatchErrorMsg: codes.InvalidArgument, + CrdPreconditionErrorMsg: codes.FailedPrecondition, +} diff --git a/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/errors/errors.go b/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/errors/errors.go new file mode 100644 index 000000000..6d503e68c --- /dev/null +++ b/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/errors/errors.go @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package errors + +import ( + "google.golang.org/grpc/status" + "strings" +) + +// ConvertHelmErrorToInternalError converts known error message from helm to internal error and also maps it with proper grpc code +func ConvertHelmErrorToInternalError(err error) error { + genericError := getInternalErrorForGenericErrorTypes(err) + if genericError != nil { + return genericError + } + var internalError error + for helmErrMsg, internalErr := range helmErrorInternalErrorMap { + if strings.Contains(err.Error(), helmErrMsg) { + internalError = status.New(internalErr.grpcCode, internalErr.errorMsg).Err() + } + } + return internalError +} + +// getInternalErrorForGenericErrorTypes returns all those kinds of errors which are generic in nature and also dynamic, make sure to return all generic and dynamic errors from this func. instead of putting them in helmErrorInternalErrorMap +func getInternalErrorForGenericErrorTypes(err error) error { + /* + for example:- + 1. if namespace is not found err is:- namespace "ns1" not found, + 2. in case ingress class not found error is of type ingress class: IngressClass.networking.k8s.io "ingress1" not found, + 3. when some resource is forbidden then err can be of many formats one of which is:- Unable to continue with install: could not get information about the resource Ingress "prakash-1-prakash-env3-ingress" in namespace "prakash-ns3": ingresses.networking.k8s.io "prakash-1-prakash-env3-ingress" is forbidden... + etc.. + */ + for errorMsg, code := range DynamicErrorMapping { + if strings.Contains(strings.ToLower(err.Error()), errorMsg) { + return status.New(code, err.Error()).Err() + } + } + + return nil +} diff --git a/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/listChildObjects.go b/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/listChildObjects.go index f79bda52e..f1a90ecd3 100644 --- a/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/listChildObjects.go +++ b/kubelink/vendor/github.com/devtron-labs/common-lib/k8sResource/listChildObjects.go @@ -3,9 +3,11 @@ package k8sResource import ( "context" "errors" + customErr "github.com/devtron-labs/common-lib/k8sResource/errors" k8sUtils "github.com/devtron-labs/common-lib/utils/k8s" k8sCommonBean "github.com/devtron-labs/common-lib/utils/k8s/commonBean" coreV1 "k8s.io/api/core/v1" + errors2 "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -196,8 +198,15 @@ func (impl *K8sServiceImpl) getChildObject(client *dynamicClient.DynamicClient, filterListStartTime := time.Now() childrenObjectsList, k8sErr := childResourceClient.List(context.Background(), options) if k8sErr != nil { - impl.logger.Errorw("error in getting child listObjects", filterObjRequest.GetLoggerMetadata("counter", counter, "timeTaken", time.Since(filterListStartTime).Seconds(), "err", k8sErr)...) - return nil, k8sErr + statusError, matched := k8sErr.(*errors2.StatusError) + if !matched || statusError.ErrStatus.Reason != metaV1.StatusReasonNotFound { + internalErr := customErr.ConvertHelmErrorToInternalError(k8sErr) + if internalErr != nil { + k8sErr = internalErr + } + impl.logger.Errorw("error in getting child listObjects", filterObjRequest.GetLoggerMetadata("counter", counter, "timeTaken", time.Since(filterListStartTime).Seconds(), "err", k8sErr)...) + return nil, k8sErr + } } impl.logger.Debugw("listing child objects", filterObjRequest.GetLoggerMetadata("counter", counter, "timeTaken", time.Since(filterListStartTime).Seconds())...) filterObjRequest = filterObjRequest.WithListObjects(childrenObjectsList) diff --git a/kubelink/vendor/modules.txt b/kubelink/vendor/modules.txt index c200cca11..6e7cc76d4 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -134,6 +134,7 @@ github.com/devtron-labs/common-lib/git-manager/util github.com/devtron-labs/common-lib/helmLib/registry github.com/devtron-labs/common-lib/informer github.com/devtron-labs/common-lib/k8sResource +github.com/devtron-labs/common-lib/k8sResource/errors github.com/devtron-labs/common-lib/middlewares github.com/devtron-labs/common-lib/monitoring github.com/devtron-labs/common-lib/monitoring/pprof @@ -1387,4 +1388,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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/kubewatch/go.mod b/kubewatch/go.mod index 5140468b8..9e607a316 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-20250702074224-9bda00b1f155 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ) diff --git a/kubewatch/go.sum b/kubewatch/go.sum index 1262d7c2e..1cb467dea 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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/modules.txt b/kubewatch/vendor/modules.txt index 3054d04eb..767ad4ce6 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c diff --git a/lens/go.mod b/lens/go.mod index 62bb1a59c..6a19dc5ae 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-20250702074224-9bda00b1f155 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c 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 fd9164980..6974fdd80 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-20250702074224-9bda00b1f155 h1:/hdnSB/SGOsiIKw9/BH9kg5eg/Ov60IQj8Gjc8cVWgE= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250702074224-9bda00b1f155/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/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 ccbaeefde..a5162cff4 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c ## 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-20250702074224-9bda00b1f155 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c