Skip to content

Commit b02e13e

Browse files
committed
refactor: renames func to VirtualIPAddress
1 parent 7b50e2a commit b02e13e

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
@@ -143,9 +143,7 @@ func checkIfPrismCentralAndControlPlaneIPSame(
143143
pcEndpoint v1alpha1.NutanixPrismCentralEndpointSpec,
144144
controlPlaneEndpointSpec v1alpha1.ControlPlaneEndpointSpec,
145145
) error {
146-
controlPlaneEndpointIP, err := netip.ParseAddr(
147-
controlPlaneEndpointSpec.ControlPlaneEndpointIP(),
148-
)
146+
controlPlaneEndpointIP, err := netip.ParseAddr(controlPlaneEndpointSpec.VirtualIPAddress())
149147
if err != nil {
150148
// If controlPlaneEndpointIP is a hostname, we cannot compare it with PC IP
151149
// so return directly.

0 commit comments

Comments
 (0)