diff --git a/chart-sync/go.mod b/chart-sync/go.mod index fc592a5d6..d914cad05 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-20250703034313-6e26d7880667 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/chart-sync/go.sum b/chart-sync/go.sum index e61d11230..01960ebef 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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 680e3dba8..2a7a735a2 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/ci-runner/go.mod b/ci-runner/go.mod index b3d447c1e..d6fb6a5de 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-20250703034313-6e26d7880667 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e require ( github.com/Knetic/govaluate v3.0.0+incompatible @@ -16,8 +16,10 @@ require ( github.com/otiai10/copy v1.14.1 golang.org/x/sync v0.14.0 gopkg.in/yaml.v2 v2.4.0 + k8s.io/api v0.33.1 k8s.io/apimachinery v0.33.1 k8s.io/client-go v0.33.1 + k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 ) require ( @@ -149,10 +151,8 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect - k8s.io/api v0.33.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect - k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect mellium.im/sasl v0.3.2 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/randfill v1.0.0 // indirect diff --git a/ci-runner/go.sum b/ci-runner/go.sum index e3b8e2f13..e2e9adaf6 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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/helper/CiStageError.go b/ci-runner/helper/CiStageError.go index da806ae6c..9043c792f 100644 --- a/ci-runner/helper/CiStageError.go +++ b/ci-runner/helper/CiStageError.go @@ -17,6 +17,7 @@ package helper import ( + "errors" "fmt" "github.com/devtron-labs/common-lib/utils/workFlow" ) @@ -125,3 +126,5 @@ func (err *CdStageError) ErrorMessage() string { func (err *CdStageError) Unwrap() error { return err.stageErr } + +var BuilderPodDeletedError = errors.New("Buildx pod(s) was terminated in response to imminent node shutdown.") diff --git a/ci-runner/helper/CommandExecuter.go b/ci-runner/helper/CommandExecuter.go index 566a13e8d..899619c53 100644 --- a/ci-runner/helper/CommandExecuter.go +++ b/ci-runner/helper/CommandExecuter.go @@ -1,14 +1,15 @@ package helper import ( + cicxt "github.com/devtron-labs/ci-runner/executor/context" "os/exec" - cicxt "github.com/devtron-labs/ci-runner/executor/context" "github.com/devtron-labs/ci-runner/util" ) type CommandExecutor interface { RunCommand(ctx cicxt.CiContext, cmd *exec.Cmd) error + RunCommandWithCtx(ctx cicxt.CiContext, cmd *exec.Cmd) error } type CommandExecutorImpl struct { @@ -21,3 +22,16 @@ func NewCommandExecutorImpl() *CommandExecutorImpl { func (c *CommandExecutorImpl) RunCommand(ctx cicxt.CiContext, cmd *exec.Cmd) error { return util.RunCommand(cmd) } + +func (c *CommandExecutorImpl) RunCommandWithCtx(ctx cicxt.CiContext, cmd *exec.Cmd) error { + return util.RunCommand(c.GetCommandWithCtx(ctx, cmd)) +} + +func (c *CommandExecutorImpl) GetCommandWithCtx(ctx cicxt.CiContext, cmd *exec.Cmd) *exec.Cmd { + // Ensure the command is run with the provided context + var args []string + if len(cmd.Args) > 1 { + args = cmd.Args[1:] + } + return exec.CommandContext(ctx, cmd.Path, args...) +} diff --git a/ci-runner/helper/DockerHelper.go b/ci-runner/helper/DockerHelper.go index 55560e70b..35498897c 100644 --- a/ci-runner/helper/DockerHelper.go +++ b/ci-runner/helper/DockerHelper.go @@ -31,18 +31,15 @@ import ( "github.com/caarlos0/env" cicxt "github.com/devtron-labs/ci-runner/executor/context" bean2 "github.com/devtron-labs/ci-runner/helper/bean" - "github.com/devtron-labs/common-lib/constants" - "github.com/devtron-labs/ci-runner/util" + "github.com/devtron-labs/common-lib/constants" "github.com/devtron-labs/common-lib/utils" "github.com/devtron-labs/common-lib/utils/bean" "github.com/devtron-labs/common-lib/utils/dockerOperations" + "github.com/devtron-labs/common-lib/utils/retryFunc" + "golang.org/x/sync/errgroup" "io" "io/ioutil" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - appsV1 "k8s.io/client-go/kubernetes/typed/apps/v1" - "k8s.io/client-go/rest" "log" "os" "os/exec" @@ -303,6 +300,102 @@ func (impl *DockerHelperImpl) DockerLogin(ciContext cicxt.CiContext, dockerCrede return performDockerLogin() } +func (impl *DockerHelperImpl) executeDockerReBuild(ciContext cicxt.CiContext, k8sClient BuildxK8sInterface, + useBuildxK8sDriver bool, dockerBuild string, deploymentNames []string, + dockerBuildStageMetadata bean2.DockerBuildStageMetadata, reBuildLogs []any) error { + if !useBuildxK8sDriver { + return nil + } + k8sErr := k8sClient.RestartBuilders(ciContext) + if k8sErr != nil { + log.Println(util.DEVTRON, fmt.Sprintf(" error in RestartBuilders : %s", k8sErr.Error())) + return k8sErr + } + k8sClient, err := newBuildxK8sClient(deploymentNames) + if err != nil { + log.Println(util.DEVTRON, " error in creating buildxK8sClient , err : ", err.Error()) + return err + } + err = k8sClient.RegisterBuilderPods(ciContext) + if err != nil { + log.Println(util.DEVTRON, " error in registering builder pods ", " err: ", err.Error()) + return err + } + rebuildImageStage := func() error { + // wait for the builder pod to be up again + startTime := time.Now() + util.LogInfo("Waiting for builder pod to be ready,", "timeout: 2 minutes") + done := make(chan bool) + ctx, cancel := context.WithCancel(ciContext) + defer cancel() + go k8sClient.WaitUntilBuilderPodLive(ctx, done) + select { + case <-done: + // builder pod is up again, continue with the build + cancel() + case <-time.After(2 * time.Minute): + // timeout after 2 minutes + cancel() + return BuilderPodDeletedError + } + util.LogInfo("DONE -->", time.Since(startTime).Seconds()) + buildImageFunc := impl.buildImageStage(ciContext, dockerBuild, useBuildxK8sDriver, k8sClient, reBuildLogs) + if buildImageFunc != nil { + return buildImageFunc() + } + return nil + } + err = util.ExecuteWithStageInfoLogWithMetadata( + util.DOCKER_REBUILD, + dockerBuildStageMetadata, + rebuildImageStage, + ) + if err != nil && !errors.Is(err, BuilderPodDeletedError) { + return err + } else if errors.Is(err, BuilderPodDeletedError) { + // Log error message for builder pod interruption due to + util.LogError(BuilderPodDeletedError) + util.LogWarn("Frequent spot interruptions can lead to build failures.", + "Consider using a different node type or increasing the spot interruption tolerance.") + // if the builder pod is deleted, we will retry the build + return retryFunc.NewRetryableError(BuilderPodDeletedError) + } + return nil +} + +func (impl *DockerHelperImpl) buildImageStage(ciContext cicxt.CiContext, dockerBuild string, + useBuildxK8sDriver bool, k8sClient BuildxK8sInterface, buildLogs []any) func() error { + return func() error { + ctx, cancel := context.WithCancel(ciContext) + defer cancel() + errGroup, groupCtx := errgroup.WithContext(ctx) + errGroup.Go(func() error { + if useBuildxK8sDriver && k8sClient != nil { + if err := k8sClient.CatchBuilderPodLivenessError(groupCtx); err != nil { + cancel() // Cancel the context if there's an error in catching builder pod liveness + return err + } + } + return nil + }) + errGroup.Go(func() error { + if len(buildLogs) > 0 { + log.Println(buildLogs...) + } + err := impl.runDockerBuildCommand(cicxt.BuildCiContext(groupCtx, ciContext.EnableSecretMasking), dockerBuild) + if err != nil { + return err + } + cancel() // Cancel the context after the build is done + return nil + }) + if err := errGroup.Wait(); err != nil { + return err + } + return nil + } +} + func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (string, error) { ciContext := cicxt.BuildCiContext(context.Background(), ciRequest.EnableSecretMasking) envVars := &EnvironmentVariables{} @@ -337,7 +430,6 @@ func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (s } else { dockerBuild = dockerBuildxBuild + " " } - } dockerBuildFlags := getDockerBuildFlagsMap(dockerBuildConfig) for key, value := range dockerBuildFlags { @@ -350,7 +442,8 @@ func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (s dockerfilePath := getDockerfilePath(ciBuildConfig, ciRequest.CheckoutPath) var buildxExportCacheFunc func() error = nil - useBuildxK8sDriver, eligibleK8sDriverNodes := false, make([]map[string]string, 0) + useBuildxK8sDriver, eligibleK8sDriverNodes, deploymentNames := false, make([]map[string]string, 0), make([]string, 0) + var k8sClient BuildxK8sInterface if useBuildx { setupBuildxBuilder := func() error { err := impl.checkAndCreateDirectory(ciContext, util.LOCAL_BUILDX_LOCATION) @@ -360,11 +453,22 @@ func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (s } useBuildxK8sDriver, eligibleK8sDriverNodes = dockerBuildConfig.CheckForBuildXK8sDriver() if useBuildxK8sDriver { - err = impl.createBuildxBuilderWithK8sDriver(ciContext, ciRequest.PropagateLabelsInBuildxPod, ciRequest.DockerConnection, dockerBuildConfig.BuildxDriverImage, eligibleK8sDriverNodes, ciRequest.PipelineId, ciRequest.WorkflowId) + deploymentNames, err = impl.createBuildxBuilderWithK8sDriver(ciContext, ciRequest.PropagateLabelsInBuildxPod, ciRequest.DockerConnection, dockerBuildConfig.BuildxDriverImage, eligibleK8sDriverNodes, ciRequest.PipelineId, ciRequest.WorkflowId) if err != nil { log.Println(util.DEVTRON, " error in creating buildxDriver , err : ", err.Error()) return err } + k8sClient, err = newBuildxK8sClient(deploymentNames) + if err != nil { + log.Println(util.DEVTRON, " error in creating buildxK8sClient , err : ", err.Error()) + return err + } + k8sClient.PatchOwnerReferenceInBuilders() + err = k8sClient.RegisterBuilderPods(ciContext) + if err != nil { + log.Println(util.DEVTRON, " error in registering builder pods ", " err: ", err) + return err + } } else { err = impl.createBuildxBuilderForMultiArchBuild(ciContext, ciRequest.DockerConnection, dockerBuildConfig.BuildxDriverImage) if err != nil { @@ -405,22 +509,38 @@ func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (s } else { dockerBuild = fmt.Sprintf("%s -f %s --network host -t %s %s", dockerBuild, dockerfilePath, ciRequest.DockerRepository, dockerBuildConfig.BuildContext) } - - buildImageStage := func() error { - if envVars.ShowDockerBuildCmdInLogs { - log.Println("Starting docker build : ", dockerBuild) - } else { - log.Println("Docker build started..") + dockerBuildStageMetadata := bean2.DockerBuildStageMetadata{TargetPlatforms: utils.ConvertTargetPlatformStringToObject(ciBuildConfig.DockerBuildConfig.TargetPlatform)} + buildLogs := []any{"Docker build started..."} + if envVars.ShowDockerBuildCmdInLogs { + buildLogs = []any{"Starting docker build : ", dockerBuild} + } + err = util.ExecuteWithStageInfoLogWithMetadata( + util.DOCKER_BUILD, + dockerBuildStageMetadata, + impl.buildImageStage(ciContext, dockerBuild, useBuildxK8sDriver, k8sClient, buildLogs), + ) + if err != nil && !errors.Is(err, BuilderPodDeletedError) { + return "", err + } else if errors.Is(err, BuilderPodDeletedError) { + // Log error message for builder pod interruption due to + util.LogError(BuilderPodDeletedError) + util.LogWarn("Frequent spot interruptions can lead to build failures.\n", + "Consider using a different node type or increasing the spot interruption tolerance.\n") + maxRetry := ciRequest.BuildxInterruptionMaxRetry - 1 // -1 because we already tried once + callback := func(retriesLeft int) error { + attempt := maxRetry - retriesLeft + reBuildLogs := []any{fmt.Sprintf("Docker re build started (Attempt %d)...", attempt)} + if envVars.ShowDockerBuildCmdInLogs { + reBuildLogs = []any{fmt.Sprintf("Starting re docker build (Attempt %d) : ", attempt), dockerBuild} + } + return impl.executeDockerReBuild(ciContext, k8sClient, useBuildxK8sDriver, dockerBuild, + deploymentNames, dockerBuildStageMetadata, reBuildLogs) } - err = impl.executeCmd(ciContext, dockerBuild) + err = retryFunc.RetryWithOutLogging(callback, retryFunc.IsRetryableError, maxRetry, 1*time.Second) if err != nil { - return err + log.Println(util.DEVTRON, " error in executing docker re-build ", " err: ", err) + return "", err } - return nil - } - - if err = util.ExecuteWithStageInfoLogWithMetadata(util.DOCKER_BUILD, bean2.DockerBuildStageMetadata{TargetPlatforms: utils.ConvertTargetPlatformStringToObject(ciBuildConfig.DockerBuildConfig.TargetPlatform)}, buildImageStage); err != nil { - return "", err } if buildxExportCacheFunc != nil { @@ -493,6 +613,19 @@ func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (s return dest, nil } +func (impl *DockerHelperImpl) runDockerBuildCommand(ciContext cicxt.CiContext, dockerBuild string) error { + errChan := make(chan error) + go func() { + errChan <- impl.executeCmdWithCtx(ciContext, dockerBuild) + }() + select { + case <-ciContext.Done(): + return ciContext.Err() + case err := <-errChan: + return err + } +} + func getDockerBuildFlagsMap(dockerBuildConfig *DockerBuildConfig) map[string]string { dockerBuildFlags := make(map[string]string) dockerBuildArgsMap := dockerBuildConfig.Args @@ -730,9 +863,18 @@ func (impl *DockerHelperImpl) handleLanguageVersion(ciContext cicxt.CiContext, p } -func (impl *DockerHelperImpl) executeCmd(ciContext cicxt.CiContext, dockerBuild string) error { - dockerBuildCMD := impl.GetCommandToExecute(dockerBuild) - err := impl.cmdExecutor.RunCommand(ciContext, dockerBuildCMD) +func (impl *DockerHelperImpl) executeCmd(ciContext cicxt.CiContext, cmd string) error { + exeCmd := impl.GetCommandToExecute(cmd) + err := impl.cmdExecutor.RunCommand(ciContext, exeCmd) + if err != nil { + log.Println(err) + } + return err +} + +func (impl *DockerHelperImpl) executeCmdWithCtx(ciContext cicxt.CiContext, cmd string) error { + exeCmd := impl.GetCommandToExecute(cmd) + err := impl.cmdExecutor.RunCommandWithCtx(ciContext, exeCmd) if err != nil { log.Println(err) } @@ -955,16 +1097,16 @@ func (impl *DockerHelperImpl) createBuildxBuilderForMultiArchBuild(ciContext cic return nil } -func (impl *DockerHelperImpl) createBuildxBuilderWithK8sDriver(ciContext cicxt.CiContext, propagateLabelsInBuildxPod bool, dockerConnection, buildxDriverImage string, builderNodes []map[string]string, ciPipelineId, ciWorkflowId int) error { +func (impl *DockerHelperImpl) createBuildxBuilderWithK8sDriver(ciContext cicxt.CiContext, propagateLabelsInBuildxPod bool, dockerConnection, buildxDriverImage string, builderNodes []map[string]string, ciPipelineId, ciWorkflowId int) ([]string, error) { + deploymentNames := make([]string, 0) if len(builderNodes) == 0 { - return errors.New("atleast one node is expected for builder with kubernetes driver") + return deploymentNames, errors.New("atleast one node is expected for builder with kubernetes driver") } - deploymentNames := make([]string, 0) for i := 0; i < len(builderNodes); i++ { nodeOpts := builderNodes[i] builderCmd, deploymentName, err := getBuildxK8sDriverCmd(propagateLabelsInBuildxPod, dockerConnection, buildxDriverImage, nodeOpts, ciPipelineId, ciWorkflowId) if err != nil { - return err + return deploymentNames, err } deploymentNames = append(deploymentNames, deploymentName) // first node is used as default node, we create builder with --use flag, then we append other nodes @@ -979,13 +1121,11 @@ func (impl *DockerHelperImpl) createBuildxBuilderWithK8sDriver(ciContext cicxt.C builderExecCmd := impl.GetCommandToExecute(builderCmd) err = impl.cmdExecutor.RunCommand(ciContext, builderExecCmd) if err != nil { - fmt.Println(util.DEVTRON, " builderCmd : ", builderCmd, " err : ", err, " error : ") - return err + fmt.Println(util.DEVTRON, " builderCmd : ", builderCmd, " err : ", err) + return deploymentNames, err } } - - patchK8sDriverNodes(deploymentNames) - return nil + return deploymentNames, nil } func (impl *DockerHelperImpl) CleanBuildxK8sDriver(ciContext cicxt.CiContext, nodes []map[string]string) error { @@ -1302,58 +1442,3 @@ func (impl *DockerHelperImpl) GetDockerAuthConfigForPrivateRegistries(workflowRe } return dockerAuthConfig } - -func patchK8sDriverNodes(deploymentNames []string) { - for _, deploymentName := range deploymentNames { - if err := jsonPatchOwnerReferenceInDeployment(deploymentName); err != nil { - fmt.Println(util.DEVTRON, "failed to patch the buildkit deployment's owner reference, ", " deployment: ", deploymentName, " err: ", err) - } else { - fmt.Println(util.DEVTRON, "successfully patched the buildkit deployment's owner reference, ", " deployment: ", deploymentName) - } - } -} - -func jsonPatchOwnerReferenceInDeployment(deploymentName string) error { - - clientSet, err := GetK8sInClusterClientSet() - if err != nil { - fmt.Println(util.DEVTRON, "error in getting k8s clientset", "err", err) - return err - } - - patchStr := fmt.Sprintf(`{"metadata":{"ownerReferences":[{"apiVersion":"v1","kind":"Pod","name":"%s","uid":"%s"}]}}`, utils.GetSelfK8sPodName(), utils.GetSelfK8sUID()) - - // Apply the patch directly - // the namespace is hardcoded to devtron-ci as our k8s driver is only supported for ci's running in devtron-ci namespace. - _, err = clientSet.Deployments("devtron-ci").Patch( - context.TODO(), - deploymentName, - types.StrategicMergePatchType, - []byte(patchStr), - v1.PatchOptions{FieldManager: "patch"}, - ) - if err != nil { - return err - } - return nil -} - -func GetK8sInClusterClientSet() (*appsV1.AppsV1Client, error) { - restConfig, err := rest.InClusterConfig() - if err != nil { - return nil, err - } - - k8sHttpClient, err := rest.HTTPClientFor(restConfig) - if err != nil { - fmt.Println("error occurred while overriding k8s client", "reason", err) - return nil, err - } - - k8sClientSet, err := appsV1.NewForConfigAndClient(restConfig, k8sHttpClient) - if err != nil { - return nil, err - } - - return k8sClientSet, nil -} diff --git a/ci-runner/helper/DockerHelper_test.go b/ci-runner/helper/DockerHelper_test.go index 965706341..8e150719f 100644 --- a/ci-runner/helper/DockerHelper_test.go +++ b/ci-runner/helper/DockerHelper_test.go @@ -41,7 +41,7 @@ func TestCreateBuildXK8sDriver(t *testing.T) { eligibleK8sNodes := dockerBuildConfig.GetEligibleK8sDriverNodes() impl := getDockerHelperImpl() ciContext := cicxt.BuildCiContext(context.Background(), true) - err := impl.createBuildxBuilderWithK8sDriver(ciContext, false, "", "", eligibleK8sNodes, 1, 1) + _, err := impl.createBuildxBuilderWithK8sDriver(ciContext, false, "", "", eligibleK8sNodes, 1, 1) t.Cleanup(func() { buildxDelete := fmt.Sprintf("docker buildx rm %s", BUILDX_K8S_DRIVER_NAME) builderRemoveCmd := exec.Command("/bin/sh", "-c", buildxDelete) @@ -64,7 +64,7 @@ func TestCleanBuildxK8sDriver(t *testing.T) { eligibleK8sNodes := dockerBuildConfig.GetEligibleK8sDriverNodes() impl := getDockerHelperImpl() ciContext := cicxt.BuildCiContext(context.Background(), true) - err := impl.createBuildxBuilderWithK8sDriver(ciContext, false, "", "", eligibleK8sNodes, 1, 1) + _, err := impl.createBuildxBuilderWithK8sDriver(ciContext, false, "", "", eligibleK8sNodes, 1, 1) if err != nil { fmt.Println(err.Error()) t.Fail() diff --git a/ci-runner/helper/EventHelper.go b/ci-runner/helper/EventHelper.go index f8ebce402..69d4c7b15 100644 --- a/ci-runner/helper/EventHelper.go +++ b/ci-runner/helper/EventHelper.go @@ -195,6 +195,7 @@ type CommonWorkflowRequest struct { IntermediateDockerRegistryUrl string `json:"-"` // this URL will be used for all operations and can be mutated BuildxCacheModeMin bool `json:"buildxCacheModeMin"` AsyncBuildxCacheExport bool `json:"asyncBuildxCacheExport"` + BuildxInterruptionMaxRetry int `json:"buildxInterruptionMaxRetry"` UseDockerApiToGetDigest bool `json:"useDockerApiToGetDigest"` HostUrl string `json:"hostUrl"` ImageScanningSteps []*ImageScanningSteps `json:"imageScanningSteps,omitempty"` diff --git a/ci-runner/helper/buildxK8sClient.go b/ci-runner/helper/buildxK8sClient.go new file mode 100644 index 000000000..9c36cc3e1 --- /dev/null +++ b/ci-runner/helper/buildxK8sClient.go @@ -0,0 +1,266 @@ +package helper + +import ( + "context" + "fmt" + "github.com/devtron-labs/ci-runner/util" + "github.com/devtron-labs/common-lib/utils" + corev1 "k8s.io/api/core/v1" + k8sError "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + appsV1 "k8s.io/client-go/kubernetes/typed/apps/v1" + clientcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" + "k8s.io/client-go/rest" + "k8s.io/utils/ptr" + "log" + "net/http" + "slices" + "time" +) + +type BuildxK8sInterface interface { + PatchOwnerReferenceInBuilders() + RegisterBuilderPods(ctx context.Context) error + RestartBuilders(ctx context.Context) error + CatchBuilderPodLivenessError(ctx context.Context) error + WaitUntilBuilderPodLive(ctx context.Context, done chan<- bool) +} + +type buildxK8sClient struct { + restConfig *rest.Config + httpClient *http.Client + appV1Client *appsV1.AppsV1Client + coreV1Client *clientcorev1.CoreV1Client + namespace string + deployments map[string][]podStatus +} + +type podStatus struct { + name string + phase corev1.PodPhase + err error +} + +func newBuildxK8sClient(deploymentNames []string) (*buildxK8sClient, error) { + restConfig, err := rest.InClusterConfig() + if err != nil { + return nil, err + } + k8sHttpClient, err := rest.HTTPClientFor(restConfig) + if err != nil { + return nil, err + } + appV1ClientSet, err := appsV1.NewForConfigAndClient(restConfig, k8sHttpClient) + if err != nil { + return nil, err + } + coreV1ClientSet, err := clientcorev1.NewForConfigAndClient(restConfig, k8sHttpClient) + if err != nil { + return nil, err + } + deployments := make(map[string][]podStatus) + for _, deploymentName := range deploymentNames { + deployments[deploymentName] = make([]podStatus, 0) + } + return &buildxK8sClient{ + restConfig: restConfig, + httpClient: k8sHttpClient, + appV1Client: appV1ClientSet, + coreV1Client: coreV1ClientSet, + namespace: "devtron-ci", + deployments: deployments, + }, nil +} + +func (k8s *buildxK8sClient) PatchOwnerReferenceInBuilders() { + if k8s == nil { + return + } + for deploymentName := range k8s.deployments { + if err := k8s.jsonPatchOwnerReferenceInDeployment(deploymentName); err != nil { + log.Println(util.DEVTRON, "failed to patch the buildkit deployment's owner reference, ", " deployment: ", deploymentName, " err: ", err) + } else { + log.Println(util.DEVTRON, "successfully patched the buildkit deployment's owner reference, ", " deployment: ", deploymentName) + } + } +} + +func (k8s *buildxK8sClient) CatchBuilderPodLivenessError(ctx context.Context) error { + if k8s == nil { + return nil + } + for { + err := k8s.builderLivenessDialer(ctx) + if err != nil && ctx.Err() == nil { + return err + } + select { + case <-ctx.Done(): + log.Println(util.DEVTRON, "context done, exiting builder pod liveness check") + return nil + default: + log.Println(util.DEVTRON, "sleeping for 10 seconds before next builder pod liveness check") + // Sleep for 10 seconds + <-time.After(10 * time.Second) + } + } +} + +func (k8s *buildxK8sClient) WaitUntilBuilderPodLive(ctx context.Context, done chan<- bool) { + if k8s == nil { + return + } + for { + if err := k8s.builderLivenessDialer(ctx); err == nil { + done <- true + return + } + select { + case <-ctx.Done(): + log.Println(util.DEVTRON, "context done, exiting builder pod liveness check") + return + default: + log.Println(util.DEVTRON, "sleeping for 10 seconds before next builder pod liveness check") + // Sleep for 10 seconds + <-time.After(10 * time.Second) + } + } +} + +func (k8s *buildxK8sClient) RegisterBuilderPods(ctx context.Context) error { + if k8s == nil { + return nil + } + for deploymentName := range k8s.deployments { + pods, err := k8s.getBuilderPods(ctx, deploymentName) + if err != nil { + log.Println(util.DEVTRON, fmt.Sprintf("error while getting builder pods for deployment: %q, err: %v", deploymentName, err)) + return err + } + k8s.deployments[deploymentName] = pods + log.Println(util.DEVTRON, fmt.Sprintf("registered builder pods for deployment: %q", deploymentName)) + } + return nil +} + +func (k8s *buildxK8sClient) RestartBuilders(ctx context.Context) error { + for _, pods := range k8s.deployments { + if err := k8s.rotateBuilders(ctx, pods); err != nil { + return err + } + } + return nil +} + +func (k8s *buildxK8sClient) jsonPatchOwnerReferenceInDeployment(deploymentName string) error { + patchStr := fmt.Sprintf(`{"metadata":{"ownerReferences":[{"apiVersion":"v1","kind":"Pod","name":"%s","uid":"%s"}]}}`, utils.GetSelfK8sPodName(), utils.GetSelfK8sUID()) + // Apply the patch directly + // the namespace is hardcoded to devtron-ci as our k8s driver is only supported for ci's running in devtron-ci namespace. + _, err := k8s.appV1Client.Deployments(k8s.namespace). + Patch( + context.TODO(), + deploymentName, + types.StrategicMergePatchType, + []byte(patchStr), + metav1.PatchOptions{FieldManager: "patch"}, + ) + if err != nil { + return err + } + return nil +} + +func (k8s *buildxK8sClient) builderLivenessDialer(ctx context.Context) error { + for deployment, pods := range k8s.deployments { + updatedPods := k8s.getLivePodStatus(ctx, pods) + k8s.deployments[deployment] = updatedPods + } + for deployment, pods := range k8s.deployments { + if !slices.ContainsFunc(pods, func(pod podStatus) bool { + return pod.phase == corev1.PodRunning && pod.err == nil + }) { + log.Println(util.DEVTRON, fmt.Sprintf("builder pod liveness check failed for deployment: %q", deployment)) + return BuilderPodDeletedError + } + } + log.Println(util.DEVTRON, "builder pod liveness check passed") + return nil +} + +func (k8s *buildxK8sClient) rotateBuilders(ctx context.Context, pods []podStatus) error { + deleteOptions := metav1.DeleteOptions{} + deleteOptions.GracePeriodSeconds = ptr.To(int64(0)) + for _, pod := range pods { + if pod.phase == corev1.PodRunning || pod.err == nil { + err := k8s.coreV1Client.Pods(k8s.namespace).Delete(ctx, pod.name, deleteOptions) + if err != nil && !k8sError.IsNotFound(err) { + log.Println(util.DEVTRON, fmt.Sprintf("error while deleting pod: %q, err: %v", pod.name, err)) + return err + } + } + } + return nil +} + +func (k8s *buildxK8sClient) getLivePodStatus(ctx context.Context, pods []podStatus) []podStatus { + updatedPods := make([]podStatus, 0, len(pods)) + for _, pod := range pods { + updatedPod := podStatus{ + name: pod.name, + } + podPhase, err := k8s.getBuilderPhase(ctx, pod.name) + updatedPod.phase = podPhase + if err != nil && !k8sError.IsNotFound(err) { + log.Println(util.DEVTRON, fmt.Sprintf("error while verifying running builders for pod: %q, err: %v", pod.name, err)) + updatedPod.err = err + } else if k8sError.IsNotFound(err) || podPhase != corev1.PodRunning { + log.Println(util.DEVTRON, fmt.Sprintf("builder pod liveness failed for pod: %q, phase: %q", pod.name, podPhase)) + updatedPod.err = BuilderPodDeletedError + } + updatedPods = append(updatedPods, updatedPod) + } + return updatedPods +} + +func (k8s *buildxK8sClient) getBuilderPhase(ctx context.Context, podName string) (corev1.PodPhase, error) { + pod, err := k8s.coreV1Client.Pods("devtron-ci").Get(ctx, podName, metav1.GetOptions{}) + if err != nil { + return corev1.PodUnknown, err + } + return pod.Status.Phase, err +} + +func (k8s *buildxK8sClient) getBuilderPods(ctx context.Context, deploymentName string) ([]podStatus, error) { + deploy, err := k8s.appV1Client.Deployments("devtron-ci").Get(ctx, deploymentName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + selector, err := metav1.LabelSelectorAsSelector(deploy.Spec.Selector) + if err != nil { + return nil, err + } + listOpts := metav1.ListOptions{ + LabelSelector: selector.String(), + } + podList, err := k8s.coreV1Client.Pods(k8s.namespace).List(ctx, listOpts) + if err != nil { + return nil, err + } + podNames := make([]podStatus, 0, len(podList.Items)) + for i := range podList.Items { + pod := &podList.Items[i] + if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed || + pod.DeletionTimestamp != nil { + log.Println(util.DEVTRON, fmt.Sprintf("ignoring pod %q as it is not in running state, phase: %q", pod.Name, pod.Status.Phase)) + continue + } + // register the running pod only + log.Println(util.DEVTRON, fmt.Sprintf("found running pod %q for deployment %q, phase: %q", pod.Name, deploymentName, pod.Status.Phase)) + podNames = append(podNames, podStatus{ + name: pod.Name, + phase: pod.Status.Phase, + }) + } + return podNames, err +} diff --git a/ci-runner/util/Util.go b/ci-runner/util/Util.go index 95603e8e1..696844b27 100644 --- a/ci-runner/util/Util.go +++ b/ci-runner/util/Util.go @@ -50,6 +50,7 @@ const ( DOCKER_LOGIN_STAGE = "Docker Login" DOCKER_PUSH = "Docker Push" DOCKER_BUILD = "Docker Build" + DOCKER_REBUILD = "Docker Re-Build" DOCKER_STOP = "Docker Stop" BUILD_ARTIFACT = "Build Artifact" UPLOAD_ARTIFACT = "Uploading Artifact" @@ -298,3 +299,46 @@ func PrintFileContent(filePath string) { // Print the file content log.Println(util.DEVTRON, string(content)) } + +const ( + ColorGreen = "\033[32m" + ColorYellow = "\033[33m" + ColorRed = "\033[31m" + ColorReset = "\033[0m" // Resets color to default +) + +func LogError(msg ...any) { + if len(msg) == 0 { + return + } + message := []any{"ERROR:", ColorRed} + message = append(message, msg...) + message = append(message, ColorReset) + log.SetFlags(0) + log.Println(message...) + log.SetFlags(log.Ldate | log.Ltime) +} + +func LogWarn(msg ...any) { + if len(msg) == 0 { + return + } + message := []any{"WARNING:", ColorYellow} + message = append(message, msg...) + message = append(message, ColorReset) + log.SetFlags(0) + log.Println(message...) + log.SetFlags(log.Ldate | log.Ltime) +} + +func LogInfo(msg ...any) { + if len(msg) == 0 { + return + } + message := []any{"INFO:", ColorGreen} + message = append(message, msg...) + message = append(message, ColorReset) + log.SetFlags(0) + log.Println(message...) + log.SetFlags(log.Ldate | log.Ltime) +} diff --git a/ci-runner/vendor/github.com/devtron-labs/common-lib/utils/retryFunc/RetryFunction.go b/ci-runner/vendor/github.com/devtron-labs/common-lib/utils/retryFunc/RetryFunction.go new file mode 100644 index 000000000..7a4e9df35 --- /dev/null +++ b/ci-runner/vendor/github.com/devtron-labs/common-lib/utils/retryFunc/RetryFunction.go @@ -0,0 +1,94 @@ +/* + * 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 retryFunc + +import ( + "errors" + "fmt" + "github.com/devtron-labs/common-lib/utils/runTime" + "go.uber.org/zap" + "time" +) + +// Retry performs a function with retries, delay, and a max number of attempts. +func Retry(fn func(retriesLeft int) error, shouldRetry func(err error) bool, maxRetries int, delay time.Duration, logger *zap.SugaredLogger) error { + return retry(fn, shouldRetry, maxRetries, delay, logger) +} + +// RetryWithOutLogging performs a function with retries, delay, and a max number of attempts without logging. +func RetryWithOutLogging(fn func(retriesLeft int) error, shouldRetry func(err error) bool, maxRetries int, delay time.Duration) error { + return retry(fn, shouldRetry, maxRetries, delay, nil) +} + +func retry(fn func(retriesLeft int) error, shouldRetry func(err error) bool, maxRetries int, delay time.Duration, logger *zap.SugaredLogger) error { + var err error + if logger != nil { + logger.Debugw("retrying function", + "maxRetries", maxRetries, "delay", delay, + "callerFunc", runTime.GetCallerFunctionName(), + "path", fmt.Sprintf("%s:%d", runTime.GetCallerFileName(), runTime.GetCallerLineNumber())) + } + for i := 0; i < maxRetries; i++ { + if logger != nil { + logger.Debugw("function called with retry", "attempt", i+1, "maxRetries", maxRetries, "delay", delay) + } + err = fn(maxRetries - (i + 1)) + if err == nil { + return nil + } + if !shouldRetry(err) { + return sanitiseError(err) + } + if logger != nil { + logger.Infow(fmt.Sprintf("Attempt %d failed, retrying in %v", i+1, delay), "err", err) + } + time.Sleep(delay) + } + return fmt.Errorf("after %d attempts, last error: %s", maxRetries, err) +} + +// RetryableError is the error returned by callback function under Retry. +// for RetryableError errors can be handled by shouldRetry func +type RetryableError struct { + err error +} + +func NewRetryableError(err error) *RetryableError { + return &RetryableError{ + err: err, + } +} + +// IsRetryableError checks if the error is a RetryableError. +func IsRetryableError(err error) bool { + if err == nil { + return false + } + var retryErr *RetryableError + return errors.As(err, &retryErr) +} + +func (r *RetryableError) Error() string { return r.err.Error() } + +func (r *RetryableError) GetError() error { return r.err } + +func sanitiseError(err error) error { + if retryErr := (&RetryableError{}); errors.As(err, &retryErr) { + return retryErr.GetError() + } + return err +} diff --git a/ci-runner/vendor/github.com/devtron-labs/common-lib/utils/runTime/GetCallerFrames.go b/ci-runner/vendor/github.com/devtron-labs/common-lib/utils/runTime/GetCallerFrames.go new file mode 100644 index 000000000..ff54cba4a --- /dev/null +++ b/ci-runner/vendor/github.com/devtron-labs/common-lib/utils/runTime/GetCallerFrames.go @@ -0,0 +1,50 @@ +package runTime + +import ( + "runtime" +) + +// GetCallerFileName - returns the file name of the invoked func +func GetCallerFileName() string { + // Skip GetCurrentFunctionName + return getFrame(1).File +} + +// GetCallerLineNumber - returns the line number of the invoked func +func GetCallerLineNumber() int { + // Skip GetCurrentFunctionName + return getFrame(1).Line +} + +// GetCallerFunctionName - returns the function name of the invoked func +func GetCallerFunctionName() string { + // Skip GetCallerFunctionName and the function to get the caller of + return getFrame(2).Function +} + +// getFrame returns the runtime.Frame for the targetFrameIndex from the runtime caller stack +// +// examples: +// 1. getFrame(0) -> returns current method frame +// 2. getFrame(1) -> returns caller method frame +// 3. getFrame(2) -> returns caller's caller method frame +func getFrame(targetFrameIndex int) runtime.Frame { + // Set size to targetFrameIndex + 2 to ensure we have room for function runtime.Callers and getFrame + programCounters := make([]uintptr, targetFrameIndex+2) + // We need the frame at index targetFrameIndex + 2, since we never want function runtime.Callers and getFrame + n := runtime.Callers(2, programCounters) + + frame := runtime.Frame{Function: "unknown"} + if n > 0 { + frames := runtime.CallersFrames(programCounters[:n]) + for more, frameIndex := true, 0; more && frameIndex <= targetFrameIndex; frameIndex++ { + var frameCandidate runtime.Frame + frameCandidate, more = frames.Next() + if frameIndex == targetFrameIndex { + frame = frameCandidate + } + } + } + + return frame +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go new file mode 100644 index 000000000..b8e58cd15 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ComponentStatusesGetter has a method to return a ComponentStatusInterface. +// A group's client should implement this interface. +type ComponentStatusesGetter interface { + ComponentStatuses() ComponentStatusInterface +} + +// ComponentStatusInterface has methods to work with ComponentStatus resources. +type ComponentStatusInterface interface { + Create(ctx context.Context, componentStatus *corev1.ComponentStatus, opts metav1.CreateOptions) (*corev1.ComponentStatus, error) + Update(ctx context.Context, componentStatus *corev1.ComponentStatus, opts metav1.UpdateOptions) (*corev1.ComponentStatus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ComponentStatus, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ComponentStatusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ComponentStatus, err error) + Apply(ctx context.Context, componentStatus *applyconfigurationscorev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ComponentStatus, err error) + ComponentStatusExpansion +} + +// componentStatuses implements ComponentStatusInterface +type componentStatuses struct { + *gentype.ClientWithListAndApply[*corev1.ComponentStatus, *corev1.ComponentStatusList, *applyconfigurationscorev1.ComponentStatusApplyConfiguration] +} + +// newComponentStatuses returns a ComponentStatuses +func newComponentStatuses(c *CoreV1Client) *componentStatuses { + return &componentStatuses{ + gentype.NewClientWithListAndApply[*corev1.ComponentStatus, *corev1.ComponentStatusList, *applyconfigurationscorev1.ComponentStatusApplyConfiguration]( + "componentstatuses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *corev1.ComponentStatus { return &corev1.ComponentStatus{} }, + func() *corev1.ComponentStatusList { return &corev1.ComponentStatusList{} }, + gentype.PrefersProtobuf[*corev1.ComponentStatus](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go new file mode 100644 index 000000000..74d321193 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ConfigMapsGetter has a method to return a ConfigMapInterface. +// A group's client should implement this interface. +type ConfigMapsGetter interface { + ConfigMaps(namespace string) ConfigMapInterface +} + +// ConfigMapInterface has methods to work with ConfigMap resources. +type ConfigMapInterface interface { + Create(ctx context.Context, configMap *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error) + Update(ctx context.Context, configMap *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ConfigMap, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ConfigMapList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ConfigMap, err error) + Apply(ctx context.Context, configMap *applyconfigurationscorev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ConfigMap, err error) + ConfigMapExpansion +} + +// configMaps implements ConfigMapInterface +type configMaps struct { + *gentype.ClientWithListAndApply[*corev1.ConfigMap, *corev1.ConfigMapList, *applyconfigurationscorev1.ConfigMapApplyConfiguration] +} + +// newConfigMaps returns a ConfigMaps +func newConfigMaps(c *CoreV1Client, namespace string) *configMaps { + return &configMaps{ + gentype.NewClientWithListAndApply[*corev1.ConfigMap, *corev1.ConfigMapList, *applyconfigurationscorev1.ConfigMapApplyConfiguration]( + "configmaps", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.ConfigMap { return &corev1.ConfigMap{} }, + func() *corev1.ConfigMapList { return &corev1.ConfigMapList{} }, + gentype.PrefersProtobuf[*corev1.ConfigMap](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go new file mode 100644 index 000000000..0a9380cf8 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go @@ -0,0 +1,176 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + http "net/http" + + corev1 "k8s.io/api/core/v1" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type CoreV1Interface interface { + RESTClient() rest.Interface + ComponentStatusesGetter + ConfigMapsGetter + EndpointsGetter + EventsGetter + LimitRangesGetter + NamespacesGetter + NodesGetter + PersistentVolumesGetter + PersistentVolumeClaimsGetter + PodsGetter + PodTemplatesGetter + ReplicationControllersGetter + ResourceQuotasGetter + SecretsGetter + ServicesGetter + ServiceAccountsGetter +} + +// CoreV1Client is used to interact with features provided by the group. +type CoreV1Client struct { + restClient rest.Interface +} + +func (c *CoreV1Client) ComponentStatuses() ComponentStatusInterface { + return newComponentStatuses(c) +} + +func (c *CoreV1Client) ConfigMaps(namespace string) ConfigMapInterface { + return newConfigMaps(c, namespace) +} + +func (c *CoreV1Client) Endpoints(namespace string) EndpointsInterface { + return newEndpoints(c, namespace) +} + +func (c *CoreV1Client) Events(namespace string) EventInterface { + return newEvents(c, namespace) +} + +func (c *CoreV1Client) LimitRanges(namespace string) LimitRangeInterface { + return newLimitRanges(c, namespace) +} + +func (c *CoreV1Client) Namespaces() NamespaceInterface { + return newNamespaces(c) +} + +func (c *CoreV1Client) Nodes() NodeInterface { + return newNodes(c) +} + +func (c *CoreV1Client) PersistentVolumes() PersistentVolumeInterface { + return newPersistentVolumes(c) +} + +func (c *CoreV1Client) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface { + return newPersistentVolumeClaims(c, namespace) +} + +func (c *CoreV1Client) Pods(namespace string) PodInterface { + return newPods(c, namespace) +} + +func (c *CoreV1Client) PodTemplates(namespace string) PodTemplateInterface { + return newPodTemplates(c, namespace) +} + +func (c *CoreV1Client) ReplicationControllers(namespace string) ReplicationControllerInterface { + return newReplicationControllers(c, namespace) +} + +func (c *CoreV1Client) ResourceQuotas(namespace string) ResourceQuotaInterface { + return newResourceQuotas(c, namespace) +} + +func (c *CoreV1Client) Secrets(namespace string) SecretInterface { + return newSecrets(c, namespace) +} + +func (c *CoreV1Client) Services(namespace string) ServiceInterface { + return newServices(c, namespace) +} + +func (c *CoreV1Client) ServiceAccounts(namespace string) ServiceAccountInterface { + return newServiceAccounts(c, namespace) +} + +// NewForConfig creates a new CoreV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*CoreV1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new CoreV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoreV1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &CoreV1Client{client}, nil +} + +// NewForConfigOrDie creates a new CoreV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *CoreV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new CoreV1Client for the given RESTClient. +func New(c rest.Interface) *CoreV1Client { + return &CoreV1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := corev1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/api" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *CoreV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go new file mode 100644 index 000000000..3af5d054f --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go new file mode 100644 index 000000000..b96a8b385 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// EndpointsGetter has a method to return a EndpointsInterface. +// A group's client should implement this interface. +type EndpointsGetter interface { + Endpoints(namespace string) EndpointsInterface +} + +// EndpointsInterface has methods to work with Endpoints resources. +type EndpointsInterface interface { + Create(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.CreateOptions) (*corev1.Endpoints, error) + Update(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.UpdateOptions) (*corev1.Endpoints, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Endpoints, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.EndpointsList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Endpoints, err error) + Apply(ctx context.Context, endpoints *applyconfigurationscorev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Endpoints, err error) + EndpointsExpansion +} + +// endpoints implements EndpointsInterface +type endpoints struct { + *gentype.ClientWithListAndApply[*corev1.Endpoints, *corev1.EndpointsList, *applyconfigurationscorev1.EndpointsApplyConfiguration] +} + +// newEndpoints returns a Endpoints +func newEndpoints(c *CoreV1Client, namespace string) *endpoints { + return &endpoints{ + gentype.NewClientWithListAndApply[*corev1.Endpoints, *corev1.EndpointsList, *applyconfigurationscorev1.EndpointsApplyConfiguration]( + "endpoints", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.Endpoints { return &corev1.Endpoints{} }, + func() *corev1.EndpointsList { return &corev1.EndpointsList{} }, + gentype.PrefersProtobuf[*corev1.Endpoints](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go new file mode 100644 index 000000000..dd0cc80b8 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// EventsGetter has a method to return a EventInterface. +// A group's client should implement this interface. +type EventsGetter interface { + Events(namespace string) EventInterface +} + +// EventInterface has methods to work with Event resources. +type EventInterface interface { + Create(ctx context.Context, event *corev1.Event, opts metav1.CreateOptions) (*corev1.Event, error) + Update(ctx context.Context, event *corev1.Event, opts metav1.UpdateOptions) (*corev1.Event, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Event, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.EventList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Event, err error) + Apply(ctx context.Context, event *applyconfigurationscorev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Event, err error) + EventExpansion +} + +// events implements EventInterface +type events struct { + *gentype.ClientWithListAndApply[*corev1.Event, *corev1.EventList, *applyconfigurationscorev1.EventApplyConfiguration] +} + +// newEvents returns a Events +func newEvents(c *CoreV1Client, namespace string) *events { + return &events{ + gentype.NewClientWithListAndApply[*corev1.Event, *corev1.EventList, *applyconfigurationscorev1.EventApplyConfiguration]( + "events", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.Event { return &corev1.Event{} }, + func() *corev1.EventList { return &corev1.EventList{} }, + gentype.PrefersProtobuf[*corev1.Event](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go new file mode 100644 index 000000000..ddecf93b1 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go @@ -0,0 +1,226 @@ +/* +Copyright 2016 The Kubernetes Authors. + +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 v1 + +import ( + "context" + "fmt" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + ref "k8s.io/client-go/tools/reference" +) + +// The EventExpansion interface allows manually adding extra methods to the EventInterface. +type EventExpansion interface { + // CreateWithEventNamespace is the same as a Create, except that it sends the request to the event.Namespace. + // + // Deprecated: use CreateWithEventNamespaceWithContext instead. + CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) + // UpdateWithEventNamespace is the same as a Update, except that it sends the request to the event.Namespace. + // + // Deprecated: use UpdateWithEventNamespaceWithContext instead. + UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) + // PatchWithEventNamespace is the same as a Patch, except that it sends the request to the event.Namespace. + // + // Deprecated: use PatchWithEventNamespaceWithContext instead. + PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) + // Search finds events about the specified object + // + // Deprecated: use SearchWithContext instead. + Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) + // CreateWithEventNamespaceWithContext is the same as a Create, except that it sends the request to the event.Namespace. + CreateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) + // UpdateWithEventNamespaceWithContext is the same as a Update, except that it sends the request to the event.Namespace. + UpdateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) + // PatchWithEventNamespaceWithContext is the same as a Patch, except that it sends the request to the event.Namespace. + PatchWithEventNamespaceWithContext(ctx context.Context, event *v1.Event, data []byte) (*v1.Event, error) + // SearchWithContext finds events about the specified object + SearchWithContext(ctx context.Context, scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) + // Returns the appropriate field selector based on the API version being used to communicate with the server. + // The returned field selector can be used with List and Watch to filter desired events. + GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector +} + +// CreateWithEventNamespace makes a new event. Returns the copy of the event the server returns, +// or an error. The namespace to create the event within is deduced from the +// event; it must either match this event client's namespace, or this event +// client must have been created with the "" namespace. +// +// Deprecated: use CreateWithEventNamespaceWithContext instead. +func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { + return e.CreateWithEventNamespaceWithContext(context.Background(), event) +} + +// CreateWithEventNamespaceWithContext makes a new event. Returns the copy of the event the server returns, +// or an error. The namespace to create the event within is deduced from the +// event; it must either match this event client's namespace, or this event +// client must have been created with the "" namespace. +func (e *events) CreateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) { + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) + } + result := &v1.Event{} + err := e.GetClient().Post(). + NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). + Resource("events"). + Body(event). + Do(ctx). + Into(result) + return result, err +} + +// UpdateWithEventNamespace modifies an existing event. It returns the copy of the event that the server returns, +// or an error. The namespace and key to update the event within is deduced from the event. The +// namespace must either match this event client's namespace, or this event client must have been +// created with the "" namespace. Update also requires the ResourceVersion to be set in the event +// object. +// +// Deprecated: use UpdateWithEventNamespaceWithContext instead. +func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { + return e.UpdateWithEventNamespaceWithContext(context.Background(), event) +} + +// UpdateWithEventNamespaceWithContext modifies an existing event. It returns the copy of the event that the server returns, +// or an error. The namespace and key to update the event within is deduced from the event. The +// namespace must either match this event client's namespace, or this event client must have been +// created with the "" namespace. Update also requires the ResourceVersion to be set in the event +// object. +func (e *events) UpdateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) { + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) + } + result := &v1.Event{} + err := e.GetClient().Put(). + NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). + Resource("events"). + Name(event.Name). + Body(event). + Do(ctx). + Into(result) + return result, err +} + +// PatchWithEventNamespace modifies an existing event. It returns the copy of +// the event that the server returns, or an error. The namespace and name of the +// target event is deduced from the incompleteEvent. The namespace must either +// match this event client's namespace, or this event client must have been +// created with the "" namespace. +// +// Deprecated: use PatchWithEventNamespaceWithContext instead. +func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) (*v1.Event, error) { + return e.PatchWithEventNamespaceWithContext(context.Background(), incompleteEvent, data) +} + +// PatchWithEventNamespaceWithContext modifies an existing event. It returns the copy of +// the event that the server returns, or an error. The namespace and name of the +// target event is deduced from the incompleteEvent. The namespace must either +// match this event client's namespace, or this event client must have been +// created with the "" namespace. +func (e *events) PatchWithEventNamespaceWithContext(ctx context.Context, incompleteEvent *v1.Event, data []byte) (*v1.Event, error) { + if e.GetNamespace() != "" && incompleteEvent.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.GetNamespace()) + } + result := &v1.Event{} + err := e.GetClient().Patch(types.StrategicMergePatchType). + NamespaceIfScoped(incompleteEvent.Namespace, len(incompleteEvent.Namespace) > 0). + Resource("events"). + Name(incompleteEvent.Name). + Body(data). + Do(ctx). + Into(result) + return result, err +} + +// Search finds events about the specified object. The namespace of the +// object must match this event's client namespace unless the event client +// was made with the "" namespace. +// +// Deprecated: use SearchWithContext instead. +func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { + return e.SearchWithContext(context.Background(), scheme, objOrRef) +} + +// SearchWithContext finds events about the specified object. The namespace of the +// object must match this event's client namespace unless the event client +// was made with the "" namespace. +func (e *events) SearchWithContext(ctx context.Context, scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { + ref, err := ref.GetReference(scheme, objOrRef) + if err != nil { + return nil, err + } + if len(e.GetNamespace()) > 0 && ref.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, e.GetNamespace()) + } + stringRefKind := string(ref.Kind) + var refKind *string + if len(stringRefKind) > 0 { + refKind = &stringRefKind + } + stringRefUID := string(ref.UID) + var refUID *string + if len(stringRefUID) > 0 { + refUID = &stringRefUID + } + fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) + return e.List(ctx, metav1.ListOptions{FieldSelector: fieldSelector.String()}) +} + +// Returns the appropriate field selector based on the API version being used to communicate with the server. +// The returned field selector can be used with List and Watch to filter desired events. +func (e *events) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { + field := fields.Set{} + if involvedObjectName != nil { + field["involvedObject.name"] = *involvedObjectName + } + if involvedObjectNamespace != nil { + field["involvedObject.namespace"] = *involvedObjectNamespace + } + if involvedObjectKind != nil { + field["involvedObject.kind"] = *involvedObjectKind + } + if involvedObjectUID != nil { + field["involvedObject.uid"] = *involvedObjectUID + } + return field.AsSelector() +} + +// Returns the appropriate field label to use for name of the involved object as per the given API version. +// DEPRECATED: please use "involvedObject.name" inline. +func GetInvolvedObjectNameFieldLabel(version string) string { + return "involvedObject.name" +} + +// TODO: This is a temporary arrangement and will be removed once all clients are moved to use the clientset. +type EventSinkImpl struct { + Interface EventInterface +} + +func (e *EventSinkImpl) Create(event *v1.Event) (*v1.Event, error) { + return e.Interface.CreateWithEventNamespace(event) +} + +func (e *EventSinkImpl) Update(event *v1.Event) (*v1.Event, error) { + return e.Interface.UpdateWithEventNamespace(event) +} + +func (e *EventSinkImpl) Patch(event *v1.Event, data []byte) (*v1.Event, error) { + return e.Interface.PatchWithEventNamespace(event, data) +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go new file mode 100644 index 000000000..2cb81aa40 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go @@ -0,0 +1,41 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ComponentStatusExpansion interface{} + +type ConfigMapExpansion interface{} + +type EndpointsExpansion interface{} + +type LimitRangeExpansion interface{} + +type PersistentVolumeExpansion interface{} + +type PersistentVolumeClaimExpansion interface{} + +type PodTemplateExpansion interface{} + +type ReplicationControllerExpansion interface{} + +type ResourceQuotaExpansion interface{} + +type SecretExpansion interface{} + +type ServiceAccountExpansion interface{} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go new file mode 100644 index 000000000..51fa11d1b --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// LimitRangesGetter has a method to return a LimitRangeInterface. +// A group's client should implement this interface. +type LimitRangesGetter interface { + LimitRanges(namespace string) LimitRangeInterface +} + +// LimitRangeInterface has methods to work with LimitRange resources. +type LimitRangeInterface interface { + Create(ctx context.Context, limitRange *corev1.LimitRange, opts metav1.CreateOptions) (*corev1.LimitRange, error) + Update(ctx context.Context, limitRange *corev1.LimitRange, opts metav1.UpdateOptions) (*corev1.LimitRange, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.LimitRange, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.LimitRangeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.LimitRange, err error) + Apply(ctx context.Context, limitRange *applyconfigurationscorev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.LimitRange, err error) + LimitRangeExpansion +} + +// limitRanges implements LimitRangeInterface +type limitRanges struct { + *gentype.ClientWithListAndApply[*corev1.LimitRange, *corev1.LimitRangeList, *applyconfigurationscorev1.LimitRangeApplyConfiguration] +} + +// newLimitRanges returns a LimitRanges +func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges { + return &limitRanges{ + gentype.NewClientWithListAndApply[*corev1.LimitRange, *corev1.LimitRangeList, *applyconfigurationscorev1.LimitRangeApplyConfiguration]( + "limitranges", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.LimitRange { return &corev1.LimitRange{} }, + func() *corev1.LimitRangeList { return &corev1.LimitRangeList{} }, + gentype.PrefersProtobuf[*corev1.LimitRange](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go new file mode 100644 index 000000000..323934938 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// NamespacesGetter has a method to return a NamespaceInterface. +// A group's client should implement this interface. +type NamespacesGetter interface { + Namespaces() NamespaceInterface +} + +// NamespaceInterface has methods to work with Namespace resources. +type NamespaceInterface interface { + Create(ctx context.Context, namespace *corev1.Namespace, opts metav1.CreateOptions) (*corev1.Namespace, error) + Update(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Namespace, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Namespace, err error) + Apply(ctx context.Context, namespace *applyconfigurationscorev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Namespace, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, namespace *applyconfigurationscorev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Namespace, err error) + NamespaceExpansion +} + +// namespaces implements NamespaceInterface +type namespaces struct { + *gentype.ClientWithListAndApply[*corev1.Namespace, *corev1.NamespaceList, *applyconfigurationscorev1.NamespaceApplyConfiguration] +} + +// newNamespaces returns a Namespaces +func newNamespaces(c *CoreV1Client) *namespaces { + return &namespaces{ + gentype.NewClientWithListAndApply[*corev1.Namespace, *corev1.NamespaceList, *applyconfigurationscorev1.NamespaceApplyConfiguration]( + "namespaces", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *corev1.Namespace { return &corev1.Namespace{} }, + func() *corev1.NamespaceList { return &corev1.NamespaceList{} }, + gentype.PrefersProtobuf[*corev1.Namespace](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go new file mode 100644 index 000000000..4f720fb92 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go @@ -0,0 +1,37 @@ +/* +Copyright 2016 The Kubernetes Authors. + +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 v1 + +import ( + "context" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. +type NamespaceExpansion interface { + Finalize(ctx context.Context, item *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) +} + +// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. +func (c *namespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { + result = &v1.Namespace{} + err = c.GetClient().Put().Resource("namespaces").Name(namespace.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("finalize").Body(namespace).Do(ctx).Into(result) + return +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go new file mode 100644 index 000000000..1851b025f --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// NodesGetter has a method to return a NodeInterface. +// A group's client should implement this interface. +type NodesGetter interface { + Nodes() NodeInterface +} + +// NodeInterface has methods to work with Node resources. +type NodeInterface interface { + Create(ctx context.Context, node *corev1.Node, opts metav1.CreateOptions) (*corev1.Node, error) + Update(ctx context.Context, node *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, node *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Node, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Node, err error) + Apply(ctx context.Context, node *applyconfigurationscorev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Node, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, node *applyconfigurationscorev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Node, err error) + NodeExpansion +} + +// nodes implements NodeInterface +type nodes struct { + *gentype.ClientWithListAndApply[*corev1.Node, *corev1.NodeList, *applyconfigurationscorev1.NodeApplyConfiguration] +} + +// newNodes returns a Nodes +func newNodes(c *CoreV1Client) *nodes { + return &nodes{ + gentype.NewClientWithListAndApply[*corev1.Node, *corev1.NodeList, *applyconfigurationscorev1.NodeApplyConfiguration]( + "nodes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *corev1.Node { return &corev1.Node{} }, + func() *corev1.NodeList { return &corev1.NodeList{} }, + gentype.PrefersProtobuf[*corev1.Node](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go new file mode 100644 index 000000000..df86253b0 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go @@ -0,0 +1,45 @@ +/* +Copyright 2016 The Kubernetes Authors. + +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 v1 + +import ( + "context" + + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" +) + +// The NodeExpansion interface allows manually adding extra methods to the NodeInterface. +type NodeExpansion interface { + // PatchStatus modifies the status of an existing node. It returns the copy + // of the node that the server returns, or an error. + PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) +} + +// PatchStatus modifies the status of an existing node. It returns the copy of +// the node that the server returns, or an error. +func (c *nodes) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) { + result := &v1.Node{} + err := c.GetClient().Patch(types.StrategicMergePatchType). + Resource("nodes"). + Name(nodeName). + SubResource("status"). + Body(data). + Do(ctx). + Into(result) + return result, err +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go new file mode 100644 index 000000000..077a1ba4f --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// PersistentVolumesGetter has a method to return a PersistentVolumeInterface. +// A group's client should implement this interface. +type PersistentVolumesGetter interface { + PersistentVolumes() PersistentVolumeInterface +} + +// PersistentVolumeInterface has methods to work with PersistentVolume resources. +type PersistentVolumeInterface interface { + Create(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts metav1.CreateOptions) (*corev1.PersistentVolume, error) + Update(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts metav1.UpdateOptions) (*corev1.PersistentVolume, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts metav1.UpdateOptions) (*corev1.PersistentVolume, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.PersistentVolume, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.PersistentVolume, err error) + Apply(ctx context.Context, persistentVolume *applyconfigurationscorev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.PersistentVolume, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, persistentVolume *applyconfigurationscorev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.PersistentVolume, err error) + PersistentVolumeExpansion +} + +// persistentVolumes implements PersistentVolumeInterface +type persistentVolumes struct { + *gentype.ClientWithListAndApply[*corev1.PersistentVolume, *corev1.PersistentVolumeList, *applyconfigurationscorev1.PersistentVolumeApplyConfiguration] +} + +// newPersistentVolumes returns a PersistentVolumes +func newPersistentVolumes(c *CoreV1Client) *persistentVolumes { + return &persistentVolumes{ + gentype.NewClientWithListAndApply[*corev1.PersistentVolume, *corev1.PersistentVolumeList, *applyconfigurationscorev1.PersistentVolumeApplyConfiguration]( + "persistentvolumes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *corev1.PersistentVolume { return &corev1.PersistentVolume{} }, + func() *corev1.PersistentVolumeList { return &corev1.PersistentVolumeList{} }, + gentype.PrefersProtobuf[*corev1.PersistentVolume](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go new file mode 100644 index 000000000..cbe75e812 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface. +// A group's client should implement this interface. +type PersistentVolumeClaimsGetter interface { + PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface +} + +// PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources. +type PersistentVolumeClaimInterface interface { + Create(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts metav1.CreateOptions) (*corev1.PersistentVolumeClaim, error) + Update(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.PersistentVolumeClaim, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.PersistentVolumeClaim, err error) + Apply(ctx context.Context, persistentVolumeClaim *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.PersistentVolumeClaim, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, persistentVolumeClaim *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.PersistentVolumeClaim, err error) + PersistentVolumeClaimExpansion +} + +// persistentVolumeClaims implements PersistentVolumeClaimInterface +type persistentVolumeClaims struct { + *gentype.ClientWithListAndApply[*corev1.PersistentVolumeClaim, *corev1.PersistentVolumeClaimList, *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration] +} + +// newPersistentVolumeClaims returns a PersistentVolumeClaims +func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVolumeClaims { + return &persistentVolumeClaims{ + gentype.NewClientWithListAndApply[*corev1.PersistentVolumeClaim, *corev1.PersistentVolumeClaimList, *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration]( + "persistentvolumeclaims", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.PersistentVolumeClaim { return &corev1.PersistentVolumeClaim{} }, + func() *corev1.PersistentVolumeClaimList { return &corev1.PersistentVolumeClaimList{} }, + gentype.PrefersProtobuf[*corev1.PersistentVolumeClaim](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go new file mode 100644 index 000000000..072a55941 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -0,0 +1,110 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// PodsGetter has a method to return a PodInterface. +// A group's client should implement this interface. +type PodsGetter interface { + Pods(namespace string) PodInterface +} + +// PodInterface has methods to work with Pod resources. +type PodInterface interface { + Create(ctx context.Context, pod *corev1.Pod, opts metav1.CreateOptions) (*corev1.Pod, error) + Update(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Pod, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Pod, err error) + Apply(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Pod, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Pod, err error) + UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) + UpdateResize(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) + + PodExpansion +} + +// pods implements PodInterface +type pods struct { + *gentype.ClientWithListAndApply[*corev1.Pod, *corev1.PodList, *applyconfigurationscorev1.PodApplyConfiguration] +} + +// newPods returns a Pods +func newPods(c *CoreV1Client, namespace string) *pods { + return &pods{ + gentype.NewClientWithListAndApply[*corev1.Pod, *corev1.PodList, *applyconfigurationscorev1.PodApplyConfiguration]( + "pods", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.Pod { return &corev1.Pod{} }, + func() *corev1.PodList { return &corev1.PodList{} }, + gentype.PrefersProtobuf[*corev1.Pod](), + ), + } +} + +// UpdateEphemeralContainers takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. +func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (result *corev1.Pod, err error) { + result = &corev1.Pod{} + err = c.GetClient().Put(). + UseProtobufAsDefault(). + Namespace(c.GetNamespace()). + Resource("pods"). + Name(podName). + SubResource("ephemeralcontainers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pod). + Do(ctx). + Into(result) + return +} + +// UpdateResize takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. +func (c *pods) UpdateResize(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (result *corev1.Pod, err error) { + result = &corev1.Pod{} + err = c.GetClient().Put(). + UseProtobufAsDefault(). + Namespace(c.GetNamespace()). + Resource("pods"). + Name(podName). + SubResource("resize"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pod). + Do(ctx). + Into(result) + return +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go new file mode 100644 index 000000000..a2d4d70d4 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go @@ -0,0 +1,85 @@ +/* +Copyright 2016 The Kubernetes Authors. + +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 v1 + +import ( + "context" + + v1 "k8s.io/api/core/v1" + policyv1 "k8s.io/api/policy/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/net" + "k8s.io/client-go/kubernetes/scheme" + restclient "k8s.io/client-go/rest" +) + +// The PodExpansion interface allows manually adding extra methods to the PodInterface. +type PodExpansion interface { + Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error + // Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. + // Equivalent to calling EvictV1beta1. + // Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). + Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error + // EvictV1 submits a policy/v1 Eviction request to the pod's eviction subresource. + // Supported in 1.22+. + EvictV1(ctx context.Context, eviction *policyv1.Eviction) error + // EvictV1beta1 submits a policy/v1beta1 Eviction request to the pod's eviction subresource. + // Supported in 1.22+. + EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error + GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request + ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper +} + +// Bind applies the provided binding to the named pod in the current namespace (binding.Namespace is ignored). +func (c *pods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error() +} + +// Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. +// Equivalent to calling EvictV1beta1. +// Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). +func (c *pods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() +} + +func (c *pods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() +} + +func (c *pods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() +} + +// Get constructs a request for getting the logs for a pod +func (c *pods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { + return c.GetClient().Get().Namespace(c.GetNamespace()).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, scheme.ParameterCodec) +} + +// ProxyGet returns a response of the pod by calling it through the proxy. +func (c *pods) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { + request := c.GetClient().Get(). + Namespace(c.GetNamespace()). + Resource("pods"). + SubResource("proxy"). + Name(net.JoinSchemeNamePort(scheme, name, port)). + Suffix(path) + for k, v := range params { + request = request.Param(k, v) + } + return request +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go new file mode 100644 index 000000000..b0cfa1bc1 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// PodTemplatesGetter has a method to return a PodTemplateInterface. +// A group's client should implement this interface. +type PodTemplatesGetter interface { + PodTemplates(namespace string) PodTemplateInterface +} + +// PodTemplateInterface has methods to work with PodTemplate resources. +type PodTemplateInterface interface { + Create(ctx context.Context, podTemplate *corev1.PodTemplate, opts metav1.CreateOptions) (*corev1.PodTemplate, error) + Update(ctx context.Context, podTemplate *corev1.PodTemplate, opts metav1.UpdateOptions) (*corev1.PodTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.PodTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.PodTemplate, err error) + Apply(ctx context.Context, podTemplate *applyconfigurationscorev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.PodTemplate, err error) + PodTemplateExpansion +} + +// podTemplates implements PodTemplateInterface +type podTemplates struct { + *gentype.ClientWithListAndApply[*corev1.PodTemplate, *corev1.PodTemplateList, *applyconfigurationscorev1.PodTemplateApplyConfiguration] +} + +// newPodTemplates returns a PodTemplates +func newPodTemplates(c *CoreV1Client, namespace string) *podTemplates { + return &podTemplates{ + gentype.NewClientWithListAndApply[*corev1.PodTemplate, *corev1.PodTemplateList, *applyconfigurationscorev1.PodTemplateApplyConfiguration]( + "podtemplates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.PodTemplate { return &corev1.PodTemplate{} }, + func() *corev1.PodTemplateList { return &corev1.PodTemplateList{} }, + gentype.PrefersProtobuf[*corev1.PodTemplate](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go new file mode 100644 index 000000000..f8a7c9285 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -0,0 +1,110 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ReplicationControllersGetter has a method to return a ReplicationControllerInterface. +// A group's client should implement this interface. +type ReplicationControllersGetter interface { + ReplicationControllers(namespace string) ReplicationControllerInterface +} + +// ReplicationControllerInterface has methods to work with ReplicationController resources. +type ReplicationControllerInterface interface { + Create(ctx context.Context, replicationController *corev1.ReplicationController, opts metav1.CreateOptions) (*corev1.ReplicationController, error) + Update(ctx context.Context, replicationController *corev1.ReplicationController, opts metav1.UpdateOptions) (*corev1.ReplicationController, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, replicationController *corev1.ReplicationController, opts metav1.UpdateOptions) (*corev1.ReplicationController, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ReplicationController, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ReplicationControllerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ReplicationController, err error) + Apply(ctx context.Context, replicationController *applyconfigurationscorev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ReplicationController, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, replicationController *applyconfigurationscorev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ReplicationController, err error) + GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + + ReplicationControllerExpansion +} + +// replicationControllers implements ReplicationControllerInterface +type replicationControllers struct { + *gentype.ClientWithListAndApply[*corev1.ReplicationController, *corev1.ReplicationControllerList, *applyconfigurationscorev1.ReplicationControllerApplyConfiguration] +} + +// newReplicationControllers returns a ReplicationControllers +func newReplicationControllers(c *CoreV1Client, namespace string) *replicationControllers { + return &replicationControllers{ + gentype.NewClientWithListAndApply[*corev1.ReplicationController, *corev1.ReplicationControllerList, *applyconfigurationscorev1.ReplicationControllerApplyConfiguration]( + "replicationcontrollers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.ReplicationController { return &corev1.ReplicationController{} }, + func() *corev1.ReplicationControllerList { return &corev1.ReplicationControllerList{} }, + gentype.PrefersProtobuf[*corev1.ReplicationController](), + ), + } +} + +// GetScale takes name of the replicationController, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. +func (c *replicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.GetClient().Get(). + UseProtobufAsDefault(). + Namespace(c.GetNamespace()). + Resource("replicationcontrollers"). + Name(replicationControllerName). + SubResource("scale"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *replicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.GetClient().Put(). + UseProtobufAsDefault(). + Namespace(c.GetNamespace()). + Resource("replicationcontrollers"). + Name(replicationControllerName). + SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scale). + Do(ctx). + Into(result) + return +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go new file mode 100644 index 000000000..a0435accc --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ResourceQuotasGetter has a method to return a ResourceQuotaInterface. +// A group's client should implement this interface. +type ResourceQuotasGetter interface { + ResourceQuotas(namespace string) ResourceQuotaInterface +} + +// ResourceQuotaInterface has methods to work with ResourceQuota resources. +type ResourceQuotaInterface interface { + Create(ctx context.Context, resourceQuota *corev1.ResourceQuota, opts metav1.CreateOptions) (*corev1.ResourceQuota, error) + Update(ctx context.Context, resourceQuota *corev1.ResourceQuota, opts metav1.UpdateOptions) (*corev1.ResourceQuota, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, resourceQuota *corev1.ResourceQuota, opts metav1.UpdateOptions) (*corev1.ResourceQuota, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ResourceQuota, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ResourceQuotaList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ResourceQuota, err error) + Apply(ctx context.Context, resourceQuota *applyconfigurationscorev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ResourceQuota, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, resourceQuota *applyconfigurationscorev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ResourceQuota, err error) + ResourceQuotaExpansion +} + +// resourceQuotas implements ResourceQuotaInterface +type resourceQuotas struct { + *gentype.ClientWithListAndApply[*corev1.ResourceQuota, *corev1.ResourceQuotaList, *applyconfigurationscorev1.ResourceQuotaApplyConfiguration] +} + +// newResourceQuotas returns a ResourceQuotas +func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas { + return &resourceQuotas{ + gentype.NewClientWithListAndApply[*corev1.ResourceQuota, *corev1.ResourceQuotaList, *applyconfigurationscorev1.ResourceQuotaApplyConfiguration]( + "resourcequotas", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.ResourceQuota { return &corev1.ResourceQuota{} }, + func() *corev1.ResourceQuotaList { return &corev1.ResourceQuotaList{} }, + gentype.PrefersProtobuf[*corev1.ResourceQuota](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go new file mode 100644 index 000000000..a7ab56a27 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// SecretsGetter has a method to return a SecretInterface. +// A group's client should implement this interface. +type SecretsGetter interface { + Secrets(namespace string) SecretInterface +} + +// SecretInterface has methods to work with Secret resources. +type SecretInterface interface { + Create(ctx context.Context, secret *corev1.Secret, opts metav1.CreateOptions) (*corev1.Secret, error) + Update(ctx context.Context, secret *corev1.Secret, opts metav1.UpdateOptions) (*corev1.Secret, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Secret, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.SecretList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Secret, err error) + Apply(ctx context.Context, secret *applyconfigurationscorev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Secret, err error) + SecretExpansion +} + +// secrets implements SecretInterface +type secrets struct { + *gentype.ClientWithListAndApply[*corev1.Secret, *corev1.SecretList, *applyconfigurationscorev1.SecretApplyConfiguration] +} + +// newSecrets returns a Secrets +func newSecrets(c *CoreV1Client, namespace string) *secrets { + return &secrets{ + gentype.NewClientWithListAndApply[*corev1.Secret, *corev1.SecretList, *applyconfigurationscorev1.SecretApplyConfiguration]( + "secrets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.Secret { return &corev1.Secret{} }, + func() *corev1.SecretList { return &corev1.SecretList{} }, + gentype.PrefersProtobuf[*corev1.Secret](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go new file mode 100644 index 000000000..f145a137c --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ServicesGetter has a method to return a ServiceInterface. +// A group's client should implement this interface. +type ServicesGetter interface { + Services(namespace string) ServiceInterface +} + +// ServiceInterface has methods to work with Service resources. +type ServiceInterface interface { + Create(ctx context.Context, service *corev1.Service, opts metav1.CreateOptions) (*corev1.Service, error) + Update(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Service, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Service, err error) + Apply(ctx context.Context, service *applyconfigurationscorev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Service, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, service *applyconfigurationscorev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Service, err error) + ServiceExpansion +} + +// services implements ServiceInterface +type services struct { + *gentype.ClientWithListAndApply[*corev1.Service, *corev1.ServiceList, *applyconfigurationscorev1.ServiceApplyConfiguration] +} + +// newServices returns a Services +func newServices(c *CoreV1Client, namespace string) *services { + return &services{ + gentype.NewClientWithListAndApply[*corev1.Service, *corev1.ServiceList, *applyconfigurationscorev1.ServiceApplyConfiguration]( + "services", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.Service { return &corev1.Service{} }, + func() *corev1.ServiceList { return &corev1.ServiceList{} }, + gentype.PrefersProtobuf[*corev1.Service](), + ), + } +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service_expansion.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service_expansion.go new file mode 100644 index 000000000..9a6f78138 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service_expansion.go @@ -0,0 +1,41 @@ +/* +Copyright 2016 The Kubernetes Authors. + +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 v1 + +import ( + "k8s.io/apimachinery/pkg/util/net" + restclient "k8s.io/client-go/rest" +) + +// The ServiceExpansion interface allows manually adding extra methods to the ServiceInterface. +type ServiceExpansion interface { + ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper +} + +// ProxyGet returns a response of the service by calling it through the proxy. +func (c *services) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { + request := c.GetClient().Get(). + Namespace(c.GetNamespace()). + Resource("services"). + SubResource("proxy"). + Name(net.JoinSchemeNamePort(scheme, name, port)). + Suffix(path) + for k, v := range params { + request = request.Param(k, v) + } + return request +} diff --git a/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go new file mode 100644 index 000000000..8458b6d9b --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + authenticationv1 "k8s.io/api/authentication/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ServiceAccountsGetter has a method to return a ServiceAccountInterface. +// A group's client should implement this interface. +type ServiceAccountsGetter interface { + ServiceAccounts(namespace string) ServiceAccountInterface +} + +// ServiceAccountInterface has methods to work with ServiceAccount resources. +type ServiceAccountInterface interface { + Create(ctx context.Context, serviceAccount *corev1.ServiceAccount, opts metav1.CreateOptions) (*corev1.ServiceAccount, error) + Update(ctx context.Context, serviceAccount *corev1.ServiceAccount, opts metav1.UpdateOptions) (*corev1.ServiceAccount, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ServiceAccount, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceAccountList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ServiceAccount, err error) + Apply(ctx context.Context, serviceAccount *applyconfigurationscorev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.ServiceAccount, err error) + CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (*authenticationv1.TokenRequest, error) + + ServiceAccountExpansion +} + +// serviceAccounts implements ServiceAccountInterface +type serviceAccounts struct { + *gentype.ClientWithListAndApply[*corev1.ServiceAccount, *corev1.ServiceAccountList, *applyconfigurationscorev1.ServiceAccountApplyConfiguration] +} + +// newServiceAccounts returns a ServiceAccounts +func newServiceAccounts(c *CoreV1Client, namespace string) *serviceAccounts { + return &serviceAccounts{ + gentype.NewClientWithListAndApply[*corev1.ServiceAccount, *corev1.ServiceAccountList, *applyconfigurationscorev1.ServiceAccountApplyConfiguration]( + "serviceaccounts", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1.ServiceAccount { return &corev1.ServiceAccount{} }, + func() *corev1.ServiceAccountList { return &corev1.ServiceAccountList{} }, + gentype.PrefersProtobuf[*corev1.ServiceAccount](), + ), + } +} + +// CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. +func (c *serviceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { + result = &authenticationv1.TokenRequest{} + err = c.GetClient().Post(). + UseProtobufAsDefault(). + Namespace(c.GetNamespace()). + Resource("serviceaccounts"). + Name(serviceAccountName). + SubResource("token"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tokenRequest). + Do(ctx). + Into(result) + return +} diff --git a/ci-runner/vendor/k8s.io/client-go/tools/reference/ref.go b/ci-runner/vendor/k8s.io/client-go/tools/reference/ref.go new file mode 100644 index 000000000..5d4ec3743 --- /dev/null +++ b/ci-runner/vendor/k8s.io/client-go/tools/reference/ref.go @@ -0,0 +1,109 @@ +/* +Copyright 2014 The Kubernetes Authors. + +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 reference + +import ( + "errors" + "fmt" + + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +var ( + // Errors that could be returned by GetReference. + ErrNilObject = errors.New("can't reference a nil object") +) + +// GetReference returns an ObjectReference which refers to the given +// object, or an error if the object doesn't follow the conventions +// that would allow this. +// TODO: should take a meta.Interface see https://issue.k8s.io/7127 +func GetReference(scheme *runtime.Scheme, obj runtime.Object) (*v1.ObjectReference, error) { + if obj == nil { + return nil, ErrNilObject + } + if ref, ok := obj.(*v1.ObjectReference); ok { + // Don't make a reference to a reference. + return ref, nil + } + + // An object that implements only List has enough metadata to build a reference + var listMeta metav1.Common + objectMeta, err := meta.Accessor(obj) + if err != nil { + listMeta, err = meta.CommonAccessor(obj) + if err != nil { + return nil, err + } + } else { + listMeta = objectMeta + } + + gvk := obj.GetObjectKind().GroupVersionKind() + + // If object meta doesn't contain data about kind and/or version, + // we are falling back to scheme. + // + // TODO: This doesn't work for CRDs, which are not registered in scheme. + if gvk.Empty() { + gvks, _, err := scheme.ObjectKinds(obj) + if err != nil { + return nil, err + } + if len(gvks) == 0 || gvks[0].Empty() { + return nil, fmt.Errorf("unexpected gvks registered for object %T: %v", obj, gvks) + } + // TODO: The same object can be registered for multiple group versions + // (although in practise this doesn't seem to be used). + // In such case, the version set may not be correct. + gvk = gvks[0] + } + + kind := gvk.Kind + version := gvk.GroupVersion().String() + + // only has list metadata + if objectMeta == nil { + return &v1.ObjectReference{ + Kind: kind, + APIVersion: version, + ResourceVersion: listMeta.GetResourceVersion(), + }, nil + } + + return &v1.ObjectReference{ + Kind: kind, + APIVersion: version, + Name: objectMeta.GetName(), + Namespace: objectMeta.GetNamespace(), + UID: objectMeta.GetUID(), + ResourceVersion: objectMeta.GetResourceVersion(), + }, nil +} + +// GetPartialReference is exactly like GetReference, but allows you to set the FieldPath. +func GetPartialReference(scheme *runtime.Scheme, obj runtime.Object, fieldPath string) (*v1.ObjectReference, error) { + ref, err := GetReference(scheme, obj) + if err != nil { + return nil, err + } + ref.FieldPath = fieldPath + return ref, nil +} diff --git a/ci-runner/vendor/modules.txt b/ci-runner/vendor/modules.txt index 411da6074..a1ec62a07 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## explicit; go 1.24.0 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/constants @@ -313,6 +313,8 @@ github.com/devtron-labs/common-lib/utils github.com/devtron-labs/common-lib/utils/bean github.com/devtron-labs/common-lib/utils/dockerOperations github.com/devtron-labs/common-lib/utils/remoteConnection/bean +github.com/devtron-labs/common-lib/utils/retryFunc +github.com/devtron-labs/common-lib/utils/runTime github.com/devtron-labs/common-lib/utils/workFlow github.com/devtron-labs/common-lib/workflow # github.com/distribution/reference v0.6.0 @@ -1125,6 +1127,7 @@ k8s.io/client-go/features k8s.io/client-go/gentype k8s.io/client-go/kubernetes/scheme k8s.io/client-go/kubernetes/typed/apps/v1 +k8s.io/client-go/kubernetes/typed/core/v1 k8s.io/client-go/openapi k8s.io/client-go/pkg/apis/clientauthentication k8s.io/client-go/pkg/apis/clientauthentication/install @@ -1137,6 +1140,7 @@ k8s.io/client-go/rest/watch k8s.io/client-go/testing k8s.io/client-go/tools/clientcmd/api k8s.io/client-go/tools/metrics +k8s.io/client-go/tools/reference k8s.io/client-go/transport k8s.io/client-go/util/apply k8s.io/client-go/util/cert @@ -1194,4 +1198,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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/common-lib/utils/retryFunc/RetryFunction.go b/common-lib/utils/retryFunc/RetryFunction.go new file mode 100644 index 000000000..7a4e9df35 --- /dev/null +++ b/common-lib/utils/retryFunc/RetryFunction.go @@ -0,0 +1,94 @@ +/* + * 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 retryFunc + +import ( + "errors" + "fmt" + "github.com/devtron-labs/common-lib/utils/runTime" + "go.uber.org/zap" + "time" +) + +// Retry performs a function with retries, delay, and a max number of attempts. +func Retry(fn func(retriesLeft int) error, shouldRetry func(err error) bool, maxRetries int, delay time.Duration, logger *zap.SugaredLogger) error { + return retry(fn, shouldRetry, maxRetries, delay, logger) +} + +// RetryWithOutLogging performs a function with retries, delay, and a max number of attempts without logging. +func RetryWithOutLogging(fn func(retriesLeft int) error, shouldRetry func(err error) bool, maxRetries int, delay time.Duration) error { + return retry(fn, shouldRetry, maxRetries, delay, nil) +} + +func retry(fn func(retriesLeft int) error, shouldRetry func(err error) bool, maxRetries int, delay time.Duration, logger *zap.SugaredLogger) error { + var err error + if logger != nil { + logger.Debugw("retrying function", + "maxRetries", maxRetries, "delay", delay, + "callerFunc", runTime.GetCallerFunctionName(), + "path", fmt.Sprintf("%s:%d", runTime.GetCallerFileName(), runTime.GetCallerLineNumber())) + } + for i := 0; i < maxRetries; i++ { + if logger != nil { + logger.Debugw("function called with retry", "attempt", i+1, "maxRetries", maxRetries, "delay", delay) + } + err = fn(maxRetries - (i + 1)) + if err == nil { + return nil + } + if !shouldRetry(err) { + return sanitiseError(err) + } + if logger != nil { + logger.Infow(fmt.Sprintf("Attempt %d failed, retrying in %v", i+1, delay), "err", err) + } + time.Sleep(delay) + } + return fmt.Errorf("after %d attempts, last error: %s", maxRetries, err) +} + +// RetryableError is the error returned by callback function under Retry. +// for RetryableError errors can be handled by shouldRetry func +type RetryableError struct { + err error +} + +func NewRetryableError(err error) *RetryableError { + return &RetryableError{ + err: err, + } +} + +// IsRetryableError checks if the error is a RetryableError. +func IsRetryableError(err error) bool { + if err == nil { + return false + } + var retryErr *RetryableError + return errors.As(err, &retryErr) +} + +func (r *RetryableError) Error() string { return r.err.Error() } + +func (r *RetryableError) GetError() error { return r.err } + +func sanitiseError(err error) error { + if retryErr := (&RetryableError{}); errors.As(err, &retryErr) { + return retryErr.GetError() + } + return err +} diff --git a/git-sensor/go.mod b/git-sensor/go.mod index 0e4d56647..39367db5d 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-20250703034313-6e26d7880667 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e require ( github.com/caarlos0/env v3.5.0+incompatible diff --git a/git-sensor/go.sum b/git-sensor/go.sum index d362651d7..92683065b 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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 89f4bfb5f..4078db6ab 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/image-scanner/go.mod b/image-scanner/go.mod index c8f42a5f4..9ec249028 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-20250703034313-6e26d7880667 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/image-scanner/go.sum b/image-scanner/go.sum index c724d1b61..90173a6f0 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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 1e01eaa8d..ac1801919 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.19.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/kubelink/go.mod b/kubelink/go.mod index 76e0cf056..28a42afcc 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-20250703034313-6e26d7880667 +replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/kubelink/go.sum b/kubelink/go.sum index 79f1b1850..201e9141b 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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/modules.txt b/kubelink/vendor/modules.txt index 02acd259e..ce3d5bf51 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/kubewatch/go.mod b/kubewatch/go.mod index 8955e722f..0487755ba 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-20250703034313-6e26d7880667 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ) diff --git a/kubewatch/go.sum b/kubewatch/go.sum index 7d4cf6bd5..11a180a0f 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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 3468a59b1..768d5c444 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e diff --git a/lens/go.mod b/lens/go.mod index cf151581f..c0f32130b 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-20250703034313-6e26d7880667 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e 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 fd981f730..6b8d47151 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-20250703034313-6e26d7880667 h1:mV+gq9St5soJPS7vww0cWTW6ayKxDVKWmJVkhbkrtjM= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250703034313-6e26d7880667/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e h1:iJg144GwEMX7vUuNqIYBWbBniw5BvJiFw5ZXG8LuH3c= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e/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 414eb9551..328083b5a 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e ## 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-20250703034313-6e26d7880667 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708132702-b8a70bd2d48e