Skip to content

Commit

Permalink
Backporting PLT-1396 to v0.20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SivaanandM committed Sep 17, 2024
1 parent 2436178 commit 565abb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions spectrocloud/resource_cluster_edge_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -684,7 +684,8 @@ func toOverlayNetworkConfigAndVip(cloudConfig map[string]interface{}) (*models.V
controlPlaneEndpoint =
&models.V1EdgeNativeControlPlaneEndPoint{
Host: autoGenVip,
Type: "IP",
Type: "V" +
"IP",
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions spectrocloud/resource_cluster_edge_native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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
Expand Down

0 comments on commit 565abb8

Please sign in to comment.