File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,9 @@ func checkIfPrismCentralAndControlPlaneIPSame(
153
153
controlPlaneEndpointSpec .ControlPlaneEndpointIP (),
154
154
)
155
155
if err != nil {
156
- // controlPlaneEndpointIP is strictly accepted as an IP address from user so
157
- // if it is not an IP address, it is invalid .
158
- return fmt . Errorf ( "invalid Nutanix control plane endpoint IP: %w" , err )
156
+ // If controlPlaneEndpointIP is a hostname, we cannot compare it with PC IP
157
+ // so return directly .
158
+ return nil
159
159
}
160
160
161
161
pcHostname , _ , err := pcEndpoint .ParseURL ()
Original file line number Diff line number Diff line change @@ -144,17 +144,14 @@ func TestCheckIfPrismCentralAndControlPlaneIPSame(t *testing.T) {
144
144
),
145
145
},
146
146
{
147
- name : "Invalid Control Plane IP" ,
147
+ name : "Control Plane IP specified as hostname " ,
148
148
pcEndpoint : v1alpha1.NutanixPrismCentralEndpointSpec {
149
149
URL : "https://192.168.1.1:9440" ,
150
150
},
151
151
controlPlaneEndpointSpec : v1alpha1.ControlPlaneEndpointSpec {
152
- Host : "invalid-ip " ,
152
+ Host : "dummy-hostname " ,
153
153
},
154
- expectedErr : fmt .Errorf (
155
- "invalid Nutanix control plane endpoint IP: ParseAddr(%q): unable to parse IP" ,
156
- "invalid-ip" ,
157
- ),
154
+ expectedErr : nil ,
158
155
},
159
156
{
160
157
name : "Invalid Prism Central URL" ,
@@ -199,7 +196,7 @@ func TestCheckIfPrismCentralAndControlPlaneIPSame(t *testing.T) {
199
196
),
200
197
},
201
198
{
202
- name : "With KubeVIP ovveride and different PC and Control Plane IPs" ,
199
+ name : "With KubeVIP override and different PC and Control Plane IPs" ,
203
200
pcEndpoint : v1alpha1.NutanixPrismCentralEndpointSpec {
204
201
URL : "https://192.168.1.2:9440" ,
205
202
},
You can’t perform that action at this time.
0 commit comments