Skip to content

Commit 9746089

Browse files
authored
feat: ns label refactoring (#5882)
* updating common lib * common lib sync
1 parent 246c8cf commit 9746089

File tree

8 files changed

+65
-43
lines changed

8 files changed

+65
-43
lines changed

api/helm-app/service/HelmAppService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func (impl *HelmAppServiceImpl) checkIfNsExists(namespace string, clusterBean *c
609609
impl.logger.Errorw("error in getting k8s client", "err", err, "clusterHost", config.Host)
610610
return false, err
611611
}
612-
exists, err := impl.K8sUtil.CheckIfNsExists(namespace, v12Client)
612+
_, exists, err := impl.K8sUtil.GetNsIfExists(namespace, v12Client)
613613
if err != nil {
614614
if IsClusterUnReachableError(err) {
615615
impl.logger.Errorw("k8s cluster unreachable", "err", err)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
2222
github.com/deckarep/golang-set v1.8.0
2323
github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8
24-
github.com/devtron-labs/common-lib v0.16.1-0.20240923063129-ff2dc035435e
24+
github.com/devtron-labs/common-lib v0.16.1-0.20240923091856-41253742c214
2525
github.com/devtron-labs/go-bitbucket v0.9.60-beta
2626
github.com/devtron-labs/protos v0.0.3-0.20240802105333-92ee9bb85d80
2727
github.com/evanphx/json-patch v5.7.0+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ github.com/devtron-labs/argo-workflows/v3 v3.5.10 h1:6rxQOesOzDz6SgQCMDQNHaehsKF
794794
github.com/devtron-labs/argo-workflows/v3 v3.5.10/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
795795
github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 h1:2+Q7Jdhpo/uMiaQiZZzAh+ZX7wEJIFuMFG6DEiMuo64=
796796
github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8/go.mod h1:702R6WIf5y9UzKGoCGxQ+x3l5Ws+l0fXg2xlCpSGFZI=
797-
github.com/devtron-labs/common-lib v0.16.1-0.20240923063129-ff2dc035435e h1:siyAoJz9Nq26JrTzmSGd02EOmPV86tUgzgBW1Y5bSVU=
798-
github.com/devtron-labs/common-lib v0.16.1-0.20240923063129-ff2dc035435e/go.mod h1:I+B+0ZeOV1Qv8dE/uNAFXOhw7lxfD6FqK6KzTBLBY7E=
797+
github.com/devtron-labs/common-lib v0.16.1-0.20240923091856-41253742c214 h1:QBBienyRjnNw/IwVt8O4WxIQvQJUbqvLp51mQqfwcTM=
798+
github.com/devtron-labs/common-lib v0.16.1-0.20240923091856-41253742c214/go.mod h1:I+B+0ZeOV1Qv8dE/uNAFXOhw7lxfD6FqK6KzTBLBY7E=
799799
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
800800
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
801801
github.com/devtron-labs/protos v0.0.3-0.20240802105333-92ee9bb85d80 h1:xwbTeijNTf4/j1v+tSfwVqwLVnReas/NqEKeQHvSTys=

pkg/cluster/EnvironmentService.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (impl EnvironmentServiceImpl) Create(mappings *bean2.EnvironmentBean, userI
144144
}
145145
if len(model.Namespace) > 0 {
146146
cfg := clusterBean.GetClusterConfig()
147-
if err := impl.K8sUtil.CreateNsIfNotExists(model.Namespace, cfg); err != nil {
147+
if _, _, err := impl.K8sUtil.CreateNsIfNotExists(model.Namespace, cfg); err != nil {
148148
impl.logger.Errorw("error in creating ns", "ns", model.Namespace, "err", err)
149149
}
150150

@@ -282,7 +282,7 @@ func (impl EnvironmentServiceImpl) Update(mappings *bean2.EnvironmentBean, userI
282282
//namespace create if not exist
283283
if len(model.Namespace) > 0 {
284284
cfg := clusterBean.GetClusterConfig()
285-
if err := impl.K8sUtil.CreateNsIfNotExists(model.Namespace, cfg); err != nil {
285+
if _, _, err := impl.K8sUtil.CreateNsIfNotExists(model.Namespace, cfg); err != nil {
286286
impl.logger.Errorw("error in creating ns", "ns", model.Namespace, "err", err)
287287
}
288288
}

vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/LICENSE

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go

Lines changed: 36 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ github.com/devtron-labs/authenticator/jwt
344344
github.com/devtron-labs/authenticator/middleware
345345
github.com/devtron-labs/authenticator/oidc
346346
github.com/devtron-labs/authenticator/password
347-
# github.com/devtron-labs/common-lib v0.16.1-0.20240923063129-ff2dc035435e
347+
# github.com/devtron-labs/common-lib v0.16.1-0.20240923091856-41253742c214
348348
## explicit; go 1.21
349349
github.com/devtron-labs/common-lib/async
350350
github.com/devtron-labs/common-lib/blob-storage

wire_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)