Skip to content

Conversation

@BryanMLima
Copy link
Contributor

@BryanMLima BryanMLima commented Dec 18, 2024

Description

This PR adds the OwnershipSelection component to VPC networks forms, allowing users to specify the account or project that will own the VPC.

Fixes: #10121

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

Screenshots (if appropriate):

image

How Has This Been Tested?

In a local lab with the following domain structure:

ROOT
|- dom-A
|- dom-B
\ - subdom-B

With a Root Admin account, I was able to create a VPC for a user in the ROOT, dom-A, dom-B and subdom-B domains. I validated that the account/project owner of the VPC was the one specified in the form, and not the caller account.

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

With ACS set to Brazilian Portuguese, the VPC was always created to the caller account. With the changes of PR #10052, this situation does not happen.

@codecov
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.03%. Comparing base (ac19379) to head (d17fa25).
Report is 10 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #10124      +/-   ##
============================================
- Coverage     16.03%   16.03%   -0.01%     
- Complexity    12814    12815       +1     
============================================
  Files          5637     5637              
  Lines        493507   493527      +20     
  Branches      59831    59837       +6     
============================================
  Hits          79131    79131              
- Misses       405600   405620      +20     
  Partials       8776     8776              
Flag Coverage Δ
uitests 4.02% <ø> (-0.01%) ⬇️
unittests 16.87% <ø> (ø)

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.

@BryanMLima
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@BryanMLima a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10124 (QA-JID-502)

@BryanMLima BryanMLima marked this pull request as ready for review December 18, 2024 14:06
@BryanMLima
Copy link
Contributor Author

UI build: ✔️ Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10124 (QA-JID-502)

There seems to be a problem when creating VPCs in this environment, the same happens when using this one #10052 (comment), which did not change anything regarding the VPC form. In my local lab with the 4.20 version, this does not happen, the UI env is using version 4.19.1.2, so it is worth investigating.

@DaanHoogland
Copy link
Contributor

@BryanMLima , yes that is right. I'll see about updating it but in the meanwhile,
@kiranchavala , can you run a 4.20 env to verify this?

@kiranchavala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@kiranchavala 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 11848

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

@BryanMLima

Found this small minor issue during filtering of vpc based on account domain

  1. Create domain and subdomain
  2. Create vpc under admin , domain and subdomain
  3. Navigate to filter under vpc , select the account
  4. Cloudstack UI doesn't list the vpc's that belong to the account
  5. Exception is thrown
  6. select the domain , domain selection doesn't persist

The API call works fine


(localcloud) 🐱 > list vpcs listall=true account=acdm1 domainid=9298426a-82a2-40a6-9830-2569124dff0d filter=name
{
  "count": 1,
  "vpc": [
    {
      "name": "vpc1"
    }
  ]
}
(localcloud) 🐱 > list vpcs listall=true account=subdomain1  domainid=10cf3a25-b0fc-4501-93e0-8ecc4d355544  filter=name
{
  "count": 1,
  "vpc": [
    {
      "name": "subdomainvpc"
    }
  ]
}

Screen recording

https://www.loom.com/share/bcef796e0f894f10a2a3f4952db8d240?sid=b0eda87f-73cf-4db9-b7b3-aa16f9b143b4

@BryanMLima
Copy link
Contributor Author

@BryanMLima

Found this small minor issue during filtering of vpc based on account domain

1. Create domain and subdomain

2. Create vpc under admin , domain and subdomain

3. Navigate to filter under vpc , select the account

4. Cloudstack UI doesn't list the vpc's that belong to the account

5. Exception is thrown

6. select the domain , domain selection doesn't persist

The API call works fine


(localcloud) 🐱 > list vpcs listall=true account=acdm1 domainid=9298426a-82a2-40a6-9830-2569124dff0d filter=name
{
  "count": 1,
  "vpc": [
    {
      "name": "vpc1"
    }
  ]
}
(localcloud) 🐱 > list vpcs listall=true account=subdomain1  domainid=10cf3a25-b0fc-4501-93e0-8ecc4d355544  filter=name
{
  "count": 1,
  "vpc": [
    {
      "name": "subdomainvpc"
    }
  ]
}

Screen recording

https://www.loom.com/share/bcef796e0f894f10a2a3f4952db8d240?sid=b0eda87f-73cf-4db9-b7b3-aa16f9b143b4

@kiranchavala, nice catch, though, this seems related to the ListView.vue file. I did some testing, and the problem is that when filtering for an account for VPC, if the domain is not specified, then the account will not be found. In the CMK command you presented, the domainId is passed, therefore, the account is found. This probably affects more resources views, as the ListView.vue is used in multiple cases.

I also tested the filter in other resources views, such as VM and Guest networks, and the domain is never set. I will try to investigate further, but this fix should be on another PR, as it is not related to this PR's changes.

@kiranchavala
Copy link
Contributor

@BryanMLima
Found this small minor issue during filtering of vpc based on account domain

1. Create domain and subdomain

2. Create vpc under admin , domain and subdomain

3. Navigate to filter under vpc , select the account

4. Cloudstack UI doesn't list the vpc's that belong to the account

5. Exception is thrown

6. select the domain , domain selection doesn't persist

The API call works fine


(localcloud) 🐱 > list vpcs listall=true account=acdm1 domainid=9298426a-82a2-40a6-9830-2569124dff0d filter=name
{
  "count": 1,
  "vpc": [
    {
      "name": "vpc1"
    }
  ]
}
(localcloud) 🐱 > list vpcs listall=true account=subdomain1  domainid=10cf3a25-b0fc-4501-93e0-8ecc4d355544  filter=name
{
  "count": 1,
  "vpc": [
    {
      "name": "subdomainvpc"
    }
  ]
}

Screen recording
https://www.loom.com/share/bcef796e0f894f10a2a3f4952db8d240?sid=b0eda87f-73cf-4db9-b7b3-aa16f9b143b4

@kiranchavala, nice catch, though, this seems related to the ListView.vue file. I did some testing, and the problem is that when filtering for an account for VPC, if the domain is not specified, then the account will not be found. In the CMK command you presented, the domainId is passed, therefore, the account is found. This probably affects more resources views, as the ListView.vue is used in multiple cases.

I also tested the filter in other resources views, such as VM and Guest networks, and the domain is never set. I will try to investigate further, but this fix should be on another PR, as it is not related to this PR's changes.

Thanks @BryanMLima I will create a separate issue for this

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM tested manually

Able to create vpc from the UI for a account, domain and subdomain also able to create for a project

Screenshot 2024-12-23 at 1 31 46 PM
Screenshot 2024-12-23 at 1 32 01 PM
vpc1
vpc2
vpc3

@DaanHoogland DaanHoogland merged commit cbac6cc into apache:4.20 Dec 23, 2024
25 checks passed
DaanHoogland added a commit that referenced this pull request Dec 23, 2024
* 4.20:
  Add ownership selection to VPC form (#10124)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 26, 2024
@Pearl1594 Pearl1594 moved this to Done in ACS 4.20.1 Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Creating VPC Network as admin there is no option to select Domain and Account

5 participants