From 565abb8724adf650aacd69f07568b27af6e7f4a9 Mon Sep 17 00:00:00 2001 From: Sivaanand Murugesan Date: Tue, 17 Sep 2024 18:44:51 +0530 Subject: [PATCH] Backporting PLT-1396 to v0.20.x --- spectrocloud/resource_cluster_edge_native.go | 5 +++-- spectrocloud/resource_cluster_edge_native_test.go | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spectrocloud/resource_cluster_edge_native.go b/spectrocloud/resource_cluster_edge_native.go index 7ee9bf11..9880ba9f 100644 --- a/spectrocloud/resource_cluster_edge_native.go +++ b/spectrocloud/resource_cluster_edge_native.go @@ -673,7 +673,7 @@ func toOverlayNetworkConfigAndVip(cloudConfig map[string]interface{}) (*models.V controlPlaneEndpoint = &models.V1EdgeNativeControlPlaneEndPoint{ Host: vip, - Type: "IP", + Type: "VIP", } } else { if overlayConfig.Enable { @@ -684,7 +684,8 @@ func toOverlayNetworkConfigAndVip(cloudConfig map[string]interface{}) (*models.V controlPlaneEndpoint = &models.V1EdgeNativeControlPlaneEndPoint{ Host: autoGenVip, - Type: "IP", + Type: "V" + + "IP", } } } diff --git a/spectrocloud/resource_cluster_edge_native_test.go b/spectrocloud/resource_cluster_edge_native_test.go index f25da711..0d14df79 100644 --- a/spectrocloud/resource_cluster_edge_native_test.go +++ b/spectrocloud/resource_cluster_edge_native_test.go @@ -529,7 +529,7 @@ func TestToOverlayNetworkConfigAndVip(t *testing.T) { assert.NoError(t, errValid) assert.Equal(t, &models.V1EdgeNativeControlPlaneEndPoint{ Host: "192.168.1.1", - Type: "IP", + Type: "VIP", }, controlPlaneEndpointValid) assert.Equal(t, &models.V1EdgeNativeOverlayNetworkConfiguration{ Cidr: "10.0.0.0/16", @@ -547,7 +547,7 @@ func TestToOverlayNetworkConfigAndVip(t *testing.T) { assert.NoError(t, errOverlayOnly) assert.Equal(t, &models.V1EdgeNativeControlPlaneEndPoint{ Host: "10.0.0.1", // Automatically generated VIP - Type: "IP", + Type: "VIP", }, controlPlaneEndpointOverlayOnly) assert.Equal(t, &models.V1EdgeNativeOverlayNetworkConfiguration{ Cidr: "10.0.0.0/16", @@ -565,7 +565,7 @@ func TestToOverlayNetworkConfigAndVip(t *testing.T) { assert.NoError(t, errVipOnly) assert.Equal(t, &models.V1EdgeNativeControlPlaneEndPoint{ Host: "192.168.1.1", - Type: "IP", + Type: "VIP", }, controlPlaneEndpointVipOnly) assert.Equal(t, &models.V1EdgeNativeOverlayNetworkConfiguration{ Cidr: "", // Empty CIDR since overlay_cidr_range is missing