-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix update network offering domainids size limitation #12431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix update network offering domainids size limitation #12431
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12431 +/- ##
============================================
- Coverage 16.23% 16.23% -0.01%
+ Complexity 13382 13380 -2
============================================
Files 5657 5657
Lines 498997 498997
Branches 60566 60566
============================================
- Hits 81032 81030 -2
- Misses 408929 408931 +2
Partials 9036 9036
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I found some more occurrences where the zoneIds parameter is used without the length annotation (There was only one for domainIds which is fixed here). @nvazquez would you please fix these as well? UpdateVPCOfferingCmd
@Parameter(name = ApiConstants.ZONE_ID,
type = CommandType.STRING,
description = "The ID of the containing zone(s) as comma separated string, all for all zones offerings",
since = "4.13")
private String zoneIds;UpdateServiceOfferingCmd
@Parameter(name = ApiConstants.ZONE_ID,
type = CommandType.STRING,
description = "The ID of the containing zone(s) as comma separated string, all for all zones offerings",
since = "4.13")
private String zoneIds;UpdateDiskOfferingCmd
@Parameter(name = ApiConstants.ZONE_ID,
type = CommandType.STRING,
description = "The ID of the containing zone(s) as comma separated string, all for all zones offerings",
since = "4.13")
private String zoneIds; |
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@abh1sar do we need to support a lot of zones? |
|
Thanks @abh1sar @DaanHoogland - I can address those in a separate PR so we keep domainIds on this one fixing the reported issue |
|
@blueorangutan package |
|
@nvazquez 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. |
It might not be required, but there are other places where we use the length annotation with zoneIds. So this will keep the behaviour consistent. |
abh1sar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16385 |
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
vishesh92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
[SF] Trillian test result (tid-15192)
|
RosiKyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Test Summary
Tested the fix for the domainIds parameter length limitation in the updateNetworkOffering API. The PR successfully increases the parameter limit from 255 to 4096 characters, allowing network offerings to be assigned to more than 7 domains (100+ domains now supported).
| Test | Environment | Result |
|---|---|---|
| TC1: Bug Verification - 255 Character Limit | Baseline 4.20 | Original Bug Confirmed |
| TC2: Create Test Domains | PR #12431 | Pass |
| TC3: Update Network Offering with 10 Domains | PR #12431 | Pass |
| TC4: Verify Domain Assignment | PR #12431 | Pass |
Bug Verification (Baseline Environment - Without Fix)
TC1: Bug Verification - 255 Character Limit
Objective: Confirm the bug exists - updateNetworkOffering API rejects domainIds parameter exceeding 255 characters
Expected Result: HTTP 431 error with message about max allowed length 255
Actual Result: Bug confirmed - API rejected the request with HTTP 431 error
Test Evidence:
(localcloud) 🐱 > update networkoffering id=df1b4c4f-2339-42ad-82af-62c9cac57515 domainid=0527ecef-7ea2-4718-8818-9486851fa6e5,fda74982-7379-4fcb-bbf5-ec42d460ba5e,13550664-f616-4ad1-ad4d-351e55679530,aa102d71-75ee-4ccd-a8fd-8427855a814d,23416d8e-fa41-4440-aec7-2d566c89d451,91de7992-896b-4590-88b7-8791ef3e36f9,494e5d0f-21f1-4700-a66f-aa6ad0ecef74,b38fa817-a9cf-421e-822f-8aae73789d04,aa54bdb4-60e4-4f33-abb7-741d83cbdd37,370758fd-bef1-4e6e-bfe8-5be0577652c4
🙈 Error: (HTTP 431, error code 9999) Unable to execute API command updatenetworkoffering due to invalid value. Value greater than max allowed length 255 for param: domainIds
Fix Verification (PR #12431 Environment)
TC2: Create Test Domains
Objective: Create 10 test domains to exceed the previous 255 character limit
Expected Result: 10 domains created successfully
Actual Result: 10 domains created under ROOT domain
Test Evidence:
[root@ref-trl-10672-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# cmk list domains filter=id,name
{
"count": 11,
"domain": [
{
"id": "d6c20f65-f60f-11f0-a7f4-1e001a000456",
"name": "ROOT"
},
{
"id": "e5a044de-3c57-4f75-89bf-18a2dbc2ee0d",
"name": "test-domain-01"
},
{
"id": "94370041-448f-451d-99c0-5c48792f1683",
"name": "test-domain-02"
},
{
"id": "a518218f-0020-42aa-a7d1-be295263d5a7",
"name": "test-domain-03"
},
{
"id": "f666cfe4-2e53-4ed0-bd34-93ece82a5eeb",
"name": "test-domain-04"
},
{
"id": "b42dec04-aa9c-48a9-884e-9cd182df0ff7",
"name": "test-domain-05"
},
{
"id": "6c55fbcb-e892-475e-9b99-499c0e1145d6",
"name": "test-domain-06"
},
{
"id": "fc40eaaa-bab9-4a39-a0c3-26af5a3d3808",
"name": "test-domain-07"
},
{
"id": "acaf2e0f-2c49-4cfd-9327-2471de91f517",
"name": "test-domain-08"
},
{
"id": "714c7acc-89a3-4988-9842-81fa4910a88b",
"name": "test-domain-09"
},
{
"id": "6f211eb8-6b24-41c5-a2f5-a6eff47bc2c4",
"name": "test-domain-10"
}
]
}
TC3: Update Network Offering with 10 Domains
Objective: Verify updateNetworkOffering API accepts domainIds parameter exceeding 255 characters after the fix
Expected Result: Network offering updated successfully with all 10 domains
Actual Result: Success - API accepted 368 characters and updated the network offering
Test Evidence:
(localcloud) 🐱 > update networkoffering id=0271a363-cd3c-455a-a9d9-e45588865835 domainid=e5a044de-3c57-4f75-89bf-18a2dbc2ee0d,94370041-448f-451d-99c0-5c48792f1683,a518218f-0020-42aa-a7d1-be295263d5a7,f666cfe4-2e53-4ed0-bd34-93ece82a5eeb,b42dec04-aa9c-48a9-884e-9cd182df0ff7,6c55fbcb-e892-475e-9b99-499c0e1145d6,fc40eaaa-bab9-4a39-a0c3-26af5a3d3808,acaf2e0f-2c49-4cfd-9327-2471de91f517,714c7acc-89a3-4988-9842-81fa4910a88b,6f211eb8-6b24-41c5-a2f5-a6eff47bc2c4
{
"networkoffering": {
"domain": "/test-domain-01/,/test-domain-02/,/test-domain-03/,/test-domain-04/,/test-domain-05/,/test-domain-06/,/test-domain-07/,/test-domain-08/,/test-domain-09/,/test-domain-10/",
"domainid": "6c55fbcb-e892-475e-9b99-499c0e1145d6,6f211eb8-6b24-41c5-a2f5-a6eff47bc2c4,714c7acc-89a3-4988-9842-81fa4910a88b,94370041-448f-451d-99c0-5c48792f1683,a518218f-0020-42aa-a7d1-be295263d5a7,acaf2e0f-2c49-4cfd-9327-2471de91f517,b42dec04-aa9c-48a9-884e-9cd182df0ff7,e5a044de-3c57-4f75-89bf-18a2dbc2ee0d,f666cfe4-2e53-4ed0-bd34-93ece82a5eeb,fc40eaaa-bab9-4a39-a0c3-26af5a3d3808",
"id": "0271a363-cd3c-455a-a9d9-e45588865835",
"name": "DefaultIsolatedNetworkOfferingWithSourceNatService",
"state": "Enabled"
}
}
TC4: Verify Domain Assignment
Objective: Confirm all 10 domains are correctly assigned to the network offering
Expected Result: Network offering shows all 10 domains in the domain and domainid fields
Actual Result: All 10 domains correctly assigned and visible
Test Evidence:
(localcloud) 🐱 > list networkofferings id=0271a363-cd3c-455a-a9d9-e45588865835 filter=id,name,domainid,domain
{
"count": 1,
"networkoffering": [
{
"domain": "/test-domain-01/,/test-domain-02/,/test-domain-03/,/test-domain-04/,/test-domain-05/,/test-domain-06/,/test-domain-07/,/test-domain-08/,/test-domain-09/,/test-domain-10/",
"domainid": "6c55fbcb-e892-475e-9b99-499c0e1145d6,6f211eb8-6b24-41c5-a2f5-a6eff47bc2c4,714c7acc-89a3-4988-9842-81fa4910a88b,94370041-448f-451d-99c0-5c48792f1683,a518218f-0020-42aa-a7d1-be295263d5a7,acaf2e0f-2c49-4cfd-9327-2471de91f517,b42dec04-aa9c-48a9-884e-9cd182df0ff7,e5a044de-3c57-4f75-89bf-18a2dbc2ee0d,f666cfe4-2e53-4ed0-bd34-93ece82a5eeb,fc40eaaa-bab9-4a39-a0c3-26af5a3d3808",
"id": "0271a363-cd3c-455a-a9d9-e45588865835",
"name": "DefaultIsolatedNetworkOfferingWithSourceNatService"
}
]
}
Description
This PR fixes the updateNetworkOffering API in case the
domainidparameter exceeds 255 characters (default String value size), by increasing the parameter size to 4096 characters. UUIDs are 36 characters strings, the PR increases the possible domains from ~7 domains to +100 domains, useful for large environments.Before the fix (tested with 10 domains):
After the fix (same operation succeeded)
Fixes: #12399
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?