MitchDrage opened a new pull request, #14787:
URL: https://github.com/apache/cloudstack/pull/14787

   ### Description
   
   This PR fixes static routes on ROUTED VPCs. `applyStaticRoutes` chose the 
provider by looking up the VPC's StaticNat provider. ROUTED VPC offerings can't 
have StaticNat, so the lookup threw `UnsupportedServiceException` and every 
createStaticRoute failed with "Failed to create a static route".
   
   - New `getStaticRouteProvider` uses the StaticNat provider when the VPC has 
StaticNat, and the Gateway provider when it doesn't. ROUTED VPC offerings 
always map Gateway to VpcVirtualRouter.
   - VPCs with StaticNat keep the same provider as before.
   - Two unit tests in `VpcManagerImplTest`.
   
   Fixes: #
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   - `applyStaticRoutesUsesGatewayProviderWhenVpcHasNoStaticNat`: a VPC without 
StaticNat applies its routes through the VPC virtual router. Before the fix it 
failed with `UnsupportedServiceException: Service StaticNat is not supported in 
the vpc id=1`. On a live 4.22.1.1 ROUTED VPC, createStaticRoute failed with 
error 530 on the same code path.
   - `applyStaticRoutesUsesStaticNatProviderWhenVpcHasStaticNat`: a VPC with 
StaticNat still uses that provider and never looks up Gateway. It passed before 
and after the fix.
   - The rest of `VpcManagerImplTest` passes.
   
   #### How did you try to break this feature and the system with this change?
   
   - Checked that VPCs with StaticNat take the same path as before.


-- 
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]

Reply via email to