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


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3485,7 +3485,9 @@ private Ternary<List<Long>, Integer, String[]> 
searchForDiskOfferingsIdsAndCount
 
                 SearchCriteria<DiskOfferingVO> sc = 
diskOfferingSearch.create();
                 sc.setParameters("computeOnly", false);
-                sc.setParameters("activeState", DiskOffering.State.Active);
+                if (state != null) {
+                    sc.setParameters("state", state);
+                }

Review Comment:
   @DaanHoogland 
   as @vishesh92 mentioned in 
https://github.com/apache/cloudstack/pull/10916#discussion_r2106752911
   
   actually state is not null
   
   
https://github.com/apache/cloudstack/blob/99863c2fa5a57d8ddf1b4b40c647b159d96dc74c/api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java#L113-L122
   
   
   `sc.setParameters("activeState", DiskOffering.State.Active);` is never used 
as `activeState` is not set in the search builder.
   
   This PR does change the API output, but I think it is a bug. 



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