MitchDrage commented on code in PR #14787:
URL: https://github.com/apache/cloudstack/pull/14787#discussion_r4673190085
##########
server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java:
##########
@@ -2886,10 +2895,10 @@ protected boolean applyStaticRoutes(final
List<StaticRouteProfile> routes) throw
final Vpc vpc = vpcDao.findById(routes.get(0).getVpcId());
logger.debug("Applying static routes for vpc " + vpc);
- final String staticNatProvider =
_vpcSrvcDao.getProviderForServiceInVpc(vpc.getId(), Service.StaticNat);
+ final String staticRouteProvider = getStaticRouteProvider(vpc.getId());
for (final VpcProvider provider : getVpcElements()) {
- if (!(provider instanceof StaticNatServiceProvider &&
provider.getName().equalsIgnoreCase(staticNatProvider))) {
+ if (!(provider instanceof StaticNatServiceProvider &&
provider.getName().equalsIgnoreCase(staticRouteProvider))) {
Review Comment:
The check worked because the VR element is also a StaticNatServiceProvider.
It was confusing to read though.
I found getVpcProviders in createPrivateGateway and deletePrivateGateway and
switched to that.
Static routes are now applied by the same providers as the private gateway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]