Damans227 commented on code in PR #14293:
URL: https://github.com/apache/cloudstack/pull/14293#discussion_r4258475812


##########
server/src/main/java/com/cloud/api/query/dao/DomainJoinDaoImpl.java:
##########
@@ -217,24 +217,24 @@ public void setResourceLimits(DomainJoinVO domain, 
boolean fullView, ResourceLim
 
         //get resource limits for backups
         long backupLimit = 
ApiDBUtils.findCorrectResourceLimitForDomain(domain.getBackupLimit(), 
ResourceType.backup, domain.getId());
-        String backupLimitDisplay = (fullView || snapshotLimit == -1) ? 
Resource.UNLIMITED : String.valueOf(backupLimit);
+        String backupLimitDisplay = (fullView || backupLimit == -1) ? 
Resource.UNLIMITED : String.valueOf(backupLimit);
         long backupTotal = (domain.getBackupTotal() == null) ? 0 : 
domain.getBackupTotal();
-        String backupAvail = (fullView || snapshotLimit == -1) ? 
Resource.UNLIMITED : String.valueOf(backupLimit - backupTotal);
+        String backupAvail = (fullView || backupLimit == -1) ? 
Resource.UNLIMITED : String.valueOf(backupLimit - backupTotal);
         response.setBackupLimit(backupLimitDisplay);
         response.setBackupTotal(backupTotal);
         response.setBackupAvailable(backupAvail);
 
         //get resource limits for backup storage space and convert it from 
Bytes to GiB
         long backupStorageLimit = 
ApiDBUtils.findCorrectResourceLimitForDomain(domain.getBackupStorageLimit(), 
ResourceType.backup_storage, domain.getId());
-        String backupStorageLimitDisplay = (fullView || backupLimit == -1) ? 
Resource.UNLIMITED : String.valueOf(backupStorageLimit / 
ResourceType.bytesToGiB);
+        String backupStorageLimitDisplay = (fullView || backupStorageLimit == 
-1) ? Resource.UNLIMITED : String.valueOf(backupStorageLimit / 
ResourceType.bytesToGiB);
         long backupStorageTotal = (domain.getBackupStorageTotal() == null) ? 0 
: (domain.getBackupStorageTotal() / ResourceType.bytesToGiB);
         String backupStorageAvail = (fullView || backupStorageLimit == -1) ? 
Resource.UNLIMITED : String.valueOf((backupStorageLimit / 
ResourceType.bytesToGiB) - backupStorageTotal);
         response.setBackupStorageLimit(backupStorageLimitDisplay);
         response.setBackupStorageTotal(backupStorageTotal);
         response.setBackupStorageAvailable(backupStorageAvail);
 
         //get resource limits for buckets
-        long bucketLimit = 
ApiDBUtils.findCorrectResourceLimit(domain.getBucketLimit(), domain.getId(), 
ResourceType.bucket);
+        long bucketLimit = 
ApiDBUtils.findCorrectResourceLimitForDomain(domain.getBucketLimit(), 
ResourceType.bucket, domain.getId());

Review Comment:
   what happens if the domain has no bucket limit set? looks like the fallback 
only reads max.domain.buckets for storage types, so this still shows unlimited 
while creating stops at 20



-- 
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]

Reply via email to