From f2ec0278733a71298d1ceec35e7e3ed8570eba80 Mon Sep 17 00:00:00 2001 From: Harish P Date: Tue, 8 Oct 2024 12:00:32 +0530 Subject: [PATCH 1/3] Added support for replication with minimal manifest Signed-off-by: Harish P --- pkg/utils/utils.go | 14 ++++++++++++++ samples/minimal-samples/powermax.yaml | 18 ++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 46bd14b56..88fed4be8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -922,6 +922,20 @@ func MinVersionCheck(minVersion string, version string) (bool, error) { func getClusterIDs(replica csmv1.Module) ([]string, error) { var clusterIDs []string + if replica.Components == nil { + // if we are entering this block then it is a minimal yaml and replication is enabled and we will set default cluster as self + components := make([]csmv1.ContainerTemplate, 0) + components = append(components, csmv1.ContainerTemplate{ + Name: ReplicationControllerManager, + }) + replica.Components = components + + replica.Components[0].Envs = append(replica.Components[0].Envs, corev1.EnvVar{ + Name: "TARGET_CLUSTERS_IDS", + Value: "self", //defaults to same cluster for the replication + }) + + } for _, comp := range replica.Components { if comp.Name == ReplicationControllerManager { for _, env := range comp.Envs { diff --git a/samples/minimal-samples/powermax.yaml b/samples/minimal-samples/powermax.yaml index 9705f4bf4..befe369e0 100644 --- a/samples/minimal-samples/powermax.yaml +++ b/samples/minimal-samples/powermax.yaml @@ -9,11 +9,13 @@ spec: configVersion: v2.12.0 forceRemoveDriver: true # These are the modules which are optional and can be enabled by specifying to enable/disable. - modules: - - name: authorization - # enable: Enable/Disable csm-authorization - enabled: false - # For Auth 2.0, use v2.0.0 as configVersion - configVersion: v1.11.0 - - name: resiliency - enabled: false +# modules: +# - name: authorization +# # enable: Enable/Disable csm-authorization +# enabled: false +# # For Auth 2.0, use v2.0.0 as configVersion +# configVersion: v1.11.0 +# - name: resiliency +# enabled: false +# - name: replication +# enabled: false From c350ae3d458e11103a2446e123f93f4e07fda6e4 Mon Sep 17 00:00:00 2001 From: Harish P Date: Tue, 8 Oct 2024 07:39:17 +0000 Subject: [PATCH 2/3] fixed lint issue --- pkg/utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 88fed4be8..abfe10947 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -932,7 +932,7 @@ func getClusterIDs(replica csmv1.Module) ([]string, error) { replica.Components[0].Envs = append(replica.Components[0].Envs, corev1.EnvVar{ Name: "TARGET_CLUSTERS_IDS", - Value: "self", //defaults to same cluster for the replication + Value: "self", // defaults to same cluster for the replication }) } From 4bb64067cbf75243e8116fc0590f298d6c160607 Mon Sep 17 00:00:00 2001 From: Harish P Date: Tue, 8 Oct 2024 11:07:12 +0000 Subject: [PATCH 3/3] fixed review comment --- samples/minimal-samples/powermax.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/minimal-samples/powermax.yaml b/samples/minimal-samples/powermax.yaml index befe369e0..cdd2ff201 100644 --- a/samples/minimal-samples/powermax.yaml +++ b/samples/minimal-samples/powermax.yaml @@ -9,13 +9,13 @@ spec: configVersion: v2.12.0 forceRemoveDriver: true # These are the modules which are optional and can be enabled by specifying to enable/disable. -# modules: -# - name: authorization -# # enable: Enable/Disable csm-authorization -# enabled: false -# # For Auth 2.0, use v2.0.0 as configVersion -# configVersion: v1.11.0 -# - name: resiliency -# enabled: false -# - name: replication -# enabled: false + modules: + - name: authorization + # enable: Enable/Disable csm-authorization + enabled: false + # For Auth 2.0, use v2.0.0 as configVersion + configVersion: v1.11.0 + - name: resiliency + enabled: false + - name: replication + enabled: false