adestis-mf opened a new pull request, #14809:
URL: https://github.com/apache/cloudstack/pull/14809

   ### Description
   
   This PR fixes the firewall tab of public IPs in a VPC whose offering has the 
Firewall service (#12706).
   
   `PublicIpResource` adds the firewall tab for such IPs. 
`ResourceView.showTab` then applies the tab's `networkServiceFilter`, which 
checks the services of the network in `associatednetworkid` for `Firewall`. In 
a VPC that network is a tier, and a tier never has the Firewall service; the 
VPC has it. So the tab is shown for a new IP only until the first port 
forwarding or load balancing rule associates the IP with a tier, and it is not 
shown for the source NAT IP. The firewall rules stay in place, but they can no 
longer be seen, added or removed in the UI.
   
   For static NAT IPs `filterTabs` already removed the filter from the tab. 
This change does the same for all VPC IPs when the VPC has the Firewall 
service: `addFirewallTab` now puts the tab in without `networkServiceFilter`, 
replacing an existing firewall tab in place, and the general VPC branch uses it 
as well. The static NAT branch uses the same method instead of its own copy. 
VPCs without the Firewall service and IPs of isolated networks are not affected.
   
   Reading the code, conserve mode does not change this: the tab was filtered 
by the tier on both branches.
   
   Fixes: #14147
   
   ### 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
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   I see the behaviour from #14147 on 4.23.0.0: the firewall tab of a VPC 
public IP is there until a port forwarding rule is added to the IP, and then it 
is gone. The rules themselves stay active.
   
   New unit tests in `ui/tests/unit/views/network/PublicIpResource.spec.js`. 
They run `filterTabs` and pass the resulting tabs through 
`ResourceView.showTab` with the services of the network the IP is associated 
with:
   
   - IP with a port forwarding rule on a VPC tier, with and without conserve 
mode: the firewall tab is shown.
   - Source NAT IP of a VPC, with and without conserve mode: the firewall tab 
is shown.
   - Static NAT IP, and an IP that is not associated with a tier yet: the 
firewall tab is shown, as before.
   - VPC without the Firewall service: no firewall tab, as before.
   - IP of an isolated network: the firewall tab is still filtered by the 
services of that network.
   
   Without the change in `PublicIpResource.vue` the four tests for port 
forwarding and source NAT IPs fail, the other five pass with and without it.
   
   With Node 16 as in the UI workflow, on top of `main` (caf1091aae): 
`vue-cli-service lint --no-fix` on both files without errors, `npm run 
test:unit` with `TZ=UTC` 14 suites and 210 tests passed, `npm run build` 
completes.
   
   I have not tested the patched UI in a browser against a management server.
   


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