From 9767c87e2eb2be3c3410cff67525bade71b32493 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 17:37:21 +0530 Subject: [PATCH 01/26] tekton version change with launch ui --- server/data/store-apps/app_list.yaml | 3 ++- .../conf/{tekton-v0.1.5.yaml => tekton-v0.1.7.yaml} | 4 ++-- ...ekton-v0.1.5_template.yaml => tekton-v0.1.7_template.yaml} | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename server/data/store-apps/conf/{tekton-v0.1.5.yaml => tekton-v0.1.7.yaml} (86%) rename server/data/store-apps/conf/values/{tekton-v0.1.5_template.yaml => tekton-v0.1.7_template.yaml} (100%) diff --git a/server/data/store-apps/app_list.yaml b/server/data/store-apps/app_list.yaml index af06912f..21b95946 100644 --- a/server/data/store-apps/app_list.yaml +++ b/server/data/store-apps/app_list.yaml @@ -4,8 +4,9 @@ enabledApps: - crossplane-v1.0.1 - testkube-v1.0.0 - testkube-v1.0.1 - - tekton-v0.1.5 + - tekton-v0.1.7 disabledApps: - tekton-v0.1.1 - tekton-v0.1.4 + - tekton-v0.1.5 diff --git a/server/data/store-apps/conf/tekton-v0.1.5.yaml b/server/data/store-apps/conf/tekton-v0.1.7.yaml similarity index 86% rename from server/data/store-apps/conf/tekton-v0.1.5.yaml rename to server/data/store-apps/conf/tekton-v0.1.7.yaml index a11473e0..7f6c42bf 100644 --- a/server/data/store-apps/conf/tekton-v0.1.5.yaml +++ b/server/data/store-apps/conf/tekton-v0.1.7.yaml @@ -6,12 +6,12 @@ RepoName: "tools" RepoURL: "https://kube-tarian.github.io/helmrepo-supporting-tools" Namespace: "tekton" ReleaseName: "tekton" -Version: "0.1.5" +Version: "0.1.7" PluginName: "Tekton" PluginDescription: "Configure Build pipeline with Tekton" CreateNamespace: true Icon: "tekton.svg" -LaunchURL: https://tekton.{{.DomainName}}/tekton/ +LaunchURL: https://tekton.{{.DomainName}}/ LaunchUIDescription: "Intelops Tekton" LaunchUIIcon: "tekton.svg" OverrideValues: diff --git a/server/data/store-apps/conf/values/tekton-v0.1.5_template.yaml b/server/data/store-apps/conf/values/tekton-v0.1.7_template.yaml similarity index 100% rename from server/data/store-apps/conf/values/tekton-v0.1.5_template.yaml rename to server/data/store-apps/conf/values/tekton-v0.1.7_template.yaml From 69057dd29d2c421861b32a4feb5dd016b6db6ff9 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 18:09:31 +0530 Subject: [PATCH 02/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 6 ++++++ capten/config-worker/internal/file_util/file_util.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 4da34c6e..ea529a88 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -71,6 +71,9 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to replace the file") } + fmt.Println("clusterValuesFile => ", clusterValuesFile) + fmt.Println("defaultAppListFile =>", defaultAppListFile) + defaultAppValPath := filepath.Join(templateRepo, cp.pluginConfig.ClusterEndpointUpdates.DefaultAppValuesPath) clusterDefaultAppValPath := filepath.Join(customerRepo, cp.pluginConfig.ClusterEndpointUpdates.ClusterDefaultAppValuesPath, req.ManagedClusterName) @@ -79,6 +82,9 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to sync default app value files") } + fmt.Println("defaultAppValPath =>", defaultAppValPath) + fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) + templateValues := cp.prepareTemplateVaules(req.ManagedClusterName) if err := fileutil.UpdateFilesInFolderWithTempaltes(clusterDefaultAppValPath, templateValues); err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update default app template values") diff --git a/capten/config-worker/internal/file_util/file_util.go b/capten/config-worker/internal/file_util/file_util.go index 250f38dc..b0b4a77b 100644 --- a/capten/config-worker/internal/file_util/file_util.go +++ b/capten/config-worker/internal/file_util/file_util.go @@ -2,6 +2,7 @@ package fileutil import ( "bytes" + "fmt" "html/template" "io" "os" @@ -33,6 +34,8 @@ func SyncFiles(sourceFolder, destinationFolder string) error { return err } } + + fmt.Println("File => ", file.Name()) } return nil } From d24598a0e4c656c8f72e094553832a74ea6cf2e6 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 18:31:57 +0530 Subject: [PATCH 03/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 10 ++++------ capten/config-worker/internal/file_util/file_util.go | 3 +++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index ea529a88..85d5e08c 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -66,25 +66,23 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. clusterValuesFile := filepath.Join(customerRepo, cp.pluginConfig.ClusterEndpointUpdates.ClusterValuesFile) defaultAppListFile := filepath.Join(templateRepo, cp.pluginConfig.ClusterEndpointUpdates.DefaultAppListFile) + fmt.Println("clusterValuesFile => ", clusterValuesFile) + fmt.Println("defaultAppListFile =>", defaultAppListFile) err = updateClusterEndpointDetials(clusterValuesFile, req.ManagedClusterName, endpoint, defaultAppListFile) if err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to replace the file") } - fmt.Println("clusterValuesFile => ", clusterValuesFile) - fmt.Println("defaultAppListFile =>", defaultAppListFile) - defaultAppValPath := filepath.Join(templateRepo, cp.pluginConfig.ClusterEndpointUpdates.DefaultAppValuesPath) clusterDefaultAppValPath := filepath.Join(customerRepo, cp.pluginConfig.ClusterEndpointUpdates.ClusterDefaultAppValuesPath, req.ManagedClusterName) + fmt.Println("defaultAppValPath =>", defaultAppValPath) + fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) err = cp.syncDefaultAppVaules(req.ManagedClusterName, defaultAppValPath, clusterDefaultAppValPath) if err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to sync default app value files") } - fmt.Println("defaultAppValPath =>", defaultAppValPath) - fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) - templateValues := cp.prepareTemplateVaules(req.ManagedClusterName) if err := fileutil.UpdateFilesInFolderWithTempaltes(clusterDefaultAppValPath, templateValues); err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update default app template values") diff --git a/capten/config-worker/internal/file_util/file_util.go b/capten/config-worker/internal/file_util/file_util.go index b0b4a77b..e8412740 100644 --- a/capten/config-worker/internal/file_util/file_util.go +++ b/capten/config-worker/internal/file_util/file_util.go @@ -77,9 +77,12 @@ func UpdateFilesInFolderWithTempaltes(folderPath string, templateValues map[stri return err } + fmt.Println("UpdateFilesInFolderWithTempaltes =>", UpdateFilesInFolderWithTempaltes) for _, file := range files { filePath := filepath.Join(folderPath, file.Name()) + fmt.Println("filePath =>", filePath) + fmt.Println("templateValues =>", templateValues) err := UpdateFileWithTempaltes(filePath, templateValues) if err != nil { return err From 32e760f5817e5683611783d5e0640f410096bf0a Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 18:43:42 +0530 Subject: [PATCH 04/26] minor changes --- .../config-worker/internal/crossplane/config_cluster_updates.go | 1 + 1 file changed, 1 insertion(+) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 85d5e08c..cfac820d 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -283,6 +283,7 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(clusterName string) map[string]st val := map[string]string{ "DomainName": cp.cfg.DomainName, "ClusterName": clusterName, + "NatsHost": "20.204.97.156", } return val } From 5f8790d58ca4fd9fb6633186fa930246ec8cd5d6 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 19:46:21 +0530 Subject: [PATCH 05/26] minor changes --- .../crossplane/config_cluster_updates.go | 37 ++++++++++++++++--- .../internal/file_util/file_util.go | 6 --- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index cfac820d..c6aeb63d 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" + "github.com/intelops/go-common/credentials" "github.com/intelops/go-common/logging" "github.com/kube-tarian/kad/capten/common-pkg/k8s" fileutil "github.com/kube-tarian/kad/capten/config-worker/internal/file_util" @@ -66,8 +67,6 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. clusterValuesFile := filepath.Join(customerRepo, cp.pluginConfig.ClusterEndpointUpdates.ClusterValuesFile) defaultAppListFile := filepath.Join(templateRepo, cp.pluginConfig.ClusterEndpointUpdates.DefaultAppListFile) - fmt.Println("clusterValuesFile => ", clusterValuesFile) - fmt.Println("defaultAppListFile =>", defaultAppListFile) err = updateClusterEndpointDetials(clusterValuesFile, req.ManagedClusterName, endpoint, defaultAppListFile) if err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to replace the file") @@ -76,8 +75,6 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. defaultAppValPath := filepath.Join(templateRepo, cp.pluginConfig.ClusterEndpointUpdates.DefaultAppValuesPath) clusterDefaultAppValPath := filepath.Join(customerRepo, cp.pluginConfig.ClusterEndpointUpdates.ClusterDefaultAppValuesPath, req.ManagedClusterName) - fmt.Println("defaultAppValPath =>", defaultAppValPath) - fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) err = cp.syncDefaultAppVaules(req.ManagedClusterName, defaultAppValPath, clusterDefaultAppValPath) if err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to sync default app value files") @@ -92,6 +89,8 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update cluster config template values") } + updateKubizAgentValaues(ctx) + logger.Infof("default app vaules synched for cluster %s", req.ManagedClusterName) err = cp.helper.AddFilesToRepo([]string{"."}) @@ -283,7 +282,6 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(clusterName string) map[string]st val := map[string]string{ "DomainName": cp.cfg.DomainName, "ClusterName": clusterName, - "NatsHost": "20.204.97.156", } return val } @@ -310,3 +308,32 @@ func readClusterDefaultApps(clusterDefaultAppsFile string) ([]DefaultApps, error return appList.DefaultApps, nil } + +func updateKubizAgentValaues(ctx context.Context) { + getConfigGlobalValues(ctx) + +} + +func getConfigGlobalValues(ctx context.Context) error { + log := logging.NewLogger() + credPath := fmt.Sprintf("%s/%s/%s", credentials.GenericCredentialType, "capten-config", "global-values") + credAdmin, err := credentials.NewCredentialAdmin(ctx) + if err != nil { + log.Audit("security", "storecred", "failed", "system", "failed to intialize credentials client for %s", credPath) + log.Errorf("failed to fetch credential for %s, %v", credPath, err) + return err + } + + cred, err := credAdmin.GetCredential(ctx, credentials.GenericCredentialType, "capten-config", "global-values") + if err != nil { + log.Audit("security", "storecred", "failed", "system", "failed to fetch crendential for %s", credPath) + log.Errorf("failed to fetch credential for %s, %v", credPath, err) + return err + } + + b, _ := json.Marshal(cred) + fmt.Printf("Credentials => \n %+v,\n", string(b)) + + log.Infof("fetched credential for entity %s", credPath) + return nil +} diff --git a/capten/config-worker/internal/file_util/file_util.go b/capten/config-worker/internal/file_util/file_util.go index e8412740..250f38dc 100644 --- a/capten/config-worker/internal/file_util/file_util.go +++ b/capten/config-worker/internal/file_util/file_util.go @@ -2,7 +2,6 @@ package fileutil import ( "bytes" - "fmt" "html/template" "io" "os" @@ -34,8 +33,6 @@ func SyncFiles(sourceFolder, destinationFolder string) error { return err } } - - fmt.Println("File => ", file.Name()) } return nil } @@ -77,12 +74,9 @@ func UpdateFilesInFolderWithTempaltes(folderPath string, templateValues map[stri return err } - fmt.Println("UpdateFilesInFolderWithTempaltes =>", UpdateFilesInFolderWithTempaltes) for _, file := range files { filePath := filepath.Join(folderPath, file.Name()) - fmt.Println("filePath =>", filePath) - fmt.Println("templateValues =>", templateValues) err := UpdateFileWithTempaltes(filePath, templateValues) if err != nil { return err From 086f78c13238630b1e44f15bb73e1cd5fc131ad3 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 20:38:44 +0530 Subject: [PATCH 06/26] minor changes --- .../crossplane/config_cluster_updates.go | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index c6aeb63d..e2a7ec99 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -89,6 +89,7 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update cluster config template values") } + fmt.Println("defaultAppValPath =>", defaultAppValPath) updateKubizAgentValaues(ctx) logger.Infof("default app vaules synched for cluster %s", req.ManagedClusterName) @@ -309,31 +310,37 @@ func readClusterDefaultApps(clusterDefaultAppsFile string) ([]DefaultApps, error return appList.DefaultApps, nil } -func updateKubizAgentValaues(ctx context.Context) { - getConfigGlobalValues(ctx) +func updateKubizAgentValaues(ctx context.Context) error { + creds, err := getConfigGlobalValues(ctx) + if err != nil { + return err + } + + if v, ok := creds["LoadBalancerHost"]; ok { + fmt.Println("LoadBalancerHost") + fmt.Println(v) + } + return nil } -func getConfigGlobalValues(ctx context.Context) error { +func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { log := logging.NewLogger() credPath := fmt.Sprintf("%s/%s/%s", credentials.GenericCredentialType, "capten-config", "global-values") credAdmin, err := credentials.NewCredentialAdmin(ctx) if err != nil { log.Audit("security", "storecred", "failed", "system", "failed to intialize credentials client for %s", credPath) log.Errorf("failed to fetch credential for %s, %v", credPath, err) - return err + return nil, err } cred, err := credAdmin.GetCredential(ctx, credentials.GenericCredentialType, "capten-config", "global-values") if err != nil { log.Audit("security", "storecred", "failed", "system", "failed to fetch crendential for %s", credPath) log.Errorf("failed to fetch credential for %s, %v", credPath, err) - return err + return nil, err } - b, _ := json.Marshal(cred) - fmt.Printf("Credentials => \n %+v,\n", string(b)) - log.Infof("fetched credential for entity %s", credPath) - return nil + return cred, nil } From ca1d0aeae68847061ddc8314913b81d9bdae8d0c Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 20:49:11 +0530 Subject: [PATCH 07/26] minor changes --- .../config-worker/internal/crossplane/config_cluster_updates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index e2a7ec99..7c4e7e56 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -89,7 +89,7 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update cluster config template values") } - fmt.Println("defaultAppValPath =>", defaultAppValPath) + fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) updateKubizAgentValaues(ctx) logger.Infof("default app vaules synched for cluster %s", req.ManagedClusterName) From 3ec5d6bfd064ab34b4a525c46b961bc53e63c93b Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 20:57:16 +0530 Subject: [PATCH 08/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 7c4e7e56..df59cf36 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -90,7 +90,7 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. } fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) - updateKubizAgentValaues(ctx) + updateKubizAgentValaues(ctx, clusterDefaultAppValPath) logger.Infof("default app vaules synched for cluster %s", req.ManagedClusterName) @@ -310,7 +310,16 @@ func readClusterDefaultApps(clusterDefaultAppsFile string) ([]DefaultApps, error return appList.DefaultApps, nil } -func updateKubizAgentValaues(ctx context.Context) error { +func updateKubizAgentValaues(ctx context.Context, appValuesDir string) error { + data, err := os.ReadFile(filepath.Join(appValuesDir, "kubviz-agent-values.yaml")) + if err != nil { + fmt.Println("Error =>", err) + return err + } + + fmt.Println("kubviz-agent-values.yaml") + fmt.Println(string(data)) + creds, err := getConfigGlobalValues(ctx) if err != nil { return err From 07c46e5d8f531fdb5ceac63a2c5ddda2ebf24157 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 21:39:33 +0530 Subject: [PATCH 09/26] minor changes --- .../config-worker/internal/crossplane/config_cluster_updates.go | 1 + 1 file changed, 1 insertion(+) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index df59cf36..cb9d04ac 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -283,6 +283,7 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(clusterName string) map[string]st val := map[string]string{ "DomainName": cp.cfg.DomainName, "ClusterName": clusterName, + "nats.host": "test", } return val } From b55d9f9c016383609d3f24d48208759760908f93 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 22:12:56 +0530 Subject: [PATCH 10/26] minor changes --- .../crossplane/config_cluster_updates.go | 48 ++++++++----------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index cb9d04ac..dfa27853 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -80,7 +80,11 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to sync default app value files") } - templateValues := cp.prepareTemplateVaules(req.ManagedClusterName) + templateValues, err := cp.prepareTemplateVaules(ctx, req.ManagedClusterName) + if err != nil { + return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to prepare template values") + } + if err := fileutil.UpdateFilesInFolderWithTempaltes(clusterDefaultAppValPath, templateValues); err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update default app template values") } @@ -90,7 +94,6 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. } fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) - updateKubizAgentValaues(ctx, clusterDefaultAppValPath) logger.Infof("default app vaules synched for cluster %s", req.ManagedClusterName) @@ -279,13 +282,25 @@ func removeClusterValues(valuesFileName, clusterName string) error { return err } -func (cp *CrossPlaneApp) prepareTemplateVaules(clusterName string) map[string]string { +func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName string) (map[string]string, error) { val := map[string]string{ "DomainName": cp.cfg.DomainName, "ClusterName": clusterName, - "nats.host": "test", } - return val + cred, err := getConfigGlobalValues(ctx) + if err != nil { + return nil, err + } + + for key, value := range cred { + val[key] = value + } + + fmt.Println("values") + b, _ := json.Marshal(val) + fmt.Println(string(b)) + + return val, nil } func prepareClusterData(clusterName, endpoint string, defaultApps []DefaultApps) Cluster { @@ -311,29 +326,6 @@ func readClusterDefaultApps(clusterDefaultAppsFile string) ([]DefaultApps, error return appList.DefaultApps, nil } -func updateKubizAgentValaues(ctx context.Context, appValuesDir string) error { - data, err := os.ReadFile(filepath.Join(appValuesDir, "kubviz-agent-values.yaml")) - if err != nil { - fmt.Println("Error =>", err) - return err - } - - fmt.Println("kubviz-agent-values.yaml") - fmt.Println(string(data)) - - creds, err := getConfigGlobalValues(ctx) - if err != nil { - return err - } - - if v, ok := creds["LoadBalancerHost"]; ok { - fmt.Println("LoadBalancerHost") - fmt.Println(v) - } - - return nil -} - func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { log := logging.NewLogger() credPath := fmt.Sprintf("%s/%s/%s", credentials.GenericCredentialType, "capten-config", "global-values") From 64ecb15d39c90b4f7ec69259b4d398bd5ef86f97 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Sun, 14 Jan 2024 22:46:39 +0530 Subject: [PATCH 11/26] minor changes --- capten/agent/internal/crossplane/package_providers.go | 3 --- .../internal/crossplane/config_cluster_updates.go | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/capten/agent/internal/crossplane/package_providers.go b/capten/agent/internal/crossplane/package_providers.go index 7a305882..2a2b42e9 100644 --- a/capten/agent/internal/crossplane/package_providers.go +++ b/capten/agent/internal/crossplane/package_providers.go @@ -165,9 +165,6 @@ func (h *ProvidersSyncHandler) updateCrossplaneProvider(k8sProviders []model.Pro ProviderName: dbProvider.ProviderName, } - v, _ := json.Marshal(provider) - fmt.Println("Provider ===>" + string(v)) - if err := h.dbStore.UpdateCrossplaneProvider(&provider); err != nil { h.log.Errorf("failed to update provider %s details in db, %v", k8sProvider.Name, err) continue diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index dfa27853..2dc22205 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -93,8 +93,6 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update cluster config template values") } - fmt.Println("clusterDefaultAppValPath =>", clusterDefaultAppValPath) - logger.Infof("default app vaules synched for cluster %s", req.ManagedClusterName) err = cp.helper.AddFilesToRepo([]string{"."}) @@ -287,6 +285,7 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName "DomainName": cp.cfg.DomainName, "ClusterName": clusterName, } + cred, err := getConfigGlobalValues(ctx) if err != nil { return nil, err @@ -296,10 +295,6 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName val[key] = value } - fmt.Println("values") - b, _ := json.Marshal(val) - fmt.Println(string(b)) - return val, nil } From ae2ce1ead0f2cd2fb0365ae4c7a3312d87c63cb2 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 00:10:06 +0530 Subject: [PATCH 12/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 2dc22205..d17bbf74 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -295,6 +295,10 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName val[key] = value } + fmt.Println("values") + b, _ := json.Marshal(val) + fmt.Println(string(b)) + return val, nil } From 2e3cdca07e7d44b8c2ec318f678d2b5c3d314d13 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:01:29 +0530 Subject: [PATCH 13/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index d17bbf74..e3748cbd 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -342,6 +342,12 @@ func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { return nil, err } + byteCred, _ := json.Marshal(cred["global-values"]) + + globalValues := make(map[string]string) + + json.Unmarshal(byteCred, &globalValues) + log.Infof("fetched credential for entity %s", credPath) - return cred, nil + return globalValues, nil } From 8f2543b302590dace0aeab73873e83ec17ba27a5 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:12:57 +0530 Subject: [PATCH 14/26] minor changes --- .../crossplane/config_cluster_updates.go | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index e3748cbd..1106f34a 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -342,11 +342,28 @@ func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { return nil, err } - byteCred, _ := json.Marshal(cred["global-values"]) + fmt.Println("cred") + fmt.Println(cred) + + fmt.Println("cred[global-values]") + fmt.Println(cred["global-values"]) + + byteCred, err := json.Marshal(cred["global-values"]) + if err != nil { + fmt.Println("byteCred error => \n" + err.Error()) + } + + fmt.Println("byteCred") + fmt.Println(byteCred) globalValues := make(map[string]string) - json.Unmarshal(byteCred, &globalValues) + if err := json.Unmarshal(byteCred, &globalValues); err != nil { + fmt.Println("byteCred error => \n" + err.Error()) + } + + fmt.Println("globalValues") + fmt.Println(globalValues) log.Infof("fetched credential for entity %s", credPath) return globalValues, nil From bdf40e51cfd2fce39431e23a5ac75fd6153acfda Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:23:11 +0530 Subject: [PATCH 15/26] minor changes --- .../crossplane/config_cluster_updates.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 1106f34a..b8095d1f 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -342,23 +342,9 @@ func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { return nil, err } - fmt.Println("cred") - fmt.Println(cred) - - fmt.Println("cred[global-values]") - fmt.Println(cred["global-values"]) - - byteCred, err := json.Marshal(cred["global-values"]) - if err != nil { - fmt.Println("byteCred error => \n" + err.Error()) - } - - fmt.Println("byteCred") - fmt.Println(byteCred) - globalValues := make(map[string]string) - if err := json.Unmarshal(byteCred, &globalValues); err != nil { + if err := json.Unmarshal([]byte(cred["global-values"]), &globalValues); err != nil { fmt.Println("byteCred error => \n" + err.Error()) } From 64284661eb8a0867a1da5df6e1ad1a7b6b960574 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:28:49 +0530 Subject: [PATCH 16/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index b8095d1f..f3a60b75 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -344,6 +344,9 @@ func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { globalValues := make(map[string]string) + fmt.Println("global-valaues") + fmt.Println(cred["global-values"]) + if err := json.Unmarshal([]byte(cred["global-values"]), &globalValues); err != nil { fmt.Println("byteCred error => \n" + err.Error()) } From eebe061478a7763e8f22b7c22295737db202d14c Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:38:58 +0530 Subject: [PATCH 17/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index f3a60b75..fb4fb3e9 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/intelops/go-common/credentials" "github.com/intelops/go-common/logging" @@ -344,12 +345,19 @@ func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { globalValues := make(map[string]string) + lines := strings.Split(cred["global-values"], "\n") + for _, line := range lines { + parts := strings.SplitN(line, ":", 2) + if len(parts) == 2 { + key, value := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]) + globalValues[key] = value + } + } + fmt.Println("global-valaues") fmt.Println(cred["global-values"]) - if err := json.Unmarshal([]byte(cred["global-values"]), &globalValues); err != nil { - fmt.Println("byteCred error => \n" + err.Error()) - } + fmt.Println("********") fmt.Println("globalValues") fmt.Println(globalValues) From 0d95cc0add03ad4f8fa42cd453265835cd762134 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:46:46 +0530 Subject: [PATCH 18/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index fb4fb3e9..2584b75f 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -295,7 +295,9 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName for key, value := range cred { val[key] = value } - + fmt.Println("XXXXXXX") + fmt.Println(val) + fmt.Println("-----------") fmt.Println("values") b, _ := json.Marshal(val) fmt.Println(string(b)) From c1a05149872d1f2afc2a763a6b525d3fcd16a82b Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:51:41 +0530 Subject: [PATCH 19/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 2584b75f..0e05e5d6 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -292,12 +292,13 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName return nil, err } - for key, value := range cred { - val[key] = value - } fmt.Println("XXXXXXX") fmt.Println(val) fmt.Println("-----------") + + for key, value := range cred { + val[key] = value + } fmt.Println("values") b, _ := json.Marshal(val) fmt.Println(string(b)) From 910c527f765532b87c9c1f06f751ab5d4990f453 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 01:59:50 +0530 Subject: [PATCH 20/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 0e05e5d6..c6df65cf 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -292,16 +292,9 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName return nil, err } - fmt.Println("XXXXXXX") - fmt.Println(val) - fmt.Println("-----------") - for key, value := range cred { val[key] = value } - fmt.Println("values") - b, _ := json.Marshal(val) - fmt.Println(string(b)) return val, nil } @@ -357,14 +350,6 @@ func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { } } - fmt.Println("global-valaues") - fmt.Println(cred["global-values"]) - - fmt.Println("********") - - fmt.Println("globalValues") - fmt.Println(globalValues) - log.Infof("fetched credential for entity %s", credPath) return globalValues, nil } From e2462a62c839b4c50ad745b40ee85fbbe2c92a75 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 21:58:26 +0530 Subject: [PATCH 21/26] minor changes --- .../crossplane/config_cluster_updates.go | 57 +++++++------------ 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index c6df65cf..9c07ef6a 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -6,10 +6,9 @@ import ( "fmt" "os" "path/filepath" - "strings" - "github.com/intelops/go-common/credentials" "github.com/intelops/go-common/logging" + "github.com/kube-tarian/kad/capten/common-pkg/credential" "github.com/kube-tarian/kad/capten/common-pkg/k8s" fileutil "github.com/kube-tarian/kad/capten/config-worker/internal/file_util" "github.com/kube-tarian/kad/capten/model" @@ -287,15 +286,31 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName "ClusterName": clusterName, } - cred, err := getConfigGlobalValues(ctx) + cred, err := credential.GetClusterGlobalValues(ctx) if err != nil { return nil, err } - for key, value := range cred { - val[key] = value + b, err := yaml.Marshal(cred) + if err != nil { + fmt.Println(err.Error()) + } + fmt.Println("B => \n" + string(b)) + + map1 := make(map[string]string) + + err = yaml.Unmarshal(b, &map1) + if err != nil { + fmt.Println(err.Error()) } + fmt.Println("Map1") + fmt.Println(map1) + + // for key, value := range cred { + // val[key] = value + // } + return val, nil } @@ -321,35 +336,3 @@ func readClusterDefaultApps(clusterDefaultAppsFile string) ([]DefaultApps, error return appList.DefaultApps, nil } - -func getConfigGlobalValues(ctx context.Context) (map[string]string, error) { - log := logging.NewLogger() - credPath := fmt.Sprintf("%s/%s/%s", credentials.GenericCredentialType, "capten-config", "global-values") - credAdmin, err := credentials.NewCredentialAdmin(ctx) - if err != nil { - log.Audit("security", "storecred", "failed", "system", "failed to intialize credentials client for %s", credPath) - log.Errorf("failed to fetch credential for %s, %v", credPath, err) - return nil, err - } - - cred, err := credAdmin.GetCredential(ctx, credentials.GenericCredentialType, "capten-config", "global-values") - if err != nil { - log.Audit("security", "storecred", "failed", "system", "failed to fetch crendential for %s", credPath) - log.Errorf("failed to fetch credential for %s, %v", credPath, err) - return nil, err - } - - globalValues := make(map[string]string) - - lines := strings.Split(cred["global-values"], "\n") - for _, line := range lines { - parts := strings.SplitN(line, ":", 2) - if len(parts) == 2 { - key, value := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]) - globalValues[key] = value - } - } - - log.Infof("fetched credential for entity %s", credPath) - return globalValues, nil -} From b490e33386b06b27acab1f46996c75517b8dffa4 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 22:33:25 +0530 Subject: [PATCH 22/26] minor changes --- .../config-worker/internal/crossplane/config_cluster_updates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 9c07ef6a..a2e8f03c 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -297,7 +297,7 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName } fmt.Println("B => \n" + string(b)) - map1 := make(map[string]string) + map1 := make(map[string]interface{}) err = yaml.Unmarshal(b, &map1) if err != nil { From 26b09d21bebbc8592a8833a21541e7595e7a84c3 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 22:52:42 +0530 Subject: [PATCH 23/26] minor changes --- .../crossplane/config_cluster_updates.go | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index a2e8f03c..2c230930 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/intelops/go-common/logging" "github.com/kube-tarian/kad/capten/common-pkg/credential" @@ -291,21 +292,28 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName return nil, err } - b, err := yaml.Marshal(cred) - if err != nil { - fmt.Println(err.Error()) + var configMap map[string]interface{} + + decoder := yaml.NewDecoder(strings.NewReader(cred)) + if err := decoder.Decode(&configMap); err != nil { + return nil, err } - fmt.Println("B => \n" + string(b)) - map1 := make(map[string]interface{}) + // b, err := yaml.Marshal(cred) + // if err != nil { + // fmt.Println(err.Error()) + // } + // fmt.Println("B => \n" + string(b)) + + // map1 := make(map[string]interface{}) - err = yaml.Unmarshal(b, &map1) - if err != nil { - fmt.Println(err.Error()) - } + // err = yaml.Unmarshal(b, &map1) + // if err != nil { + // fmt.Println(err.Error()) + // } - fmt.Println("Map1") - fmt.Println(map1) + fmt.Println("configMap") + fmt.Println(configMap) // for key, value := range cred { // val[key] = value From ac88125f298036321be277a9ae695ddf02b5c606 Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 23:06:07 +0530 Subject: [PATCH 24/26] minor changes --- .../crossplane/config_cluster_updates.go | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 2c230930..99a0e3b8 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -86,6 +86,10 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to prepare template values") } + fmt.Println("templateValues") + x, _ := json.Marshal(templateValues) + fmt.Println(string(x)) + if err := fileutil.UpdateFilesInFolderWithTempaltes(clusterDefaultAppValPath, templateValues); err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update default app template values") } @@ -292,32 +296,16 @@ func (cp *CrossPlaneApp) prepareTemplateVaules(ctx context.Context, clusterName return nil, err } - var configMap map[string]interface{} + var gvMap map[string]interface{} decoder := yaml.NewDecoder(strings.NewReader(cred)) - if err := decoder.Decode(&configMap); err != nil { + if err := decoder.Decode(&gvMap); err != nil { return nil, err } - // b, err := yaml.Marshal(cred) - // if err != nil { - // fmt.Println(err.Error()) - // } - // fmt.Println("B => \n" + string(b)) - - // map1 := make(map[string]interface{}) - - // err = yaml.Unmarshal(b, &map1) - // if err != nil { - // fmt.Println(err.Error()) - // } - - fmt.Println("configMap") - fmt.Println(configMap) - - // for key, value := range cred { - // val[key] = value - // } + for key, value := range gvMap { + val[key] = value.(string) + } return val, nil } From 3f79037f550a686e9f41b6728b15ac3adc4b53ca Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 23:13:45 +0530 Subject: [PATCH 25/26] minor changes --- .../config-worker/internal/crossplane/config_cluster_updates.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index 99a0e3b8..ee41f8b8 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -86,6 +86,8 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to prepare template values") } + templateValues["NatsHost"] = templateValues["LoadBalancerHost"] + fmt.Println("templateValues") x, _ := json.Marshal(templateValues) fmt.Println(string(x)) From ce950694289c3dc16389414fd3f7caf477df54df Mon Sep 17 00:00:00 2001 From: anil-sarodh Date: Mon, 15 Jan 2024 23:20:19 +0530 Subject: [PATCH 26/26] minor changes --- .../internal/crossplane/config_cluster_updates.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/capten/config-worker/internal/crossplane/config_cluster_updates.go b/capten/config-worker/internal/crossplane/config_cluster_updates.go index ee41f8b8..99791241 100644 --- a/capten/config-worker/internal/crossplane/config_cluster_updates.go +++ b/capten/config-worker/internal/crossplane/config_cluster_updates.go @@ -86,12 +86,6 @@ func (cp *CrossPlaneApp) configureClusterUpdate(ctx context.Context, req *model. return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to prepare template values") } - templateValues["NatsHost"] = templateValues["LoadBalancerHost"] - - fmt.Println("templateValues") - x, _ := json.Marshal(templateValues) - fmt.Println(string(x)) - if err := fileutil.UpdateFilesInFolderWithTempaltes(clusterDefaultAppValPath, templateValues); err != nil { return string(agentmodel.WorkFlowStatusFailed), errors.WithMessage(err, "failed to update default app template values") }