Skip to content
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 comparison of Long objects to use primitives #9079

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JSpon
Copy link

@JSpon JSpon commented May 14, 2024

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)
  • 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
  • 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?

Copy link

boring-cyborg bot commented May 14, 2024

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:

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 4.26%. Comparing base (21af134) to head (e41e1cb).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #9079       +/-   ##
============================================
- Coverage     15.28%   4.26%   -11.02%     
============================================
  Files          5425     363     -5062     
  Lines        474138   29565   -444573     
  Branches      58984    5190    -53794     
============================================
- Hits          72486    1262    -71224     
+ Misses       393584   28160   -365424     
+ Partials       8068     143     -7925     
Flag Coverage Δ
uitests 4.26% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants