GaOrtiga commented on code in PR #7416:
URL: https://github.com/apache/cloudstack/pull/7416#discussion_r1223389201
##########
api/src/main/java/com/cloud/configuration/Resource.java:
##########
@@ -22,55 +22,34 @@ public interface Resource {
String UNLIMITED = "Unlimited";
enum ResourceType { // Primary and Secondary storage are allocated_storage
and not the physical storage.
- user_vm("user_vm", 0, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- public_ip("public_ip", 1, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- volume("volume", 2, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- snapshot("snapshot", 3, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- template("template", 4, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- project("project", 5, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- network("network", 6, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- vpc("vpc", 7, ResourceOwnerType.Account, ResourceOwnerType.Domain),
- cpu("cpu", 8, ResourceOwnerType.Account, ResourceOwnerType.Domain),
- memory("memory", 9, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- primary_storage("primary_storage", 10, ResourceOwnerType.Account,
ResourceOwnerType.Domain),
- secondary_storage("secondary_storage", 11, ResourceOwnerType.Account,
ResourceOwnerType.Domain);
+ user_vm("user_vm", 0),
Review Comment:
> I don't know this code but maybe it's unnecessary as I read the owner
types are always account and/or domain; possibly this it check that the
ownership is always limited to a domain or account type, could there be any
more types (in future), or be created by plugins etc. which the upstream code
maynot have?
Regarding new owner types, this code has been useless for a long time, and I
don't think we should leave it in on the assumption that it may be used some
day. Would probably be better to clean it up.
> tion @rohityadavcloud. I didn“t see this as a problem yet, but: How is
this for projects? Do resources still belong to an account or domain?
When a project is created, ACS creates an account for it, and its resources
are allocated to that account, so the ResourceOwnerType would be Account.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]