@@ -136,6 +136,7 @@ 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 )),
139
140
),
140
141
expectedFilesGenerated : 1 ,
141
142
}, {
@@ -161,6 +162,8 @@ func TestGenerateInfrastructure(t *testing.T) {
161
162
infraBuild .withVSphereIngressVIP (ipv4IngressVIP ),
162
163
infraBuild .withVSphereAPIVIP (ipv6APIVIP ),
163
164
infraBuild .withVSphereIngressVIP (ipv6IngressVIP ),
165
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
166
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv6MachineNetwork )),
164
167
),
165
168
expectedFilesGenerated : 1 ,
166
169
},
@@ -180,6 +183,8 @@ func TestGenerateInfrastructure(t *testing.T) {
180
183
infraBuild .withVSphereMachineNetworkEntry (configv1 .CIDR (ipv4IngressVIP + "/32" )),
181
184
infraBuild .withVSphereAPIVIP (ipv4APIVIP ),
182
185
infraBuild .withVSphereIngressVIP (ipv4IngressVIP ),
186
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
187
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
183
188
),
184
189
expectedFilesGenerated : 1 ,
185
190
},
@@ -197,6 +202,7 @@ func TestGenerateInfrastructure(t *testing.T) {
197
202
infraBuild .withVSphereMachineNetworkEntry (configv1 .CIDR (ipv4APIVIP + "/32" )),
198
203
infraBuild .withVSphereAPIVIP (ipv4APIVIP ),
199
204
infraBuild .withVSphereIngressVIP (ipv4APIVIP ),
205
+ infraBuild .withVSphereNodeNetworkingEntry (configv1 .CIDR (defaultMachineNetwork )),
200
206
),
201
207
expectedFilesGenerated : 1 ,
202
208
},
@@ -551,6 +557,15 @@ func (b infraBuildNamespace) withVSphereMachineNetworkEntry(cidr configv1.CIDR)
551
557
}
552
558
}
553
559
560
+ func (b infraBuildNamespace ) withVSphereNodeNetworkingEntry (cidr configv1.CIDR ) infraOption {
561
+ return func (infra * configv1.Infrastructure ) {
562
+ b .withVSpherePlatformSpec ()(infra )
563
+ b .withVSpherePlatformStatus ()(infra )
564
+ infra .Spec .PlatformSpec .VSphere .NodeNetworking .External .NetworkSubnetCIDR = append (infra .Spec .PlatformSpec .VSphere .NodeNetworking .External .NetworkSubnetCIDR , string (cidr ))
565
+ infra .Spec .PlatformSpec .VSphere .NodeNetworking .Internal .NetworkSubnetCIDR = append (infra .Spec .PlatformSpec .VSphere .NodeNetworking .Internal .NetworkSubnetCIDR , string (cidr ))
566
+ }
567
+ }
568
+
554
569
func (b infraBuildNamespace ) withVSphereAPIVIP (vip string ) infraOption {
555
570
return func (infra * configv1.Infrastructure ) {
556
571
b .withVSpherePlatformSpec ()(infra )
0 commit comments