@@ -136,6 +136,9 @@ func TestGenerateInfrastructure(t *testing.T) {
136
136
infraBuild .withVSphereMachineNetworkEntry (configv1 .CIDR (ipv4IngressVIP + "/32" )),
137
137
infraBuild .withVSphereAPIVIP (ipv4APIVIP ),
138
138
infraBuild .withVSphereIngressVIP (ipv4IngressVIP ),
139
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
140
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
141
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4IngressVIP + "/32" )),
139
142
),
140
143
expectedFilesGenerated : 1 ,
141
144
}, {
@@ -161,6 +164,13 @@ func TestGenerateInfrastructure(t *testing.T) {
161
164
infraBuild .withVSphereIngressVIP (ipv4IngressVIP ),
162
165
infraBuild .withVSphereAPIVIP (ipv6APIVIP ),
163
166
infraBuild .withVSphereIngressVIP (ipv6IngressVIP ),
167
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
168
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv6MachineNetwork )),
169
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
170
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv6APIVIP + "/128" )),
171
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4IngressVIP + "/32" )),
172
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv6IngressVIP + "/128" )),
173
+
164
174
),
165
175
expectedFilesGenerated : 1 ,
166
176
},
@@ -180,6 +190,9 @@ func TestGenerateInfrastructure(t *testing.T) {
180
190
infraBuild .withVSphereMachineNetworkEntry (configv1 .CIDR (ipv4IngressVIP + "/32" )),
181
191
infraBuild .withVSphereAPIVIP (ipv4APIVIP ),
182
192
infraBuild .withVSphereIngressVIP (ipv4IngressVIP ),
193
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
194
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
195
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4IngressVIP + "/32" )),
183
196
),
184
197
expectedFilesGenerated : 1 ,
185
198
},
@@ -197,6 +210,8 @@ func TestGenerateInfrastructure(t *testing.T) {
197
210
infraBuild .withVSphereMachineNetworkEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
198
211
infraBuild .withVSphereAPIVIP (ipv4APIVIP ),
199
212
infraBuild .withVSphereIngressVIP (ipv4APIVIP ),
213
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
214
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
200
215
),
201
216
expectedFilesGenerated : 1 ,
202
217
},
@@ -551,6 +566,15 @@ func (b infraBuildNamespace) withVSphereMachineNetworkEntry(cidr configv1.CIDR)
551
566
}
552
567
}
553
568
569
+ func (b infraBuildNamespace ) withVSphereNodeNetworkingEntry (cidr configv1.CIDR ) infraOption {
570
+ return func (infra * configv1.Infrastructure ) {
571
+ b .withVSpherePlatformSpec ()(infra )
572
+ b .withVSpherePlatformStatus ()(infra )
573
+ infra .Spec .PlatformSpec .VSphere .NodeNetworking .External .NetworkSubnetCIDR = append (infra .Spec .PlatformSpec .VSphere .NodeNetworking .External .NetworkSubnetCIDR , string (cidr ))
574
+ infra .Spec .PlatformSpec .VSphere .NodeNetworking .Internal .NetworkSubnetCIDR = append (infra .Spec .PlatformSpec .VSphere .NodeNetworking .Internal .NetworkSubnetCIDR , string (cidr ))
575
+ }
576
+ }
577
+
554
578
func (b infraBuildNamespace ) withVSphereAPIVIP (vip string ) infraOption {
555
579
return func (infra * configv1.Infrastructure ) {
556
580
b .withVSpherePlatformSpec ()(infra )
0 commit comments