Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
1196aa2
SecretFieldClusterId to CmFieldClusterId
prakash100198 May 21, 2025
17673c3
replace secret informer with field selector to configmap informer wit…
prakash100198 May 22, 2025
405943c
CreateConfigMapObject
prakash100198 May 22, 2025
d504346
ClusterModifyEventSecretTypeKey
prakash100198 May 22, 2025
18ca4a3
DeleteConfigMap k8s util func
prakash100198 May 22, 2025
0edc8f8
correct label selector
prakash100198 May 22, 2025
28fd5f0
add extra validation in add , update and delete func
prakash100198 May 22, 2025
dce8d68
cm informer instead of secret informer for cluster
prakash100198 May 22, 2025
e1121de
develop sync
prakash100198 May 23, 2025
9a252fc
bump common lib
prakash100198 May 23, 2025
1b6fc97
bump common lib
prakash100198 May 23, 2025
c0371be
Merge branch 'develop' into rename-secret-to-cm-cluster
prakash100198 May 23, 2025
df280dc
bump common lib
prakash100198 May 23, 2025
1041940
bump common lib
prakash100198 May 23, 2025
96556fe
fix
prakash100198 May 23, 2025
68ba8f2
bump common lib
prakash100198 May 23, 2025
996f82c
bump common lib
prakash100198 May 23, 2025
60bd924
r
prakash100198 May 23, 2025
c5591ad
ClusterModifyEventCmLabelValue = "cluster-request-modify"
prakash100198 May 23, 2025
48b990c
ClusterModifyEventCmLabelValue = "type=cluster-request-modify"
prakash100198 May 23, 2025
93c5820
import label selector from commonb lib
prakash100198 May 23, 2025
5ed7eaa
import label selector from commonb lib
prakash100198 May 23, 2025
17f2964
ClusterModifyEventCmLabelKeyValue and ClusterModifyEventCmLabelValue
prakash100198 May 23, 2025
1205ee2
small fix
prakash100198 May 23, 2025
01ed8fb
small fix
prakash100198 May 23, 2025
222f1e0
add logger for ignoring cluster change event in case label not found
prakash100198 May 27, 2025
556a5a9
fix
prakash100198 May 27, 2025
d40f917
logger
prakash100198 May 27, 2025
5f0ce09
refactoring of CreateConfigMapObject
prakash100198 May 27, 2025
f3a156d
fix
prakash100198 May 27, 2025
ddb036d
Merge branch 'develop' into rename-secret-to-cm-cluster
prakash100198 May 27, 2025
323af49
bump common lib
prakash100198 May 27, 2025
b13ea5f
bump common lib
prakash100198 May 27, 2025
626bf7f
remove WithCmName and make cmname as func signature
prakash100198 May 27, 2025
2439202
code review incorporation
prakash100198 May 27, 2025
483d6a2
bump common lib
prakash100198 May 27, 2025
8a47b97
Merge branch 'develop' into rename-secret-to-cm-cluster
prakash100198 May 28, 2025
b913d2d
make
prakash100198 May 28, 2025
aa57ae9
bump common lib
prakash100198 May 28, 2025
f942995
Merge pull request #288 from devtron-labs/develop-main-sync-4jun-1
kartik-579 Jun 4, 2025
3c18cce
Merge pull request #282 from devtron-labs/dependa-fix
prkhrkat Jun 5, 2025
2650af5
Merge branch 'develop' into rename-secret-to-cm-cluster
prakash100198 Jun 9, 2025
a435581
Merge pull request #280 from devtron-labs/rename-secret-to-cm-cluster
prakash100198 Jun 10, 2025
2075ef2
wip: adding app status
iamayushm Jun 12, 2025
a3dda58
adding last observed revision
iamayushm Jun 13, 2025
768368b
wip
kartik-579 Jun 13, 2025
3ee00d3
chore: http shutdown timeout configurable (#291) (#293)
vikramdevtron Jun 16, 2025
fc7dd34
restored mod changes for kubelink and kubewatch (#294)
vikramdevtron Jun 16, 2025
d20f93d
adding label and field filter in flux listing
iamayushm Jun 16, 2025
f147d94
Revert "adding label and field filter in flux listing"
iamayushm Jun 17, 2025
0d9770f
wip: adding helmReleaseNamespace
iamayushm Jun 17, 2025
95d91bb
if step.ExecutorType == helper.SHELL, then reserve WORKINGDIR, skip c…
prakash100198 Jun 20, 2025
5ed2fe9
main sync develop
vikramdevtron Jun 23, 2025
168dd64
chore: dependency updated to 'origin/main'
Ash-exp Jun 23, 2025
29ba3f1
Merge pull request #302 from devtron-labs/main-sync-develop-23jun
vikramdevtron Jun 24, 2025
20d0ef0
Merge branch 'develop' into output-path-infite-loop-fix
prakash100198 Jun 24, 2025
fd0c2f8
Merge pull request #301 from devtron-labs/output-path-infite-loop-fix
prakash100198 Jun 24, 2025
e9fb36b
Merge remote-tracking branch 'origin/main' into feat-flux-cd
iamayushm Jun 27, 2025
b8570f0
Merge remote-tracking branch 'origin/develop' into feat-flux-cd
iamayushm Jul 2, 2025
266270e
dep update
iamayushm Jul 2, 2025
dad65f6
dep update develop
iamayushm Jul 2, 2025
05664fd
Merge pull request #292 from devtron-labs/feat-flux-cd
kartik-579 Jul 2, 2025
4783a43
dep update
iamayushm Jul 2, 2025
52f0096
Merge pull request #306 from devtron-labs/hash-update
iamayushm Jul 2, 2025
9bda00b
feat: k8s resource recommendation service integration (#297)
Ash-exp Jul 2, 2025
47f9f15
vendor update in develop
vikramdevtron Jul 2, 2025
9fa1fd0
Merge pull request #307 from devtron-labs/vendor-update-develop-2july
vikramdevtron Jul 2, 2025
ee90461
fix: resource tree gvk resource not found error
Ash-exp Jul 4, 2025
a4714ab
chore: dependency updated to 'origin/fix-resource-tree-error'
Ash-exp Jul 4, 2025
51fefcc
fix: resource tree gvk resource not found error (#309)
Ash-exp Jul 4, 2025
15f8ef1
Merge branch 'main' into main-sync-7-7
Shivam-nagar23 Jul 7, 2025
1e734de
Merge pull request #311 from devtron-labs/main-sync-7-7
vikramdevtron Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion chart-sync/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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-20250619100439-8e8e182b498a
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c

require (
github.com/caarlos0/env v3.5.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions chart-sync/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions chart-sync/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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-20250619100439-8e8e182b498a
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c
## explicit; go 1.24.0
github.com/devtron-labs/common-lib/constants
github.com/devtron-labs/common-lib/fetchAllEnv
Expand Down Expand Up @@ -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-20250619100439-8e8e182b498a
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c
2 changes: 1 addition & 1 deletion chart-sync/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ci-runner/executor/StageExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"os"
"path/filepath"
"runtime/debug"
"strings"
)

type StageExecutorImpl struct {
Expand Down Expand Up @@ -225,6 +226,10 @@ func (impl *StageExecutorImpl) RunCiCdStep(stepType helper.StepType, ciCdRequest
stepOutputVarsFinal = stageOutputVars
if len(step.ArtifactPaths) > 0 {
for _, path := range step.ArtifactPaths {
if strings.HasPrefix(path, util.WORKINGDIR) {
log.Printf("skipping copying files to '/devtroncd' path as it's reserved")
continue
}
err = copylib.Copy(path, filepath.Join(util.TmpArtifactLocation, step.Name, path))
if err != nil {
if _, ok := err.(*os.PathError); ok {
Expand Down
2 changes: 1 addition & 1 deletion ci-runner/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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-20250619100439-8e8e182b498a
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c

require (
github.com/Knetic/govaluate v3.0.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions ci-runner/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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-20250619100439-8e8e182b498a h1:iQdc02/QUQ4P45Y/OEZXtbkES6+Tan2RJfg2wpJxaWQ=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c h1:ZtYIPskOvOkdqU66dggJ1eUR7xoaAL5xhYliYm0iRww=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ci-runner/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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-20250619100439-8e8e182b498a
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c
## explicit; go 1.24.0
github.com/devtron-labs/common-lib/blob-storage
github.com/devtron-labs/common-lib/constants
Expand Down Expand Up @@ -1194,4 +1194,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
## explicit; go 1.12
sigs.k8s.io/yaml
sigs.k8s.io/yaml/goyaml.v2
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250619100439-8e8e182b498a
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250704063028-ee904611f07c
11 changes: 6 additions & 5 deletions common-lib/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ func (m ServiceName) ToString() string {
}

const (
Orchestrator ServiceName = "ORCHESTRATOR"
Kubelink ServiceName = "KUBELINK"
GitSensor ServiceName = "GITSENSOR"
Kubewatch ServiceName = "KUBEWATCH"
ImageScanner ServiceName = "IMAGE_SCANNER"
Orchestrator ServiceName = "ORCHESTRATOR"
Kubelink ServiceName = "KUBELINK"
GitSensor ServiceName = "GITSENSOR"
Kubewatch ServiceName = "KUBEWATCH"
ImageScanner ServiceName = "IMAGE_SCANNER"
ResourceOptimizer ServiceName = "RESOURCE_OPTIMIZER"
)

// metrics name constants
Expand Down
197 changes: 197 additions & 0 deletions common-lib/k8sResource/bean.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
package k8sResource

import (
k8sCommonBean "github.com/devtron-labs/common-lib/utils/k8s/commonBean"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
)

type Identifier struct {
gvk schema.GroupVersionKind
name string
namespace string
}

func NewIdentifier(name, namespace string, gvk schema.GroupVersionKind) *Identifier {
return &Identifier{
gvk: gvk,
name: name,
namespace: namespace,
}
}

func (identifier *Identifier) GetGvk() schema.GroupVersionKind {
if identifier == nil {
return schema.GroupVersionKind{}
}
return identifier.gvk
}

func (identifier *Identifier) GetName() string {
if identifier == nil {
return ""
}
return identifier.name
}

func (identifier *Identifier) GetNamespace() string {
if identifier == nil {
return ""
}
return identifier.namespace
}

type PatchRequest struct {
// TODO: Use Identifier instead of Name, Namespace, Gvk
Name string
Namespace string
Gvk *schema.GroupVersionKind
Patch string
PatchType string
}

type ParentChildGvkMapping struct {
Group string `json:"group"`
Version string `json:"version"`
Kind string `json:"kind"`
ChildObjects []ChildObjects `json:"childObjects"`
}

type ChildObjects struct {
Group string `json:"group"`
Version string `json:"version"`
Resource string `json:"resource"`
Scope meta.RESTScopeName `json:"scope"`
}

func (r ChildObjects) GetGvrAndScopeForChildObject() *k8sCommonBean.GvrAndScope {
return &k8sCommonBean.GvrAndScope{
Gvr: schema.GroupVersionResource{
Group: r.Group,
Version: r.Version,
Resource: r.Resource,
},
Scope: r.Scope,
}
}

func (r ParentChildGvkMapping) GetParentGvk() schema.GroupVersionKind {
return schema.GroupVersionKind{
Group: r.Group,
Version: r.Version,
Kind: r.Kind,
}
}

type FilterChildrenObjectsResponse struct {
pvcs []unstructured.Unstructured
manifests []*unstructured.Unstructured
}

func NewFilterChildrenObjectsResponse() *FilterChildrenObjectsResponse {
return &FilterChildrenObjectsResponse{}
}

func (resp *FilterChildrenObjectsResponse) GetPvcs() []unstructured.Unstructured {
return resp.pvcs
}

func (resp *FilterChildrenObjectsResponse) GetManifests() []*unstructured.Unstructured {
return resp.manifests
}

func (resp *FilterChildrenObjectsResponse) WithPVCs(pvcs []unstructured.Unstructured) *FilterChildrenObjectsResponse {
resp.pvcs = append(resp.pvcs, pvcs...)
return resp
}

func (resp *FilterChildrenObjectsResponse) WithManifest(manifest *unstructured.Unstructured) *FilterChildrenObjectsResponse {
if manifest == nil {
return resp
}
resp.manifests = append(resp.manifests, manifest)
return resp
}

type FilterChildrenObjectsRequest struct {
childGvk schema.GroupVersionResource
pvcs []unstructured.Unstructured
listObjects *unstructured.UnstructuredList
// TODO: Use Identifier instead of Name, Namespace, Gvk
namespace string
parentGvk schema.GroupVersionKind
parentName string
}

func (req *FilterChildrenObjectsRequest) IsChildResourceTypePVC() bool {
return req.GetParentGvk().Kind == k8sCommonBean.StatefulSetKind && req.GetChildGvk().Resource == k8sCommonBean.PersistentVolumeClaimsResourceType
}

func (req *FilterChildrenObjectsRequest) GetLoggerMetadata(keysAndValues ...any) []any {
metaData := []any{
"namespace", req.namespace,
"childGvk", req.childGvk,
"parentGvk", req.parentGvk,
"parentName", req.parentName,
}
return append(metaData, keysAndValues...)
}

func (req *FilterChildrenObjectsRequest) GetChildGvk() schema.GroupVersionResource {
return req.childGvk
}

func (req *FilterChildrenObjectsRequest) GetPvcs() []unstructured.Unstructured {
return req.pvcs
}

func (req *FilterChildrenObjectsRequest) GetListObjects() *unstructured.UnstructuredList {
return req.listObjects
}

func (req *FilterChildrenObjectsRequest) GetNamespace() string {
return req.namespace
}

func (req *FilterChildrenObjectsRequest) GetParentGvk() schema.GroupVersionKind {
return req.parentGvk
}

func (req *FilterChildrenObjectsRequest) GetParentName() string {
return req.parentName
}

func NewFilterChildrenObjectsRequest() *FilterChildrenObjectsRequest {
return &FilterChildrenObjectsRequest{}
}

func (req *FilterChildrenObjectsRequest) WithChildGvk(gvr schema.GroupVersionResource) *FilterChildrenObjectsRequest {
req.childGvk = gvr
return req
}

func (req *FilterChildrenObjectsRequest) WithPvcs(pvcs []unstructured.Unstructured) *FilterChildrenObjectsRequest {
req.pvcs = pvcs
return req
}

func (req *FilterChildrenObjectsRequest) WithListObjects(objects *unstructured.UnstructuredList) *FilterChildrenObjectsRequest {
req.listObjects = objects
return req
}

func (req *FilterChildrenObjectsRequest) WithNamespace(namespace string) *FilterChildrenObjectsRequest {
req.namespace = namespace
return req
}

func (req *FilterChildrenObjectsRequest) WithParentGvk(parentGvk schema.GroupVersionKind) *FilterChildrenObjectsRequest {
req.parentGvk = parentGvk
return req
}

func (req *FilterChildrenObjectsRequest) WithParentName(parentName string) *FilterChildrenObjectsRequest {
req.parentName = parentName
return req
}
22 changes: 22 additions & 0 deletions common-lib/k8sResource/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package k8sResource

import "github.com/caarlos0/env"

// CATEGORY=K8S_RESOURCE_SERVICE_CONFIG
type ServiceConfig struct {
ParentChildGvkMapping string `env:"PARENT_CHILD_GVK_MAPPING" envDefault:"" description:"Parent child GVK mapping for resource tree" deprecated:"false" example:""`
ChildObjectListingPageSize int64 `env:"CHILD_OBJECT_LISTING_PAGE_SIZE" envDefault:"1000" description:"Resource tree child object listing page size" deprecated:"false" example:"100"`
}

func GetK8sResourceConfig() (*ServiceConfig, error) {
cfg := &ServiceConfig{}
err := env.Parse(cfg)
if err != nil {
return cfg, err
}
if cfg.ChildObjectListingPageSize <= 10 {
// set the default value for invalid values
cfg.ChildObjectListingPageSize = 1000
}
return cfg, nil
}
Loading
Loading