From 7491919ad6b4b9e9c3b227e499a8f6a0e6957653 Mon Sep 17 00:00:00 2001 From: sol-dev-abhi Date: Tue, 8 Aug 2023 23:28:33 +0530 Subject: [PATCH 1/2] cassandra boolean value update fix --- capten/agent/pkg/agent/agent_cluster_apps_test.go | 5 +++-- capten/agent/pkg/capten-store/app_config_store.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/capten/agent/pkg/agent/agent_cluster_apps_test.go b/capten/agent/pkg/agent/agent_cluster_apps_test.go index ca61e71d..0b378275 100644 --- a/capten/agent/pkg/agent/agent_cluster_apps_test.go +++ b/capten/agent/pkg/agent/agent_cluster_apps_test.go @@ -64,8 +64,9 @@ func (suite *AgentTestSuite) Test_1_SyncApp() { req2.Data = &agentpb.SyncAppData{ Config: &agentpb.AppConfig{ - ReleaseName: "release2", - Icon: []byte{0x1, 0x2, 0x3, 0x4}, + ReleaseName: "release2", + PrivilegedNamespace: true, + Icon: []byte{0x1, 0x2, 0x3, 0x4}, }, Values: &agentpb.AppValues{ OverrideValues: override, diff --git a/capten/agent/pkg/capten-store/app_config_store.go b/capten/agent/pkg/capten-store/app_config_store.go index ce4a0c75..6bca072a 100644 --- a/capten/agent/pkg/capten-store/app_config_store.go +++ b/capten/agent/pkg/capten-store/app_config_store.go @@ -148,11 +148,11 @@ func formUpdateKvPairs(config *agentpb.SyncAppData) (string, bool) { if config.Config.CreateNamespace { params = append(params, - fmt.Sprintf("%s = 'true'", createNamespace)) + fmt.Sprintf("%s = true", createNamespace)) } if config.Config.PrivilegedNamespace { params = append(params, - fmt.Sprintf("%s = 'true'", privilegedNamespace)) + fmt.Sprintf("%s = true", privilegedNamespace)) } } From fc53ae06a796e9b864f51d8a207c01a8d916b063 Mon Sep 17 00:00:00 2001 From: sol-dev-abhi Date: Wed, 9 Aug 2023 11:12:50 +0530 Subject: [PATCH 2/2] removed brackets --- .../agent/pkg/capten-store/app_config_store.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/capten/agent/pkg/capten-store/app_config_store.go b/capten/agent/pkg/capten-store/app_config_store.go index 7e200021..4088baa5 100644 --- a/capten/agent/pkg/capten-store/app_config_store.go +++ b/capten/agent/pkg/capten-store/app_config_store.go @@ -130,16 +130,13 @@ func formUpdateKvPairs(config *agentpb.SyncAppData) (string, bool) { fmt.Sprintf("%s = '%s'", launchUiValues, string(config.Values.LaunchUIValues))) } - { - - if config.Config.CreateNamespace { - params = append(params, - fmt.Sprintf("%s = true", createNamespace)) - } - if config.Config.PrivilegedNamespace { - params = append(params, - fmt.Sprintf("%s = true", privilegedNamespace)) - } + if config.Config.CreateNamespace { + params = append(params, + fmt.Sprintf("%s = true", createNamespace)) + } + if config.Config.PrivilegedNamespace { + params = append(params, + fmt.Sprintf("%s = true", privilegedNamespace)) } if config.Config.LaunchURL != "" {