mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Static Routes: fix check on wrong global configuration (#10066)
This commit is contained in:
parent
97be6f2e5d
commit
fbb1ff78d6
@ -81,6 +81,9 @@ public interface NetworkOrchestrationService {
|
|||||||
ConfigKey<Integer> NetworkLockTimeout = new ConfigKey<Integer>(Integer.class, NetworkLockTimeoutCK, "Network", "600",
|
ConfigKey<Integer> NetworkLockTimeout = new ConfigKey<Integer>(Integer.class, NetworkLockTimeoutCK, "Network", "600",
|
||||||
"Lock wait timeout (seconds) while implementing network", true, Scope.Global, null);
|
"Lock wait timeout (seconds) while implementing network", true, Scope.Global, null);
|
||||||
|
|
||||||
|
ConfigKey<String> DeniedRoutes = new ConfigKey<String>(String.class, "denied.routes", "Network", "",
|
||||||
|
"Routes that are denied, can not be used for Static Routes creation for the VPC Private Gateway", true, ConfigKey.Scope.Zone, null);
|
||||||
|
|
||||||
ConfigKey<String> GuestDomainSuffix = new ConfigKey<String>(String.class, GuestDomainSuffixCK, "Network", "cloud.internal",
|
ConfigKey<String> GuestDomainSuffix = new ConfigKey<String>(String.class, GuestDomainSuffixCK, "Network", "cloud.internal",
|
||||||
"Default domain name for vms inside virtualized networks fronted by router", true, ConfigKey.Scope.Zone, null);
|
"Default domain name for vms inside virtualized networks fronted by router", true, ConfigKey.Scope.Zone, null);
|
||||||
|
|
||||||
|
|||||||
@ -4792,7 +4792,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConfigKey<?>[] getConfigKeys() {
|
public ConfigKey<?>[] getConfigKeys() {
|
||||||
return new ConfigKey<?>[]{NetworkGcWait, NetworkGcInterval, NetworkLockTimeout,
|
return new ConfigKey<?>[]{NetworkGcWait, NetworkGcInterval, NetworkLockTimeout, DeniedRoutes,
|
||||||
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
|
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
|
||||||
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled,
|
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled,
|
||||||
TUNGSTEN_ENABLED };
|
TUNGSTEN_ENABLED };
|
||||||
|
|||||||
@ -2710,7 +2710,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2) CIDR should be outside of link-local cidr
|
// 2) CIDR should be outside of link-local cidr
|
||||||
if (NetUtils.isNetworksOverlap(vpc.getCidr(), NetUtils.getLinkLocalCIDR())) {
|
if (NetUtils.isNetworksOverlap(cidr, NetUtils.getLinkLocalCIDR())) {
|
||||||
throw new InvalidParameterValueException("CIDR should be outside of link local cidr " + NetUtils.getLinkLocalCIDR());
|
throw new InvalidParameterValueException("CIDR should be outside of link local cidr " + NetUtils.getLinkLocalCIDR());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2739,7 +2739,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isCidrDenylisted(final String cidr, final long zoneId) {
|
protected boolean isCidrDenylisted(final String cidr, final long zoneId) {
|
||||||
final String routesStr = NetworkOrchestrationService.GuestDomainSuffix.valueIn(zoneId);
|
final String routesStr = NetworkOrchestrationService.DeniedRoutes.valueIn(zoneId);
|
||||||
if (routesStr != null && !routesStr.isEmpty()) {
|
if (routesStr != null && !routesStr.isEmpty()) {
|
||||||
final String[] cidrDenyList = routesStr.split(",");
|
final String[] cidrDenyList = routesStr.split(",");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user