mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
VPC: fix private mtu of vpc tier (#10257)
This commit is contained in:
parent
b41acf28d4
commit
1f0ffee858
@ -1640,7 +1640,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
|
||||
}
|
||||
|
||||
Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId());
|
||||
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu, privateMtu);
|
||||
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu);
|
||||
|
||||
Network associatedNetwork = null;
|
||||
if (associatedNetworkId != null) {
|
||||
@ -1899,7 +1899,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
|
||||
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) {
|
||||
VpcVO vpc = _vpcDao.findById(vpcId);
|
||||
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 " +
|
||||
"passed during VPC network tier creation ", vpc.getPublicMtu()));
|
||||
interfaceMTUs.set(vpc.getPublicMtu(), privateMtu);
|
||||
interfaceMTUs.set(vpc.getPublicMtu(), interfaceMTUs.second());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -539,7 +539,7 @@ public class NetworkServiceImplTest {
|
||||
Mockito.when(vpcVO.getPublicMtu()).thenReturn(vpcMtu);
|
||||
|
||||
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(privateMtu, updatedMtus.second());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user