diff --git a/chart-sync/go.mod b/chart-sync/go.mod index dbf51ce89..46d69e575 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-20260408094056-e2d5c635d7db +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/chart-sync/go.sum b/chart-sync/go.sum index a500f6058..ae858741f 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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 759ef64f6..05721579a 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -975,4 +975,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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/chart-sync/wire_gen.go b/chart-sync/wire_gen.go index 0022efdf4..874f69de6 100644 --- a/chart-sync/wire_gen.go +++ b/chart-sync/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run -mod=mod github.com/google/wire/cmd/wire +//go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/ci-runner/env_gen.json b/ci-runner/env_gen.json index 5334f14fd..7f80e12f7 100644 --- a/ci-runner/env_gen.json +++ b/ci-runner/env_gen.json @@ -1 +1 @@ -[{"Category":"DEVTRON","Fields":[{"Env":"AZURE_ACCOUNT_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_ACCOUNT_NAME","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_CACHE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_LOG","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_CONNECTION_INSECURE","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_GCP_CREDENTIALS_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_PROVIDER","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ACCESS_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_BUCKET_VERSIONED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT_INSECURE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_SECRET_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CONSUMER_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_BUILD_LOGS_BUCKET","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET_REGION","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_LOGS_BUCKET_REGION","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_LOG_TIME_LIMIT","EnvType":"int64","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCANNER_ENDPOINT","EnvType":"string","EnvValue":"http://image-scanner-new-demo-devtroncd-service.devtroncd:80","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LOG_LEVEL","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_ACK_WAIT_IN_SECS","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_BUFFER_SIZE","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_MAX_AGE","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_PROCESSING_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_REPLICAS","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_SERVER_HOST","EnvType":"string","EnvValue":"nats://devtron-nats.devtroncd:4222","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_EXPORT_PROM_METRICS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_FAILURE_QUERIES","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_QUERY","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_SLOW_QUERY","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_QUERY_DUR_THRESHOLD","EnvType":"int64","EnvValue":"5000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SHOW_DOCKER_BUILD_ARGS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"STREAM_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"}]}] \ No newline at end of file +[{"Category":"DEVTRON","Fields":[{"Env":"AZURE_ACCOUNT_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_ACCOUNT_NAME","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_CACHE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_LOG","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_CONNECTION_INSECURE","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_GCP_CREDENTIALS_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_PROVIDER","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ACCESS_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_BUCKET_VERSIONED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT_INSECURE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_SECRET_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CONSUMER_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_BUILD_LOGS_BUCKET","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET_REGION","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_LOGS_BUCKET_REGION","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_LOG_TIME_LIMIT","EnvType":"int64","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DOCKERFILE_SCAN_FAIL_ON_ERROR","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DOCKERFILE_SCAN_MAX_RETRIES","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DOCKERFILE_SCAN_RETRY_WAIT_SECONDS","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCANNER_ENDPOINT","EnvType":"string","EnvValue":"http://image-scanner-new-demo-devtroncd-service.devtroncd:80","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LOG_LEVEL","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_ACK_WAIT_IN_SECS","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_BUFFER_SIZE","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_MAX_AGE","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_PROCESSING_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_REPLICAS","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_SERVER_HOST","EnvType":"string","EnvValue":"nats://devtron-nats.devtroncd:4222","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_EXPORT_PROM_METRICS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_FAILURE_QUERIES","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_QUERY","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_SLOW_QUERY","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_QUERY_DUR_THRESHOLD","EnvType":"int64","EnvValue":"5000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SHOW_DOCKER_BUILD_ARGS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"STREAM_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"}]}] \ No newline at end of file diff --git a/ci-runner/env_gen.md b/ci-runner/env_gen.md index 033d7a119..f671e3c0c 100644 --- a/ci-runner/env_gen.md +++ b/ci-runner/env_gen.md @@ -22,6 +22,9 @@ | DEFAULT_CACHE_BUCKET_REGION | string | | | | false | | DEFAULT_CD_LOGS_BUCKET_REGION | string | | | | false | | DEFAULT_LOG_TIME_LIMIT | int64 |1 | | | false | + | DOCKERFILE_SCAN_FAIL_ON_ERROR | bool |false | | | false | + | DOCKERFILE_SCAN_MAX_RETRIES | int |3 | | | false | + | DOCKERFILE_SCAN_RETRY_WAIT_SECONDS | int |5 | | | false | | IMAGE_SCANNER_ENDPOINT | string |http://image-scanner-new-demo-devtroncd-service.devtroncd:80 | | | false | | LOG_LEVEL | int |0 | | | false | | NATS_MSG_ACK_WAIT_IN_SECS | int |120 | | | false | diff --git a/ci-runner/executor/stage/ciStages.go b/ci-runner/executor/stage/ciStages.go index 220cdc397..bb825f0d9 100644 --- a/ci-runner/executor/stage/ciStages.go +++ b/ci-runner/executor/stage/ciStages.go @@ -348,6 +348,34 @@ func (impl *CiStage) runBuildArtifact(ciCdRequest *helper.CiCdTriggerEvent, metr // build start := time.Now() metrics.BuildStartTime = start + + // Trigger Dockerfile scan right before build (git clone has definitely completed) + // Orchestrator has already made the decision (OR logic: userEnabled OR orgForced) + // CI-Runner blindly trusts Orchestrator's decision (no decision logic here) + if ciCdRequest.CommonWorkflowRequest.DockerfileScanEnabled { + log.Println(util.DEVTRON, "dockerfile scan triggered at build start (git clone completed)", + "buildId", ciCdRequest.CommonWorkflowRequest.WorkflowId, + "pipelineId", ciCdRequest.CommonWorkflowRequest.PipelineId, + "appId", ciCdRequest.CommonWorkflowRequest.AppId, + "checkoutPath", ciCdRequest.CommonWorkflowRequest.CheckoutPath) + // Trigger scan asynchronously (non-blocking, runs parallel to build) + go func() { + defer func() { + if r := recover(); r != nil { + log.Println(util.DEVTRON, "recovered from panic in Dockerfile scan goroutine", "panic", r) + } + }() + log.Println(util.DEVTRON, "dockerfile scan started", + "appId", ciCdRequest.CommonWorkflowRequest.AppId, + "buildId", ciCdRequest.CommonWorkflowRequest.WorkflowId, + "pipelineId", ciCdRequest.CommonWorkflowRequest.PipelineId, + "checkoutPath", ciCdRequest.CommonWorkflowRequest.CheckoutPath) + helper.InitiateDockerfileScan(ciCdRequest.CommonWorkflowRequest) + log.Println(util.DEVTRON, "dockerfile scan request sent to image-scanner", + "buildId", ciCdRequest.CommonWorkflowRequest.WorkflowId) + }() + } + dest, err := impl.dockerHelper.BuildArtifact(ciCdRequest.CommonWorkflowRequest) // TODO make it skipable metrics.BuildDuration = time.Since(start).Seconds() if err != nil { diff --git a/ci-runner/go.mod b/ci-runner/go.mod index 4063339cd..f7b614794 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-20260408094056-e2d5c635d7db +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 require ( github.com/Knetic/govaluate v3.0.0+incompatible diff --git a/ci-runner/go.sum b/ci-runner/go.sum index 51260bbd0..c6f48b46a 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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/helper/DockerfileScanHelper.go b/ci-runner/helper/DockerfileScanHelper.go new file mode 100644 index 000000000..d65f35329 --- /dev/null +++ b/ci-runner/helper/DockerfileScanHelper.go @@ -0,0 +1,145 @@ +/* + * 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 helper + +import ( + "crypto/tls" + "encoding/json" + "fmt" + "log" + "net/http" + "os" + "path/filepath" + "time" + + "github.com/caarlos0/env" + "github.com/devtron-labs/ci-runner/helper/bean" + "github.com/devtron-labs/ci-runner/util" + "github.com/go-resty/resty/v2" + "github.com/devtron-labs/ci-runner/pubsub" +) + +// MaxDockerfileSize is the maximum allowed Dockerfile size (1MB) +const MaxDockerfileSize = 1 * 1024 * 1024 // 1MB + +// InitiateDockerfileScan initiates a Dockerfile scan using hadolint +// It reads the Dockerfile from filesystem and sends content to image-scanner service +func InitiateDockerfileScan(ciRequest *CommonWorkflowRequest) { + log.Println(util.DEVTRON, "initiating Dockerfile scan") + + // Validate config exists + if ciRequest.CiBuildConfig == nil || ciRequest.CiBuildConfig.DockerBuildConfig == nil { + log.Println(util.DEVTRON, "docker build config not found, skipping Dockerfile scan") + return + } + + // Resolve Dockerfile path + var dockerfilePath string + if ciRequest.CiBuildConfig.CiBuildType == "managed-dockerfile-build" { + dockerfilePath = filepath.Join(util.WORKINGDIR, ciRequest.CheckoutPath, "./Dockerfile") + } else { + dockerfilePath = ciRequest.CiBuildConfig.DockerBuildConfig.DockerfilePath + } + + // Convert to absolute path + var err error + dockerfilePath, err = filepath.Abs(dockerfilePath) + if err != nil { + log.Println(util.DEVTRON, "error in resolving absolute path for Dockerfile", "path", dockerfilePath, "err", err) + return + } + + // Check if Dockerfile exists (removed polling logic) + if _, err := os.Stat(dockerfilePath); os.IsNotExist(err) { + log.Println(util.DEVTRON, "dockerfile scan: Dockerfile not found at", dockerfilePath) + return + } + + // Read Dockerfile from filesystem + dockerfileContent, err := os.ReadFile(dockerfilePath) + if err != nil { + log.Println(util.DEVTRON, "error in reading Dockerfile for scanning", "path", dockerfilePath, "err", err) + return + } + + // Prepare scan request + scanRequest := &bean.DockerfileScanRequest{ + AppId: ciRequest.AppId, + BuildId: ciRequest.WorkflowId, + PipelineId: ciRequest.PipelineId, + DockerfileContent: string(dockerfileContent), + } + + jsonBody, err := json.Marshal(scanRequest) + if err != nil { + log.Println(util.DEVTRON, "error in marshalling Dockerfile scan request", "err", err) + return + } + + cfg := &bean.ScanConfig{} + err = env.Parse(cfg) + if err != nil { + log.Println(util.DEVTRON, "error in parsing scan config", "err", err) + return + } + + scannerCfg := &pubsub.PubSubConfig{} + err = env.Parse(scannerCfg) + if err != nil { + log.Println(util.DEVTRON, "error in parsing scanner endpoint config", "err", err) + return + } + + // Create HTTP client (Using local instantiation but with improved error logging) + client := resty.New() + client.SetTimeout(2 * time.Minute) + client. + SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}). + SetRetryCount(cfg.MaxRetries). + SetRetryWaitTime(time.Duration(cfg.RetryWaitTimeSeconds) * time.Second) + + resp, err := client.R(). + SetHeader("Content-Type", "application/json"). + SetBody(jsonBody). + Post(fmt.Sprintf("%s/%s", scannerCfg.ImageScannerEndpoint, "scanner/dockerfile/scan")) + + // Record success/failure with actual error logging + if err != nil || (resp != nil && (resp.StatusCode() != http.StatusAccepted && resp.StatusCode() != http.StatusOK)) { + var status string + if resp != nil { + status = resp.Status() + } + log.Println(util.DEVTRON, "circuit breaker recorded FAILURE for Dockerfile scan", "buildId", ciRequest.WorkflowId, "err", err, "status", status) + } else { + log.Println(util.DEVTRON, "circuit breaker recorded SUCCESS for Dockerfile scan", "buildId", ciRequest.WorkflowId) + } + + if err != nil { + log.Println(util.DEVTRON, "error in calling image-scanner for Dockerfile scan", "err", err) + return + } + + // Accept both 202 (Accepted) and 200 (OK) + if resp.StatusCode() != http.StatusAccepted && resp.StatusCode() != http.StatusOK { + log.Println(util.DEVTRON, "image-scanner returned non-202/200 status for Dockerfile scan", + "status", resp.StatusCode(), "body", string(resp.Body())) + return + } + + log.Println(util.DEVTRON, "successfully initiated Dockerfile scan", + "statusCode", resp.StatusCode(), "buildId", ciRequest.WorkflowId) +} diff --git a/ci-runner/helper/DockerfileScanHelper_test.go b/ci-runner/helper/DockerfileScanHelper_test.go new file mode 100644 index 000000000..2a561f02e --- /dev/null +++ b/ci-runner/helper/DockerfileScanHelper_test.go @@ -0,0 +1,158 @@ +/* + * 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 helper + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" + + "github.com/devtron-labs/ci-runner/helper/bean" + "github.com/devtron-labs/ci-runner/util" +) + +func TestInitiateDockerfileScan_Success(t *testing.T) { + // Create a temporary directory structure that mimics the runner's environment + // We use os.MkdirTemp but then we need to ensure the path aligns with util.WORKINGDIR + // Since util.WORKINGDIR is constant "/devtroncd", we will create a temp dir and symlink or just use a unique path + // To avoid permission issues, we will check if we can write to util.WORKINGDIR + + testDir := filepath.Join(util.WORKINGDIR, "test-scan-"+t.Name()) + if err := os.MkdirAll(testDir, 0755); err != nil { + t.Skipf("Skipping test: cannot create directory %s: %v", testDir, err) + } + defer os.RemoveAll(testDir) + + // Create mock Dockerfile + dockerfileContent := "FROM node:18-alpine" + dockerfilePath := filepath.Join(testDir, "Dockerfile") + if err := os.WriteFile(dockerfilePath, []byte(dockerfileContent), 0644); err != nil { + t.Fatal(err) + } + + // Mock Server + receivedRequest := false + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + receivedRequest = true + var req bean.DockerfileScanRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + t.Fatal(err) + } + if req.DockerfileContent != dockerfileContent { + t.Errorf("Expected dockerfile content %s, got %s", dockerfileContent, req.DockerfileContent) + } + if !req.DockerfileScanEnabled { + t.Error("Expected DockerfileScanEnabled to be true") + } + w.WriteHeader(http.StatusAccepted) + })) + defer server.Close() + + // Setup Env + os.Setenv("IMAGE_SCANNER_ENDPOINT", server.URL) + os.Setenv("DOCKERFILE_SCAN_FAIL_ON_ERROR", "false") + + // Setup Request + // CheckoutPath should be relative to WORKINGDIR, so "test-scan-..." + req := &CommonWorkflowRequest{ + WorkflowId: 999, + AppId: 1, + PipelineId: 2, + DockerfileScanEnabled: true, + CheckoutPath: filepath.Base(testDir), + CiBuildConfig: &CiBuildConfigBean{ + CiBuildType: "managed-dockerfile-build", + DockerBuildConfig: &DockerBuildConfig{ + DockerfilePath: "./Dockerfile", + }, + }, + } + + // Call + InitiateDockerfileScan(req) + + if !receivedRequest { + t.Error("Expected scan request to be sent to server") + } +} + +func TestInitiateDockerfileScan_MissingFile(t *testing.T) { + testDir := filepath.Join(util.WORKINGDIR, "test-scan-missing-"+t.Name()) + if err := os.MkdirAll(testDir, 0755); err != nil { + t.Skipf("Skipping test: cannot create directory %s: %v", testDir, err) + } + defer os.RemoveAll(testDir) + + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + t.Error("Server should not be called if Dockerfile is missing") + })) + defer server.Close() + + os.Setenv("IMAGE_SCANNER_ENDPOINT", server.URL) + + req := &CommonWorkflowRequest{ + WorkflowId: 999, + AppId: 1, + PipelineId: 2, + DockerfileScanEnabled: true, + CheckoutPath: filepath.Base(testDir), + CiBuildConfig: &CiBuildConfigBean{ + CiBuildType: "managed-dockerfile-build", + }, + } + + // Should return silently + InitiateDockerfileScan(req) +} + +func TestInitiateDockerfileScan_ServerError(t *testing.T) { + testDir := filepath.Join(util.WORKINGDIR, "test-scan-error-"+t.Name()) + if err := os.MkdirAll(testDir, 0755); err != nil { + t.Skipf("Skipping test: cannot create directory %s: %v", testDir, err) + } + defer os.RemoveAll(testDir) + + if err := os.WriteFile(filepath.Join(testDir, "Dockerfile"), []byte("FROM node"), 0644); err != nil { + t.Fatal(err) + } + + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusInternalServerError) + })) + defer server.Close() + + os.Setenv("IMAGE_SCANNER_ENDPOINT", server.URL) + os.Setenv("DOCKERFILE_SCAN_FAIL_ON_ERROR", "false") + + req := &CommonWorkflowRequest{ + WorkflowId: 999, + AppId: 1, + PipelineId: 2, + DockerfileScanEnabled: true, + CheckoutPath: filepath.Base(testDir), + CiBuildConfig: &CiBuildConfigBean{ + CiBuildType: "managed-dockerfile-build", + }, + } + + // Should handle error gracefully + InitiateDockerfileScan(req) +} + diff --git a/ci-runner/helper/EventHelper.go b/ci-runner/helper/EventHelper.go index 29c652e13..dfcca0698 100644 --- a/ci-runner/helper/EventHelper.go +++ b/ci-runner/helper/EventHelper.go @@ -204,6 +204,7 @@ type CommonWorkflowRequest struct { AwsInspectorConfig string `json:"awsInspectorConfig,omitempty"` PartSize int64 `json:"partSize,omitempty"` ConcurrencyMultiplier int `json:"concurrencyMultiplier,omitempty"` + DockerfileScanEnabled bool `json:"dockerfileScanEnabled,omitempty"` } func (c *CommonWorkflowRequest) IsPreCdStage() bool { diff --git a/ci-runner/helper/bean/dockerfileScanBean.go b/ci-runner/helper/bean/dockerfileScanBean.go new file mode 100644 index 000000000..2a3a851a5 --- /dev/null +++ b/ci-runner/helper/bean/dockerfileScanBean.go @@ -0,0 +1,32 @@ +/* + * 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 bean + +// DockerfileScanRequest represents the request to scan a Dockerfile +type DockerfileScanRequest struct { + AppId int `json:"appId"` + BuildId int `json:"buildId"` + PipelineId int `json:"pipelineId"` + DockerfileContent string `json:"dockerfileContent"` +} + +// ScanConfig holds configuration for Dockerfile scanning +type ScanConfig struct { + FailOnError bool `env:"DOCKERFILE_SCAN_FAIL_ON_ERROR" envDefault:"false"` + MaxRetries int `env:"DOCKERFILE_SCAN_MAX_RETRIES" envDefault:"3"` + RetryWaitTimeSeconds int `env:"DOCKERFILE_SCAN_RETRY_WAIT_SECONDS" envDefault:"5"` +} diff --git a/ci-runner/vendor/modules.txt b/ci-runner/vendor/modules.txt index 279be5528..9acd1937b 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/constants @@ -1199,4 +1199,4 @@ sigs.k8s.io/structured-merge-diff/v4/value ## explicit; go 1.22 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/git-sensor/go.mod b/git-sensor/go.mod index f2dfa2a9f..9d6d6511f 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-20260408094056-e2d5c635d7db +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/git-sensor/go.sum b/git-sensor/go.sum index cf98f53b2..4e4ab960d 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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 b21d6ce8b..652aba4ff 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.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -469,4 +469,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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/git-sensor/wire_gen.go b/git-sensor/wire_gen.go index 3f2d145cb..a9a99e1f0 100644 --- a/git-sensor/wire_gen.go +++ b/git-sensor/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run -mod=mod github.com/google/wire/cmd/wire +//go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/image-scanner/go.mod b/image-scanner/go.mod index 2c21715c7..87a532cee 100644 --- a/image-scanner/go.mod +++ b/image-scanner/go.mod @@ -69,4 +69,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-20260408094056-e2d5c635d7db +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/image-scanner/go.sum b/image-scanner/go.sum index 9c570474b..13e8e9297 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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 65608a6f2..b1ef21fd1 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -457,4 +457,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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/image-scanner/wire_gen.go b/image-scanner/wire_gen.go index b85ef6b67..0c48cbb0b 100644 --- a/image-scanner/wire_gen.go +++ b/image-scanner/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run -mod=mod github.com/google/wire/cmd/wire +//go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/kubelink/go.mod b/kubelink/go.mod index 307caa2f3..e56ec3597 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-20260408094056-e2d5c635d7db +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/kubelink/go.sum b/kubelink/go.sum index 9d7bac906..f932adaff 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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/modules.txt b/kubelink/vendor/modules.txt index 7fe31dd4c..e06d441a5 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -1403,4 +1403,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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/kubelink/wire_gen.go b/kubelink/wire_gen.go index e21d708c3..3531a1858 100644 --- a/kubelink/wire_gen.go +++ b/kubelink/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run -mod=mod github.com/google/wire/cmd/wire +//go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/kubewatch/go.mod b/kubewatch/go.mod index 634deaff6..518a193c6 100644 --- a/kubewatch/go.mod +++ b/kubewatch/go.mod @@ -241,5 +241,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-20260408094056-e2d5c635d7db + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ) diff --git a/kubewatch/go.sum b/kubewatch/go.sum index 6cd3544f9..096e54ab3 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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 d26e3788d..ff1bbdf88 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/constants @@ -2002,4 +2002,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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/lens/go.mod b/lens/go.mod index fce166e18..588e79802 100644 --- a/lens/go.mod +++ b/lens/go.mod @@ -60,6 +60,6 @@ require ( ) replace ( - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 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 1943aa442..fa8e5b943 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-20260408094056-e2d5c635d7db h1:S+heJTGVdAiDcLwnau4pugYOzjmjYC87wXLsyC1PqzY= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408094056-e2d5c635d7db/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 h1:kZ50kCmIKKK+oLF2e4z63NXMnfHbD3CZSDYq8r3UE3k= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014/go.mod h1:d6awSGcXQc57s4PJlwcyACovJ4PgBmR9jZJ7h6CScUM= 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 0c1120015..5d2cc31e9 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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/fetchAllEnv @@ -304,4 +304,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-20260408094056-e2d5c635d7db +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260408100048-d3188cfb8014 diff --git a/lens/wire_gen.go b/lens/wire_gen.go index d1526fb45..a95e8302a 100644 --- a/lens/wire_gen.go +++ b/lens/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run -mod=mod github.com/google/wire/cmd/wire +//go:generate go run github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject