Skip to content

Commit 2231e34

Browse files
authored
[occm] Support members without subnet in fully populated LB (#2124) (#2126)
* [occm] Do not send the subnet-id if it is empty for members during the creation of fully populated loadbalancer.
1 parent 2a5f397 commit 2231e34

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/openstack/loadbalancer.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,12 +1222,17 @@ func (lbaas *LbaasV2) buildBatchUpdateMemberOpts(port corev1.ServicePort, nodes
12221222
}
12231223
}
12241224

1225+
memberSubnetID := &svcConf.lbMemberSubnetID
1226+
if memberSubnetID != nil && *memberSubnetID == "" {
1227+
memberSubnetID = nil
1228+
}
1229+
12251230
if port.NodePort != 0 { // It's 0 when AllocateLoadBalancerNodePorts=False
12261231
member := v2pools.BatchUpdateMemberOpts{
12271232
Address: addr,
12281233
ProtocolPort: int(port.NodePort),
12291234
Name: &node.Name,
1230-
SubnetID: &svcConf.lbMemberSubnetID,
1235+
SubnetID: memberSubnetID,
12311236
}
12321237
if svcConf.healthCheckNodePort > 0 && lbaas.canUseHTTPMonitor(port) {
12331238
member.MonitorPort = &svcConf.healthCheckNodePort

0 commit comments

Comments
 (0)