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

Add checks if IP range is passed if Shared Network #10168

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

Conversation

Pearl1594
Copy link
Contributor

Description

Fixes: #10114
This PR adds necessary check for IP range for shared Networks.

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
  • test (unit or integration test code)

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?

How did you try to break this feature and the system with this change?

@DaanHoogland
Copy link
Contributor

@Pearl1594 in the expected result in #10114 it says

VM should get successfully deployed with ACS automatically allocating a VLAN

So that is not true? instead it is

VM deployment should fail with an appropriate error message

?

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.

code looks good if we accept that deployment fails.

@Pearl1594
Copy link
Contributor Author

@Pearl1594 in the expected result in #10114 it says

VM should get successfully deployed with ACS automatically allocating a VLAN

So that is not true? instead it is

VM deployment should fail with an appropriate error message

?

Initially when I reported the issue, I thought the issue was with specifyVlan - as broadcast URI ends up being null. However, on further investigation the reason for it was IP address not being passed. With missing inputs it's not possible to have a successful deployment.
I will change the issue description.

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 4.30%. Comparing base (afc95f1) to head (524fff4).

❗ There is a different number of reports uploaded between BASE (afc95f1) and HEAD (524fff4). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (afc95f1) HEAD (524fff4)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               4.19   #10168       +/-   ##
=============================================
- Coverage     15.12%    4.30%   -10.83%     
=============================================
  Files          5408      366     -5042     
  Lines        473954    29570   -444384     
  Branches      57810     5180    -52630     
=============================================
- Hits          71709     1272    -70437     
+ Misses       394231    28154   -366077     
+ Partials       8014      144     -7870     
Flag Coverage Δ
uitests 4.30% <ø> (ø)
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.

if (!ntwkOff.isSpecifyIpRanges()) {
throw new CloudRuntimeException("Specify IP Ranged should be true for Shared Networks");
}
if (ipv4 && Objects.isNull(startIP)) {
Copy link
Member

Choose a reason for hiding this comment

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

what about endIP and endIPv6 ?

Copy link
Contributor Author

@Pearl1594 Pearl1594 Jan 8, 2025

Choose a reason for hiding this comment

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

The definition for endIP against the API parameter is :the ending IP address in the network IP" + " range. If not specified, will be defaulted to startIP"
So I presumed that'll be handled internally
However, I had one query - if IPv6 address is passed is it necessary to pass ipv4?

Copy link
Contributor

Choose a reason for hiding this comment

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

it should not anymore, but there might be some remnance from old ipv4 only days, @Pearl1594 . Why do you think so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Coz I was wondering if then these check should be in an if-else block.

Copy link
Contributor

Choose a reason for hiding this comment

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

in the ipv6 case we have to deal with SLAAC. I don't think we should considder this in this fix. If at all, it is a separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be an import for java.util.Objects missing, @Pearl1594 .

@DaanHoogland DaanHoogland added this to the 4.19.2 milestone Jan 9, 2025
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

@DaanHoogland DaanHoogland self-requested a review January 10, 2025 08:40
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.

3 participants