Fix assignVirtualMachine template checkAccess - #8886
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #8886 +/- ##
============================================
+ Coverage 30.82% 33.10% +2.27%
- Complexity 34017 34315 +298
============================================
Files 5341 4998 -343
Lines 375033 348272 -26761
Branches 54554 49846 -4708
============================================
- Hits 115597 115283 -314
+ Misses 244159 217810 -26349
+ Partials 15277 15179 -98
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@blueorangutan package |
|
@sureshanaparti 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 9173 |
|
@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-9752)
|
|
LGTM. Reproduced the tests and verified that the |
|
@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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9964 |
|
Hi, @DaanHoogland @weizhouapache Is there anything missing in this one? |
@gpordeus |
|
I think @weizhouapache accidenly add the tag https://github.com/apache/cloudstack/labels/status%3Aneeds-testing when he saw the test report by @hsato03 , thinking he was removing it. It is ready I think. (@weizhouapache already approved) |
Description
This PR changes the checkAccess of when assigning a VM to check for the template itself instead of the account owner of the template. In this way, there is no need for checking if the template is public (it already does so inside checkAccess) and it gives a better message when the assigning fails because of it:
Instead of:
Also, current ACS lets you assign a VM with a public template of domain B to an account of domain A even if
share.public.templates.with.other.domainsis false. This also fixes it.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
In a local lab with:
I then reproduced the following cases:
share.public.templates.with.other.domainstrue)share.public.templates.with.other.domainsfalse)