Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a67f9d4
fix: update validation tags for TimeBoundariesRequest fields
Ash-exp Sep 12, 2025
1c4c3a4
Merge branch 'main' into feat/finops-open-api-v1
Shivam-nagar23 Sep 29, 2025
be63a99
Feat/finops config (#337)
Shivam-nagar23 Sep 29, 2025
a94b391
Merge branch 'kubecon-2025' into feat/finops-open-api-v1
Shivam-nagar23 Oct 7, 2025
67f1cdd
adding new topic for gpu installation
iamayushm Oct 12, 2025
33ee00e
Merge branch 'kubecon-2025' into feat/finops-open-api-v1
Shivam-nagar23 Oct 13, 2025
7299501
feat: velero backup storage location informer register
SATYAsasini Oct 14, 2025
8fc7917
Merge remote-tracking branch 'origin/kubecon-2025' into feat/cluster-…
SATYAsasini Oct 14, 2025
f2dcb5b
feat: storage module nats jetstream and bean
SATYAsasini Oct 14, 2025
c797063
Merge branch 'kubecon-2025' into feat/finops-open-api-v1
Shivam-nagar23 Oct 15, 2025
9384969
feat: bsl informer registration
SATYAsasini Oct 15, 2025
65b043e
feat: storage event msg struct
SATYAsasini Oct 16, 2025
eb0c356
misc: vendor file update for velro
SATYAsasini Oct 16, 2025
bdfb533
feat: common msg struct implementation for bsl informer
SATYAsasini Oct 17, 2025
cef97bc
feat: vsl informer registration
SATYAsasini Oct 21, 2025
08c15cb
feat: backup status nats message struct
SATYAsasini Oct 22, 2025
2750d6f
feat: change in data types of backup status nats message struct
SATYAsasini Oct 22, 2025
bb318d1
feat: backup status version datatype change
SATYAsasini Oct 22, 2025
22b523d
feat: backup informer registration
SATYAsasini Oct 22, 2025
55f0e1c
feat: nats message struct for restore events
SATYAsasini Oct 23, 2025
251aaad
feat: restore informer registration
SATYAsasini Oct 23, 2025
829d9e2
feat: BackupSchedule status update event msg struct
SATYAsasini Oct 23, 2025
fc70184
feat: backup schedule resource constant
SATYAsasini Oct 23, 2025
fe7184f
feat: backup schedule informer registration
SATYAsasini Oct 23, 2025
e826673
wip: topic for velero installation
iamayushm Nov 3, 2025
9573861
Merge remote-tracking branch 'origin/kubecon-2025' into feat/cluster-…
iamayushm Nov 3, 2025
a657cac
finops sync
iamayushm Nov 3, 2025
e0c9ab5
feat: refactor backup storage location status handling and clean up u…
Ash-exp Nov 3, 2025
d6e8e9b
feat: refactor Velero event handling to use unified resource event st…
Ash-exp Nov 3, 2025
ff9ed1d
feat: enhance BackupStatus structure with additional fields for impro…
Ash-exp Nov 3, 2025
4497d51
feat: streamline Velero resource event handling with new builder methods
Ash-exp Nov 4, 2025
7ec7971
feat: update common-lib dependency
Ash-exp Nov 4, 2025
ac4375d
feat: remove unused data handling methods from VeleroResourceEvent
Ash-exp Nov 5, 2025
460ca93
feat: remove unused data fields and methods from VeleroResourceEvent
Ash-exp Nov 5, 2025
8ef1ded
feat: enhance restore object change detection with backup name compar…
Ash-exp Nov 6, 2025
45eb4ec
Merge remote-tracking branch 'origin/kubecon-2025' into feat/cluster-…
Ash-exp Nov 6, 2025
422a002
feat: update TLS configuration and socket handling for improved perfo…
Ash-exp Nov 6, 2025
5c7eccb
feat: update CreateOrUpdateSecretByName method to support additional …
Ash-exp Nov 11, 2025
2cdbbcd
feat: enhance CreateOrUpdateSecretByName method to support additional…
Ash-exp Nov 11, 2025
5ac47eb
feat: add post-installation topics and groups for Velero storage
Ash-exp Nov 13, 2025
d083fdc
feat: add VeleroBackupSchedule client type to client.go
Ash-exp Nov 19, 2025
3d44763
feat: rename ClusterVeleroBslType to ClusterStorageModuleType for cla…
Ash-exp Nov 19, 2025
b11d4bc
feat: fix variable name typo for veleroVslInformer in informer and ad…
Ash-exp Nov 19, 2025
846a4e2
feat: update default value for ClusterStorageModuleType to ALL_CLUSTER
Ash-exp Nov 19, 2025
2ee0062
feat: enhance status comparison logic to handle nil progress and hook…
Ash-exp Nov 25, 2025
6bb1a13
feat: improve status comparison logic to handle nil progress cases
Ash-exp Nov 25, 2025
6d444da
feat: update velero informer logic to use centralized velero config
Ash-exp Nov 26, 2025
e082754
Merge remote-tracking branch 'origin/kubecon-2025' into feat/cluster-…
Ash-exp Dec 5, 2025
8e2bfa6
feat: add post-installation topics and update common-lib dependency
Ash-exp Dec 5, 2025
62ef158
feat: add velero v1.14.1 dependency for cluster backup functionality
Ash-exp Dec 5, 2025
efbdbfc
feat: update common-lib dependency to v0.0.0-20251205120949 for impro…
Ash-exp Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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-20251205084952-33d5b5ea8232
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713

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-20251205084952-33d5b5ea8232 h1:6eggXHuRQOWaqmmuxW5mQSIXLZhB4irR/GJ59MixkKY=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232/go.mod h1:+CUhxuWB8uMYIoiXwofuLIXPyiNnwmoZlH90KWAE5Ew=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713 h1:xDbz5etX5h6foQDgpT9ukTo2I65b6q32Nu9do5nBPk8=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713/go.mod h1:CqHnvltrng2O40hNGVl56qcAhv7tiXK3SKx47LKyE/A=
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
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-20251205084952-33d5b5ea8232
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
## explicit; go 1.24.0
github.com/devtron-labs/common-lib/constants
github.com/devtron-labs/common-lib/fetchAllEnv
Expand Down Expand Up @@ -975,4 +975,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
sigs.k8s.io/yaml
sigs.k8s.io/yaml/goyaml.v2
sigs.k8s.io/yaml/goyaml.v3
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
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-20251205084952-33d5b5ea8232
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713

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-20251205084952-33d5b5ea8232 h1:6eggXHuRQOWaqmmuxW5mQSIXLZhB4irR/GJ59MixkKY=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232/go.mod h1:+CUhxuWB8uMYIoiXwofuLIXPyiNnwmoZlH90KWAE5Ew=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713 h1:xDbz5etX5h6foQDgpT9ukTo2I65b6q32Nu9do5nBPk8=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713/go.mod h1:CqHnvltrng2O40hNGVl56qcAhv7tiXK3SKx47LKyE/A=
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-20251205084952-33d5b5ea8232
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
## explicit; go 1.24.0
github.com/devtron-labs/common-lib/blob-storage
github.com/devtron-labs/common-lib/constants
Expand Down Expand Up @@ -1199,4 +1199,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
## explicit; go 1.22
sigs.k8s.io/yaml
sigs.k8s.io/yaml/goyaml.v2
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
2 changes: 1 addition & 1 deletion common-lib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ require (
github.com/prometheus/client_golang v1.22.0
github.com/robfig/cron/v3 v3.0.1
github.com/stretchr/testify v1.10.0
github.com/vmware-tanzu/velero v1.14.1
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
Expand Down Expand Up @@ -97,7 +98,6 @@ require (
github.com/moby/sys/atomicwriter v0.1.0 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions common-lib/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/foxcpp/go-mockdns v1.1.0 h1:jI0rD8M0wuYAxL7r/ynTrCQQq0BVqfB99Vgk7DlmewI=
github.com/foxcpp/go-mockdns v1.1.0/go.mod h1:IhLeSFGed3mJIAXPH2aiRQB+kqz7oqu8ld2qVbOu7Wk=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
Expand Down Expand Up @@ -375,6 +374,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/vmware-tanzu/velero v1.14.1 h1:HYj73scn7ZqtfTanjW/X4W0Hn3w/qcfoRbrHCWM52iI=
github.com/vmware-tanzu/velero v1.14.1/go.mod h1:/OzHzTvbevkkX+bK/BS4AgYMv6nKuOgsybuuvLWkSS0=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
Expand Down Expand Up @@ -494,7 +495,6 @@ golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
15 changes: 15 additions & 0 deletions common-lib/pubsub-lib/JetStreamUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ const (
COST_MODULE_GPU_INSTALLATION_TOPIC string = "COST_MODULE_GPU_INSTALLATION_TOPIC"
COST_MODULE_GPU_INSTALLATION_GROUP string = "COST_MODULE_GPU_INSTALLATION_GROUP"
COST_MODULE_GPU_INSTALLATION_DURABLE string = "COST_MODULE_GPU_INSTALLATION_DURABLE"
STORAGE_MODULE_TOPIC string = "STORAGE_MODULE_TOPIC"
STORAGE_MODULE_GROUP string = "STORAGE_MODULE_GROUP"
STORAGE_MODULE_DURABLE string = "STORAGE_MODULE_DURABLE"
STORAGE_VELERO_INSTALL_TOPIC string = "STORAGE_VELERO_INSTALL_TOPIC"
STORAGE_VELERO_INSTALL_GROUP string = "STORAGE_VELERO_INSTALL_GROUP"
STORAGE_VELERO_INSTALL_DURABLE string = "STORAGE_VELERO_INSTALL_DURABLE"
STORAGE_VELERO_POST_INSTALLATION_TOPIC string = "STORAGE_VELERO_POST_INSTALLATION_TOPIC"
STORAGE_VELERO_POST_INSTALLATION_GROUP string = "STORAGE_VELERO_POST_INSTALLATION_GROUP"
STORAGE_VELERO_POST_INSTALLATION_DURABLE string = "STORAGE_VELERO_POST_INSTALLATION_DURABLE"
)

type NatsTopic struct {
Expand Down Expand Up @@ -187,6 +196,9 @@ var natsTopicMapping = map[string]NatsTopic{
INFRA_HELM_RELEASE_ACTION_TOPIC: {topicName: INFRA_HELM_RELEASE_ACTION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: INFRA_HELM_RELEASE_ACTION_GROUP, consumerName: INFRA_HELM_RELEASE_ACTION_DURABLE},
COST_MODULE_INSTALLATION_TOPIC: {topicName: COST_MODULE_INSTALLATION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: COST_MODULE_INSTALLATION_GROUP, consumerName: COST_MODULE_INSTALLATION_DURABLE},
COST_MODULE_GPU_INSTALLATION_TOPIC: {topicName: COST_MODULE_GPU_INSTALLATION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: COST_MODULE_GPU_INSTALLATION_GROUP, consumerName: COST_MODULE_GPU_INSTALLATION_DURABLE},
STORAGE_MODULE_TOPIC: {topicName: STORAGE_MODULE_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: STORAGE_MODULE_GROUP, consumerName: STORAGE_MODULE_DURABLE},
STORAGE_VELERO_INSTALL_TOPIC: {topicName: STORAGE_VELERO_INSTALL_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: STORAGE_VELERO_INSTALL_GROUP, consumerName: STORAGE_VELERO_INSTALL_DURABLE},
STORAGE_VELERO_POST_INSTALLATION_TOPIC: {topicName: STORAGE_VELERO_POST_INSTALLATION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: STORAGE_VELERO_POST_INSTALLATION_GROUP, consumerName: STORAGE_VELERO_POST_INSTALLATION_DURABLE},
}

var NatsStreamWiseConfigMapping = map[string]NatsStreamConfig{
Expand Down Expand Up @@ -231,6 +243,9 @@ var NatsConsumerWiseConfigMapping = map[string]NatsConsumerConfig{
INFRA_HELM_RELEASE_ACTION_DURABLE: {},
COST_MODULE_INSTALLATION_DURABLE: {},
COST_MODULE_GPU_INSTALLATION_DURABLE: {},
STORAGE_MODULE_DURABLE: {},
STORAGE_VELERO_INSTALL_DURABLE: {},
STORAGE_VELERO_POST_INSTALLATION_DURABLE: {},
}

// getConsumerConfigMap will fetch the consumer wise config from the json string
Expand Down
3 changes: 1 addition & 2 deletions common-lib/utils/k8s/K8sService.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ type K8sService interface {
GetResourceIf(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error)
FetchConnectionStatusForCluster(k8sClientSet *kubernetes.Clientset) error
CreateK8sClientSet(restConfig *rest.Config) (*kubernetes.Clientset, error)
CreateOrUpdateSecretByName(client *v12.CoreV1Client, namespace, uniqueSecretName string, secretLabel map[string]string, secretData map[string]string) error

CreateOrUpdateSecretByName(client *v12.CoreV1Client, namespace, uniqueSecretName string, secretLabel map[string]string, dataString map[string]string, data map[string][]byte) error
// below functions are exposed for K8sUtilExtended

CreateNsWithLabels(namespace string, labels map[string]string, client *v12.CoreV1Client) (ns *v1.Namespace, err error)
Expand Down
11 changes: 8 additions & 3 deletions common-lib/utils/k8s/K8sUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ func (impl *K8sServiceImpl) GetPodListByLabel(namespace, label string, clientSet
return podList.Items, nil
}

func (impl *K8sServiceImpl) CreateOrUpdateSecretByName(client *v12.CoreV1Client, namespace, uniqueSecretName string, secretLabel map[string]string, secretData map[string]string) error {
func (impl *K8sServiceImpl) CreateOrUpdateSecretByName(client *v12.CoreV1Client, namespace, uniqueSecretName string, secretLabel map[string]string, dataString map[string]string, data map[string][]byte) error {

secret, err := impl.GetSecret(namespace, uniqueSecretName, client)
statusError, ok := err.(*errors.StatusError)
Expand All @@ -1361,13 +1361,18 @@ func (impl *K8sServiceImpl) CreateOrUpdateSecretByName(client *v12.CoreV1Client,
}

if ok && statusError != nil && statusError.Status().Code == http.StatusNotFound {
_, err = impl.CreateSecret(namespace, nil, uniqueSecretName, "", client, secretLabel, secretData)
_, err = impl.CreateSecret(namespace, data, uniqueSecretName, "", client, secretLabel, dataString)
if err != nil {
impl.logger.Errorw("Error in creating secret for chart repo", "uniqueSecretName", uniqueSecretName, "err", err)
return err
}
} else {
secret.StringData = secretData
if len(data) > 0 {
secret.Data = data
}
if len(dataString) > 0 {
secret.StringData = dataString
}
_, err = impl.UpdateSecret(namespace, secret, client)
if err != nil {
impl.logger.Errorw("Error in creating secret for chart repo", "uniqueSecretName", uniqueSecretName, "err", err)
Expand Down
Loading