mirror of https://github.com/apache/cloudstack.git
Merge 02f193ce8a into bce3e54a7e
This commit is contained in:
commit
c9b0b02fe0
|
|
@ -177,4 +177,6 @@ public interface VpcManager {
|
|||
* @return
|
||||
*/
|
||||
boolean isSrcNatIpRequired(long vpcOfferingId);
|
||||
|
||||
boolean isSrcNatIpRequiredForVpcVr(long vpcOfferingId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3400,6 +3400,15 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
|
|||
&& vpcOffSvcProvidersMap.get(Service.Gateway).contains(Network.Provider.VPCVirtualRouter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSrcNatIpRequiredForVpcVr(long vpcOfferingId) {
|
||||
final Map<Network.Service, Set<Network.Provider>> vpcOffSvcProvidersMap = getVpcOffSvcProvidersMap(vpcOfferingId);
|
||||
return (Objects.nonNull(vpcOffSvcProvidersMap.get(Network.Service.SourceNat))
|
||||
&& vpcOffSvcProvidersMap.get(Network.Service.SourceNat).contains(Network.Provider.VPCVirtualRouter))
|
||||
|| (Objects.nonNull(vpcOffSvcProvidersMap.get(Network.Service.Gateway))
|
||||
&& vpcOffSvcProvidersMap.get(Service.Gateway).contains(Network.Provider.VPCVirtualRouter));
|
||||
}
|
||||
|
||||
/**
|
||||
* rollingRestartVpc performs restart of routers of a VPC by first
|
||||
* deploying a new VR and then destroying old VRs in rolling fashion. For
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition {
|
|||
@Override
|
||||
protected boolean prepareDeployment() {
|
||||
//Check if the VR is the src NAT provider...
|
||||
isPublicNetwork = vpcMgr.isSrcNatIpRequired(vpc.getVpcOfferingId());
|
||||
isPublicNetwork = vpcMgr.isSrcNatIpRequiredForVpcVr(vpc.getVpcOfferingId());
|
||||
|
||||
// Check if public network has to be set on VR
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public class VpcRouterDeploymentDefinitionTest extends RouterDeploymentDefinitio
|
|||
|
||||
protected void driveTestPrepareDeployment(final boolean isRedundant, final boolean isPublicNw) {
|
||||
// Prepare
|
||||
when(vpcMgr.isSrcNatIpRequired(mockVpc.getVpcOfferingId())).thenReturn(isPublicNw);
|
||||
when(vpcMgr.isSrcNatIpRequiredForVpcVr(mockVpc.getVpcOfferingId())).thenReturn(isPublicNw);
|
||||
|
||||
// Execute
|
||||
final boolean canProceedDeployment = deployment.prepareDeployment();
|
||||
|
|
|
|||
Loading…
Reference in New Issue