server: fix clone network offerings with detail internetProtocol=IPv4#13615
server: fix clone network offerings with detail internetProtocol=IPv4#13615weizhouapache wants to merge 2 commits into
Conversation
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
There was a problem hiding this comment.
Pull request overview
This PR fixes cloning of network offerings when the source offering contains details like internetProtocol=IPv4, which previously could trigger a ClassCastException in NetworkOfferingBaseCmd.getDetails() due to an unexpected details-map structure during clone.
Changes:
- Stop injecting source offering details into the API
detailsparameter structure during clone; instead, carry them via a dedicated internalsourceDetailsMap. - Update
NetworkOfferingBaseCmd.getDetails()to fall back tosourceDetailsMapwhen no APIdetailswere provided. - Exclude
internetProtocol,domainid, andzoneidfrom the cloned details map (these are handled via dedicated command fields / parameters).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java | Adjusts clone parameter population to avoid mis-shaping details and filters out special-case detail keys. |
| api/src/main/java/org/apache/cloudstack/api/command/admin/network/NetworkOfferingBaseCmd.java | Adds an internal fallback details map and changes getDetails() to return it when API details are absent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13615 +/- ##
============================================
+ Coverage 3.41% 19.64% +16.23%
- Complexity 0 19793 +19793
============================================
Files 487 6368 +5881
Lines 41860 575102 +533242
Branches 7910 70371 +62461
============================================
+ Hits 1429 113006 +111577
- Misses 40232 449815 +409583
- Partials 199 12281 +12082
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:
|
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
| public Map<String, String> getDetails() { | ||
| if (details == null || details.isEmpty()) { | ||
| return null; | ||
| return sourceDetailsMap; | ||
| } |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18569 |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18571 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
dbdf6a8 to
297185e
Compare
| public Map<String, String> getDetails() { | ||
| if (details == null || details.isEmpty()) { | ||
| return null; | ||
| return sourceDetailsMap; | ||
| } |
Description
This PR fixes #13610
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?