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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]