You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "weizhouapache (via GitHub)" <gi...@apache.org> on 2023/06/26 13:53:14 UTC

[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7441: Use max secondary storage defined on the account during upload

weizhouapache commented on code in PR #7441:
URL: https://github.com/apache/cloudstack/pull/7441#discussion_r1242232690


##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -477,13 +477,12 @@ public GetUploadParamsResponse doInTransaction(TransactionStatus status) throws
                 //using the existing max upload size configuration
                 command.setProcessTimeout(NumbersUtil.parseLong(_configDao.getValue("vmware.package.ova.timeout"), 3600));
                 command.setMaxUploadSize(_configDao.getValue(Config.MaxUploadVolumeSize.key()));
-                command.setAccountId(vol.getAccountId());
-                Account account = _accountDao.findById(vol.getAccountId());
-                if (account.getType().equals(Account.Type.PROJECT)) {
-                    command.setDefaultMaxSecondaryStorageInGB(ResourceLimitService.MaxProjectSecondaryStorage.value());
-                } else {
-                    command.setDefaultMaxSecondaryStorageInGB(ResourceLimitService.MaxAccountSecondaryStorage.value());
-                }
+
+                Long accountId = vol.getAccountId();
+                Account account = _accountDao.findById(accountId);
+
+                command.setDefaultMaxSecondaryStorageInGB(_resourceLimitMgr.findCorrectResourceLimitForAccount(account, ResourceType.secondary_storage));

Review Comment:
   @JoaoJandre 
   I think the domain resource limitation should be considered as well, as the account resource limitation might exceed the domain resource limitation.



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org