Skip to content

Commit 4314fe9

Browse files
committed
refactor: renames func to VirtualIPAddress
1 parent 3f14b50 commit 4314fe9

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

api/v1alpha1/common_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type LocalObjectReference struct {
7878
Name string `json:"name"`
7979
}
8080

81-
func (s ControlPlaneEndpointSpec) ControlPlaneEndpointIP() string {
81+
func (s ControlPlaneEndpointSpec) VirtualIPAddress() string {
8282
// If specified, use the virtual IP address and/or port,
8383
// otherwise fall back to the control plane endpoint host and port.
8484
if s.VirtualIPSpec != nil &&

api/v1alpha1/common_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestControlPlaneEndpointIP(t *testing.T) {
6060

6161
for _, tt := range tests {
6262
t.Run(tt.name, func(t *testing.T) {
63-
result := tt.spec.ControlPlaneEndpointIP()
63+
result := tt.spec.VirtualIPAddress()
6464
assert.Equal(t, tt.expected, result)
6565
})
6666
}

pkg/webhook/cluster/nutanix_validator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ func checkIfPrismCentralAndControlPlaneIPSame(
149149
pcEndpoint v1alpha1.NutanixPrismCentralEndpointSpec,
150150
controlPlaneEndpointSpec v1alpha1.ControlPlaneEndpointSpec,
151151
) error {
152-
controlPlaneEndpointIP, err := netip.ParseAddr(
153-
controlPlaneEndpointSpec.ControlPlaneEndpointIP(),
154-
)
152+
controlPlaneEndpointIP, err := netip.ParseAddr(controlPlaneEndpointSpec.VirtualIPAddress())
155153
if err != nil {
156154
// If controlPlaneEndpointIP is a hostname, we cannot compare it with PC IP
157155
// so return directly.

0 commit comments

Comments
 (0)