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

cleanup validations for VPN connection creation #9195

Merged

Conversation

DaanHoogland
Copy link
Contributor

Description

This PR adds a validation when creating a VPN connection in a VPC to make sure the VPN gateway exists.

Fixes: #7250

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?

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

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 48 lines in your changes missing coverage. Please review.

Project coverage is 15.08%. Comparing base (67ce326) to head (c9a722b).
Report is 1 commits behind head on 4.19.

Files with missing lines Patch % Lines
...com/cloud/network/vpn/Site2SiteVpnManagerImpl.java 0.00% 48 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #9195      +/-   ##
============================================
- Coverage     15.08%   15.08%   -0.01%     
- Complexity    11182    11183       +1     
============================================
  Files          5402     5402              
  Lines        473137   473148      +11     
  Branches      61094    61020      -74     
============================================
  Hits          71364    71364              
- Misses       393835   393846      +11     
  Partials       7938     7938              
Flag Coverage Δ
uitests 4.30% <ø> (-0.01%) ⬇️
unittests 15.80% <0.00%> (-0.01%) ⬇️

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
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

LGTM, this may need s2s testing if not already covered by a smoketest

Copy link
Collaborator

@hsato03 hsato03 left a comment

Choose a reason for hiding this comment

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

CLGTM.

Just one remark, maybe we can use a unique error message in the getAndValidate methods.

@DaanHoogland
Copy link
Contributor Author

CLGTM.

Just one remark, maybe we can use a unique error message in the getAndValidate methods.

The calls have different messages passed (though only slightly). Can you specify what you would like to see there @hsato03 ?

@hsato03
Copy link
Collaborator

hsato03 commented Jun 19, 2024

CLGTM.
Just one remark, maybe we can use a unique error message in the getAndValidate methods.

The calls have different messages passed (though only slightly). Can you specify what you would like to see there @hsato03 ?

What about throw new InvalidParameterValueException(String.format("Unable to find the specified Site-to-Site VPN customer gateway: %s.", customerGatewayId)); in the getAndValidateSite2SiteCustomerGateway

and throw new InvalidParameterValueException(String.format("Unable to find the specified Site-to-Site VPN gateway %s.", vpnGatewayId)); in the getAndValidateSite2SiteVpnGateway?

This should cover all cases and the errMsg parameter can be removed.

@DaanHoogland DaanHoogland force-pushed the ghi7250-vpnGatewayMissingNotification branch from 5aaa6d4 to 215c5f4 Compare June 20, 2024 08:19
@DaanHoogland
Copy link
Contributor Author

@hsato03 applied your suggestion and did some extra cleanup.

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

minor suggestions, clgtm

@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Jun 21, 2024
@apache apache deleted a comment from blueorangutan Sep 24, 2024
@apache apache deleted a comment from blueorangutan Sep 24, 2024
@apache apache deleted a comment from blueorangutan Sep 24, 2024
@apache apache deleted a comment from blueorangutan Sep 24, 2024
@DaanHoogland
Copy link
Contributor Author

The issue is not resolved. When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.

hm, it has been a while and had some updates. I'll retest and see...

@rajujith , this was probably due to some merge issues, It should work now. I.E. you should not be able to create a VPN connection without having a VPN gateway available. Can you try?

@DaanHoogland

I tried again with the packages from 17th Jul and the issue is not resolved.

When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.

@kiranchavala it was only caught/solved in the API. It is now also the UI.

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11208

@blueorangutan
Copy link

[SF] Trillian test result (tid-11568)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51996 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9195-t11568-kvm-ol8.zip
Smoke tests completed. 132 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py

@DaanHoogland DaanHoogland force-pushed the ghi7250-vpnGatewayMissingNotification branch from 64aa6e2 to c9a722b Compare September 30, 2024 13:23
@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11242

Copy link
Collaborator

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM. It handles the error condition now.

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm

@vishesh92 vishesh92 merged commit 00fe5f1 into apache:4.19 Oct 1, 2024
25 of 26 checks passed
@vishesh92 vishesh92 deleted the ghi7250-vpnGatewayMissingNotification branch October 1, 2024 08:25
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 14, 2024
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.

Enabling site to site vpn connection before enabling VPN Gateway doesn't throw an error message
10 participants