diff --git a/chart-sync/go.mod b/chart-sync/go.mod index 35b96c5b5..853ffc39a 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-20250425083942-5092ec30954c + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a 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 a9ecf7b81..e73df6873 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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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 1a03fae19..8b43ab0e1 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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -791,4 +791,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/ci-runner/executor/StageExecutor.go b/ci-runner/executor/StageExecutor.go index f1bf4a3fc..629119f9b 100644 --- a/ci-runner/executor/StageExecutor.go +++ b/ci-runner/executor/StageExecutor.go @@ -294,7 +294,7 @@ func (impl *StageExecutorImpl) RunCiCdStep(stepType helper.StepType, ciCdRequest stepIndexFileMountMap := make(map[int]map[string]*fileContentDto) for _, inVar := range step.InputVars { if inVar.Format == commonBean.FormatTypeFile { - fileContent := newFileContentDto(inVar.FileContent, inVar.Value) + fileContent := newFileContentDto(inVar.FileReferencePath, inVar.Value) if fileMap, ok := stepIndexFileMountMap[inVar.VariableStepIndexInPlugin]; ok { fileMap[inVar.Name] = fileContent stepIndexFileMountMap[inVar.VariableStepIndexInPlugin] = fileMap @@ -320,8 +320,8 @@ func (impl *StageExecutorImpl) RunCiCdStep(stepType helper.StepType, ciCdRequest if fileMap, ok := stepIndexFileMountMap[step.Index]; ok { for _, inVar := range step.InputVars { if fileContent, ok := fileMap[inVar.Name]; ok { - inVar.Value = fileContent.filePath - inVar.FileContent = fileContent.content + inVar.Value = fileContent.mountPath + inVar.FileReferencePath = fileContent.referencePath } } } diff --git a/ci-runner/executor/scriptExecutor.go b/ci-runner/executor/scriptExecutor.go index 3f7b1af9d..6f5eefc97 100644 --- a/ci-runner/executor/scriptExecutor.go +++ b/ci-runner/executor/scriptExecutor.go @@ -178,14 +178,14 @@ type executionConf struct { } type fileContentDto struct { - content string - filePath string + referencePath string + mountPath string } -func newFileContentDto(content, filePath string) *fileContentDto { +func newFileContentDto(fileReferencePath, fileMountPath string) *fileContentDto { return &fileContentDto{ - content: content, - filePath: filePath, + referencePath: fileReferencePath, + mountPath: fileMountPath, } } diff --git a/ci-runner/go.mod b/ci-runner/go.mod index 29f786797..50e50b9fc 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-20250425083942-5092ec30954c +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a require ( github.com/Knetic/govaluate v3.0.0+incompatible diff --git a/ci-runner/go.sum b/ci-runner/go.sum index 2dd9b877c..ef49f4c6c 100644 --- a/ci-runner/go.sum +++ b/ci-runner/go.sum @@ -95,8 +95,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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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/helper/DockerHelper.go b/ci-runner/helper/DockerHelper.go index 84f573ecb..611fb34fc 100644 --- a/ci-runner/helper/DockerHelper.go +++ b/ci-runner/helper/DockerHelper.go @@ -167,21 +167,19 @@ func (impl *DockerHelperImpl) StartDockerDaemonAndDockerLogin(commonWorkflowRequ util.PrintFileContent(DOCKERD_OUTPUT_FILE_PATH) return err } - if commonWorkflowRequest.CiBuildConfig != nil && !commonWorkflowRequest.CiBuildConfig.CiBuildType.IsSkipBuildType() { - ciContext := cicxt.BuildCiContext(context.Background(), commonWorkflowRequest.EnableSecretMasking) - err = impl.DockerLogin(ciContext, &DockerCredentials{ - DockerUsername: commonWorkflowRequest.DockerUsername, - DockerPassword: commonWorkflowRequest.DockerPassword, - AwsRegion: commonWorkflowRequest.AwsRegion, - AccessKey: commonWorkflowRequest.AccessKey, - SecretKey: commonWorkflowRequest.SecretKey, - DockerRegistryURL: commonWorkflowRequest.IntermediateDockerRegistryUrl, - DockerRegistryType: commonWorkflowRequest.DockerRegistryType, - CredentialsType: commonWorkflowRequest.CredentialsType, - }) - if err != nil { - return err - } + ciContext := cicxt.BuildCiContext(context.Background(), commonWorkflowRequest.EnableSecretMasking) + err = impl.DockerLogin(ciContext, &DockerCredentials{ + DockerUsername: commonWorkflowRequest.DockerUsername, + DockerPassword: commonWorkflowRequest.DockerPassword, + AwsRegion: commonWorkflowRequest.AwsRegion, + AccessKey: commonWorkflowRequest.AccessKey, + SecretKey: commonWorkflowRequest.SecretKey, + DockerRegistryURL: commonWorkflowRequest.IntermediateDockerRegistryUrl, + DockerRegistryType: commonWorkflowRequest.DockerRegistryType, + CredentialsType: commonWorkflowRequest.CredentialsType, + }) + if err != nil { + return err } return nil diff --git a/ci-runner/vendor/github.com/devtron-labs/common-lib/workflow/bean.go b/ci-runner/vendor/github.com/devtron-labs/common-lib/workflow/bean.go index 314776295..7f31dcfd4 100644 --- a/ci-runner/vendor/github.com/devtron-labs/common-lib/workflow/bean.go +++ b/ci-runner/vendor/github.com/devtron-labs/common-lib/workflow/bean.go @@ -1,7 +1,6 @@ package workflow import ( - "encoding/base64" "encoding/json" "fmt" "os" @@ -168,8 +167,8 @@ type VariableObject struct { ReferenceVariableName string `json:"referenceVariableName"` ReferenceVariableStepIndex int `json:"referenceVariableStepIndex"` VariableStepIndexInPlugin int `json:"variableStepIndexInPlugin"` - FileContent string `json:"fileContent"` // FileContent is the base64 encoded content of the file - TypedValue interface{} `json:"-"` // TypedValue is the formatted value of the variable after type conversion + FileReferencePath string `json:"fileReferencePath"` // FileContent is the base64 encoded content of the file + TypedValue interface{} `json:"-"` // TypedValue is the formatted value of the variable after type conversion } // TypeCheck converts the VariableObject.Value to the VariableObject.Format type @@ -188,19 +187,25 @@ func (v *VariableObject) TypeCheck() error { return nil } -// SetFileContent decodes the base64 encoded file content and writes it to the file at filePath +// SetFileContent sets the content of the file referenced by the VariableObject.FileReferencePath field. func (v *VariableObject) SetFileContent(filePath string) error { if v.Format != FormatTypeFile { return nil } + if len(v.FileReferencePath) == 0 { + // for plugins we may receive the filePath as "", + // even thought VariableObject.Value is there; + // for this case don't mount the file. + return nil + } file, fileErr := os.OpenFile(filePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, os.ModePerm) if fileErr != nil { return fileErr } defer file.Close() - fileBytes, fileErr := base64.StdEncoding.DecodeString(v.FileContent) - if fileErr != nil { - return fileErr + fileBytes, err := os.ReadFile(v.FileReferencePath) + if err != nil { + return err } _, wErr := file.Write(fileBytes) if wErr != nil { diff --git a/ci-runner/vendor/modules.txt b/ci-runner/vendor/modules.txt index 8580873af..b07b92b94 100644 --- a/ci-runner/vendor/modules.txt +++ b/ci-runner/vendor/modules.txt @@ -248,7 +248,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/constants @@ -991,4 +991,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/common-lib/utils/k8s/commonBean/bean.go b/common-lib/utils/k8s/commonBean/bean.go index 621b39edf..77dbb59d1 100644 --- a/common-lib/utils/k8s/commonBean/bean.go +++ b/common-lib/utils/k8s/commonBean/bean.go @@ -24,6 +24,7 @@ import ( ) const ( + ConfigMapKind = "ConfigMap" SecretKind = "Secret" ServiceKind = "Service" ServiceAccountKind = "ServiceAccount" @@ -300,8 +301,8 @@ type PodMetadata struct { EphemeralContainers []*EphemeralContainerData `json:"ephemeralContainers"` } -// use value field as generic type // InfoItem contains arbitrary, human readable information about an application +// use value field as generic type type InfoItem struct { // Name is a human readable title for this piece of information. Name string `json:"name,omitempty"` diff --git a/common-lib/workflow/bean.go b/common-lib/workflow/bean.go index 314776295..7f31dcfd4 100644 --- a/common-lib/workflow/bean.go +++ b/common-lib/workflow/bean.go @@ -1,7 +1,6 @@ package workflow import ( - "encoding/base64" "encoding/json" "fmt" "os" @@ -168,8 +167,8 @@ type VariableObject struct { ReferenceVariableName string `json:"referenceVariableName"` ReferenceVariableStepIndex int `json:"referenceVariableStepIndex"` VariableStepIndexInPlugin int `json:"variableStepIndexInPlugin"` - FileContent string `json:"fileContent"` // FileContent is the base64 encoded content of the file - TypedValue interface{} `json:"-"` // TypedValue is the formatted value of the variable after type conversion + FileReferencePath string `json:"fileReferencePath"` // FileContent is the base64 encoded content of the file + TypedValue interface{} `json:"-"` // TypedValue is the formatted value of the variable after type conversion } // TypeCheck converts the VariableObject.Value to the VariableObject.Format type @@ -188,19 +187,25 @@ func (v *VariableObject) TypeCheck() error { return nil } -// SetFileContent decodes the base64 encoded file content and writes it to the file at filePath +// SetFileContent sets the content of the file referenced by the VariableObject.FileReferencePath field. func (v *VariableObject) SetFileContent(filePath string) error { if v.Format != FormatTypeFile { return nil } + if len(v.FileReferencePath) == 0 { + // for plugins we may receive the filePath as "", + // even thought VariableObject.Value is there; + // for this case don't mount the file. + return nil + } file, fileErr := os.OpenFile(filePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, os.ModePerm) if fileErr != nil { return fileErr } defer file.Close() - fileBytes, fileErr := base64.StdEncoding.DecodeString(v.FileContent) - if fileErr != nil { - return fileErr + fileBytes, err := os.ReadFile(v.FileReferencePath) + if err != nil { + return err } _, wErr := file.Write(fileBytes) if wErr != nil { diff --git a/git-sensor/go.mod b/git-sensor/go.mod index b4876671c..856bb9e61 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-20250425083942-5092ec30954c +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/git-sensor/go.sum b/git-sensor/go.sum index 76870d698..a9c28c729 100644 --- a/git-sensor/go.sum +++ b/git-sensor/go.sum @@ -27,8 +27,8 @@ github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL 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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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 v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= diff --git a/git-sensor/vendor/modules.txt b/git-sensor/vendor/modules.txt index 830fa9578..2c2edf40b 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.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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -488,4 +488,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/image-scanner/go.mod b/image-scanner/go.mod index 16b2be828..efbf056b8 100644 --- a/image-scanner/go.mod +++ b/image-scanner/go.mod @@ -74,4 +74,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-20250425083942-5092ec30954c +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/image-scanner/go.sum b/image-scanner/go.sum index 64b801a6a..40d281715 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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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 6663be60d..eeb7db2ba 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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -440,4 +440,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/kubelink/go.mod b/kubelink/go.mod index 2c99649a0..dc5080066 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-20250425083942-5092ec30954c + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a 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 c290c2847..d269137a1 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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go b/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go index 621b39edf..77dbb59d1 100644 --- a/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go +++ b/kubelink/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go @@ -24,6 +24,7 @@ import ( ) const ( + ConfigMapKind = "ConfigMap" SecretKind = "Secret" ServiceKind = "Service" ServiceAccountKind = "ServiceAccount" @@ -300,8 +301,8 @@ type PodMetadata struct { EphemeralContainers []*EphemeralContainerData `json:"ephemeralContainers"` } -// use value field as generic type // InfoItem contains arbitrary, human readable information about an application +// use value field as generic type type InfoItem struct { // Name is a human readable title for this piece of information. Name string `json:"name,omitempty"` diff --git a/kubelink/vendor/modules.txt b/kubelink/vendor/modules.txt index d9cbda271..82f8ae56e 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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -1355,7 +1355,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a # 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 5b3f5ee41..0248f7156 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-20250425083942-5092ec30954c +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/kubewatch/go.sum b/kubewatch/go.sum index 2136cdb30..4a6178eec 100644 --- a/kubewatch/go.sum +++ b/kubewatch/go.sum @@ -719,8 +719,8 @@ github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL 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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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/pkg/informer/cluster/systemExec/helper.go b/kubewatch/pkg/informer/cluster/systemExec/helper.go index 7ca088360..b5f0d2bbc 100644 --- a/kubewatch/pkg/informer/cluster/systemExec/helper.go +++ b/kubewatch/pkg/informer/cluster/systemExec/helper.go @@ -221,7 +221,13 @@ func (impl *InformerImpl) inferFailedReason(eventType string, pod *coreV1.Pod) ( // were SIGKILL'd. The executor may have had to forcefully terminate the sidecar (kill -9), // resulting in a 137 exit code (which we had ignored earlier). If failMessages is empty, it // indicates that this is the case and we return Success instead of Failure. - return v1alpha1.NodeSucceeded, "" + + // Update diff from argo workflow here as we only have one main container. + // Handling this for case of spot interruption where containers are in running state (no termination state found), in that case + // it was marking it successful, doing this as it will be skipped at upper level, and delete event will handle it. + // ticket - you can find debug logs/details here - https://github.com/devtron-labs/sprint-tasks/issues/2092 + impl.logger.Infow("Pod phase was Failed but no container had terminated state, marking it as failed now", "podName", pod.Name, "status", pod.Status) + return v1alpha1.NodeFailed, "" } func getFailedReasonFromPodConditions(conditions []coreV1.PodCondition) string { diff --git a/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go b/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go index 621b39edf..77dbb59d1 100644 --- a/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go +++ b/kubewatch/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go @@ -24,6 +24,7 @@ import ( ) const ( + ConfigMapKind = "ConfigMap" SecretKind = "Secret" ServiceKind = "Service" ServiceAccountKind = "ServiceAccount" @@ -300,8 +301,8 @@ type PodMetadata struct { EphemeralContainers []*EphemeralContainerData `json:"ephemeralContainers"` } -// use value field as generic type // InfoItem contains arbitrary, human readable information about an application +// use value field as generic type type InfoItem struct { // Name is a human readable title for this piece of information. Name string `json:"name,omitempty"` diff --git a/kubewatch/vendor/modules.txt b/kubewatch/vendor/modules.txt index a561319fc..baa069fb6 100644 --- a/kubewatch/vendor/modules.txt +++ b/kubewatch/vendor/modules.txt @@ -215,7 +215,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -1761,4 +1761,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/lens/go.mod b/lens/go.mod index 7802057cb..9598ca08a 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-20250425083942-5092ec30954c +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a diff --git a/lens/go.sum b/lens/go.sum index b5083073f..0cf0e3b6d 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-20250425083942-5092ec30954c h1:lIIGAMWM4UwSwrd5Ljm1x4vtNRm1s0q2mTqdQWX8L6Q= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250425083942-5092ec30954c/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a h1:2vokYnB5dWRaDxCJbp+WKO+lwEQGtxMBi/qkUkWQH70= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= 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 4bfc43eea..b2641678b 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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a ## explicit; go 1.21 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -289,4 +289,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-20250425083942-5092ec30954c +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250504163942-4b6a6c18584a