cloudstack
cloudstack copied to clipboard
Fix comparison of Long objects to use primitives
Description
This PR...
fixes a bug that compares two Long objects, instead of their primitives. The comparison of two Long objects with the same underlying long value returned as not equal, throwing an error even though the public IP address was correctly assigned to the VPC associated with the guest network. This issue does not occur when comparing the primitives.
When this issue occurs, any cluster using a guest network in a particular VPC will always throw the error.
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
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
Bug Severity
- [ ] BLOCKER
- [X] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
In a test environment, any attempt to create a CKS cluster on a specific VPC always returned the error "Public IP with ID: ... linked to the Kubernetes cluster: ... is not usable". The public IP address was correctly attached, and debugging showed that they had the same long value. The code was compiled with this update and put in a jar earlier in the classpath, and the CKS cluster was created successfully.
How did you try to break this feature and the system with this change?
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) Here are some useful points:
- In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
- Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
- Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
- Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
- Be sure to read the CloudStack Coding Conventions. Apache CloudStack is a community-driven project and together we are making it better 🚀. In case of doubts contact the developers at: Mailing List: [email protected] (https://cloudstack.apache.org/mailing-lists.html) Slack: https://apachecloudstack.slack.com/
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 4.01%. Comparing base (d1cf453) to head (a61b2bd).
:warning: Report is 856 commits behind head on main.
:exclamation: There is a different number of reports uploaded between BASE (d1cf453) and HEAD (a61b2bd). Click for more details.
HEAD has 1 upload less than BASE
Flag BASE (d1cf453) HEAD (a61b2bd) unittests 1 0
Additional details and impacted files
@@ Coverage Diff @@
## main #9079 +/- ##
============================================
- Coverage 16.07% 4.01% -12.07%
============================================
Files 5642 394 -5248
Lines 494087 32406 -461681
Branches 59931 5726 -54205
============================================
- Hits 79425 1301 -78124
+ Misses 405844 30957 -374887
+ Partials 8818 148 -8670
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.01% <ø> (ø) |
|
| unittests | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Is there something I should do to get this progressed? If there are any concerns, please let me know. Thanks.
@JSpon , well, you could find a 3rd party tester and a second reviewer. the rules are two reviews of which one did a test. I'll at least run some regression tests.
also see https://github.com/apache/cloudstack/actions/runs/9072065551/job/25241922319?pr=9079#step:7:5497 I think there are some errors in the github actions.
@blueorangutan package
@DaanHoogland 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.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9777
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian test result (tid-10344) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 48222 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9079-t10344-kvm-centos7.zip Smoke tests completed. 130 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_02_trigger_shutdown | Failure |
351.99 | test_safe_shutdown.py |
| test_hostha_enable_ha_when_host_disabled | Error |
3.15 | test_hostha_kvm.py |
| test_hostha_enable_ha_when_host_in_maintenance | Error |
303.18 | test_hostha_kvm.py |
@blueorangutan package
@rohityadavcloud 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.
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 10943
@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.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10949
@blueorangutan test
@rohityadavcloud a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
[SF] Trillian test result (tid-11385) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 51481 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9079-t11385-kvm-ol8.zip Smoke tests completed. 137 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_isolate_network_password_server | Failure |
10.14 | test_password_server.py |
| test_01_secure_vm_migration | Error |
136.54 | test_vm_life_cycle.py |
| test_01_secure_vm_migration | Error |
136.55 | test_vm_life_cycle.py |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@JSpon @DaanHoogland FYI - I was able to take this code change and build it into a .jar file and run it on the management server and was also able to successfully create the K8S cluster in the VPC
@JSpon @DaanHoogland FYI - I was able to take this code change and build it into a .jar file and run it on the management server and was also able to successfully create the K8S cluster in the VPC
I would say that sounds as a successful test ;)
There is a conflict @JSpon , could you resolve that.
Also de we feel this needs to go on another release branch than main? (i.e. 4.19 or 4.20?)
o a .jar file and run it on the management server and was also able to successfully create the K8S cluster in the VPC
I would say that sounds as a successful test ;)
There is a conflict @JSpon , could you resolve that.
Also de we feel this needs to go on another release branch than main? (i.e. 4.19 or 4.20?)
if the issue exists in 4.19 or 4.20, it would be better to rebase with 4.19/4.20
hi @JSpon please resolve the conflicts.