Skip to content

Commit

Permalink
Fix IPAddressVisibility type
Browse files Browse the repository at this point in the history
The const is missleading and valid value is External and Private.
  • Loading branch information
DanielXiao committed Aug 22, 2024
1 parent 2df9cac commit bdc1c25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pkg/cloudprovider/vsphereparavirtual/nsxipmanager/nsx_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ func (m *NSXVPCIPManager) ReleasePodCIDR(node *corev1.Node) error {
}

// convertToIPAddressVisibility converts the ip pool type to the ip address visibility. This is needed because the nsx
// does not unify names yet. Public equals to External. TODO: remove this once nsx unifies names.
// does not unify names yet. Public equals to External.
func convertToIPAddressVisibility(ipPoolType string) vpcapisv1.IPAddressVisibility {
if ipPoolType == PublicIPPoolType {
return vpcapisv1.IPAddressVisibilityExternal
return "External"
}
return vpcapisv1.IPAddressVisibilityPrivate
return "Private"
}

// NewNSXVPCIPManager returns a new NSXVPCIPManager object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestNSXVPCIPManager_ClaimPodCIDR(t *testing.T) {
},
},
Spec: vpcapisv1.IPAddressAllocationSpec{
IPAddressBlockVisibility: vpcapisv1.IPAddressVisibilityExternal,
IPAddressBlockVisibility: "External",
AllocationSize: allocationSize,
},
},
Expand All @@ -149,7 +149,7 @@ func TestNSXVPCIPManager_ClaimPodCIDR(t *testing.T) {
},
},
Spec: vpcapisv1.IPAddressAllocationSpec{
IPAddressBlockVisibility: vpcapisv1.IPAddressVisibilityPrivate,
IPAddressBlockVisibility: "Private",
AllocationSize: allocationSize,
},
},
Expand Down Expand Up @@ -180,7 +180,7 @@ func TestNSXVPCIPManager_ClaimPodCIDR(t *testing.T) {
},
},
Spec: vpcapisv1.IPAddressAllocationSpec{
IPAddressBlockVisibility: vpcapisv1.IPAddressVisibilityPrivate,
IPAddressBlockVisibility: "Private",
AllocationSize: allocationSize,
},
},
Expand Down Expand Up @@ -213,7 +213,7 @@ func TestNSXVPCIPManager_ClaimPodCIDR(t *testing.T) {
},
},
Spec: vpcapisv1.IPAddressAllocationSpec{
IPAddressBlockVisibility: vpcapisv1.IPAddressVisibilityPrivate,
IPAddressBlockVisibility: "Private",
AllocationSize: allocationSize,
},
},
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestNSXVPCIPManager_ReleasePodCIDR(t *testing.T) {
Namespace: ns,
},
Spec: vpcapisv1.IPAddressAllocationSpec{
IPAddressBlockVisibility: vpcapisv1.IPAddressVisibilityExternal,
IPAddressBlockVisibility: "External",
AllocationSize: allocationSize,
},
}
Expand Down

0 comments on commit bdc1c25

Please sign in to comment.