VPC: fix private mtu of vpc tier (#10257)

This commit is contained in:
Wei Zhou 2025-03-07 15:04:14 +01:00 committed by GitHub
parent b41acf28d4
commit 1f0ffee858
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -1640,7 +1640,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
} }
Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId()); Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId());
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu, privateMtu); mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu);
Network associatedNetwork = null; Network associatedNetwork = null;
if (associatedNetworkId != null) { if (associatedNetworkId != null) {
@ -1899,7 +1899,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
return ntwkOff; return ntwkOff;
} }
protected void mtuCheckForVpcNetwork(Long vpcId, Pair<Integer, Integer> interfaceMTUs, Integer publicMtu, Integer privateMtu) { protected void mtuCheckForVpcNetwork(Long vpcId, Pair<Integer, Integer> interfaceMTUs, Integer publicMtu) {
if (vpcId != null && publicMtu != null) { if (vpcId != null && publicMtu != null) {
VpcVO vpc = _vpcDao.findById(vpcId); VpcVO vpc = _vpcDao.findById(vpcId);
if (vpc == null) { if (vpc == null) {
@ -1907,7 +1907,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
} }
s_logger.warn(String.format("VPC public MTU already set at VPC creation phase to: %s. Ignoring public MTU " + s_logger.warn(String.format("VPC public MTU already set at VPC creation phase to: %s. Ignoring public MTU " +
"passed during VPC network tier creation ", vpc.getPublicMtu())); "passed during VPC network tier creation ", vpc.getPublicMtu()));
interfaceMTUs.set(vpc.getPublicMtu(), privateMtu); interfaceMTUs.set(vpc.getPublicMtu(), interfaceMTUs.second());
} }
} }

View File

@ -539,7 +539,7 @@ public class NetworkServiceImplTest {
Mockito.when(vpcVO.getPublicMtu()).thenReturn(vpcMtu); Mockito.when(vpcVO.getPublicMtu()).thenReturn(vpcMtu);
Pair<Integer, Integer> updatedMtus = service.validateMtuConfig(publicMtu, privateMtu, zoneId); Pair<Integer, Integer> updatedMtus = service.validateMtuConfig(publicMtu, privateMtu, zoneId);
service.mtuCheckForVpcNetwork(vpcId, updatedMtus, publicMtu, privateMtu); service.mtuCheckForVpcNetwork(vpcId, updatedMtus, publicMtu);
Assert.assertEquals(vpcMtu, updatedMtus.first()); Assert.assertEquals(vpcMtu, updatedMtus.first());
Assert.assertEquals(privateMtu, updatedMtus.second()); Assert.assertEquals(privateMtu, updatedMtus.second());
} }