server: null-check public IP before the DNS/Source NAT guard in create - #14027
server: null-check public IP before the DNS/Source NAT guard in create#14027nagaboinaramgopal wants to merge 1 commit into
Conversation
ab71f2e to
a0fe78d
Compare
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
please ignore my previous approval
|
@nagaboinaramgopal , can you agree with @weizhouapache , or do you have a scenario where you want to skip checking the network services and continue? |
…ePublicLoadBalancerRule createPublicLoadBalancerRule resolved ipVO only when an ipAddrId was supplied, then at the port-53 check did (srcPortStart == DNS_PORT && ipVO.isSourceNat()). For an elastic-LB rule created without an explicit IP (ipAddrId == null) the system IP is allocated later, so ipVO was still null and creating a rule on port 53 threw a NullPointerException. The ipVO == null validation only runs further down. Guard the check with ipVO != null so the DNS/Source NAT conflict test is skipped when there is no IP yet; the flow then reaches the existing can't-find-source-IP parameter error. Adds a regression test creating a port-53 rule with a null ipAddrId (NullPointerException before the fix).
a0fe78d to
bac2cd6
Compare
Thanks @weizhouapache @DaanHoogland There is a concrete scenario for skipping and continuing: an elastic LB rule, or any call without an
On throwing instead of guarding: the null case is already handled loudly a few lines down, at That is why the change only guards the port 53 source-NAT check with |
@nagaboinaramgopal |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Thanks @weizhouapache . That is exactly what the guard does here: it only prevents the NPE on this line and leaves the existing ipVO == null validation below to reject a genuinely unresolvable IP, so no behaviour change for the null case, just no raw NPE. Appreciate the review. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19141 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #14027 +/- ##
=========================================
Coverage 16.34% 16.35%
+ Complexity 13576 13575 -1
=========================================
Files 5669 5669
Lines 501405 501405
Branches 60907 60907
=========================================
+ Hits 81975 81981 +6
+ Misses 410246 410234 -12
- Partials 9184 9190 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
[SF] Trillian Build Failed (tid-16925) |
Description
Description
createPublicLoadBalancerRuleguards a special case for the DNS port before ithas resolved the public IP:
When the caller does not pass an explicit IP (
ipAddrIdis null),ipVOis nullat this point, so creating a load balancer rule on the DNS port throws a
NullPointerException instead of the normal validation error. Fixed by
null-checking
ipVObefore callingisSourceNat(), so the DNS/Source NAT branchis skipped when there is no IP and the flow reaches the intended parameter
validation.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
Added a unit test that creates a public load balancer rule on the DNS port with
no explicit IP and asserts it fails with a parameter validation error instead of
a NullPointerException. Also built the standard packages and deployed on a KVM
advanced zone.