slavkap commented on code in PR #10126:
URL: https://github.com/apache/cloudstack/pull/10126#discussion_r1931890997


##########
plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java:
##########
@@ -393,11 +400,56 @@ private String getRscGrp(StoragePoolVO storagePoolVO) {
             storagePoolVO.getUserInfo() : "DfltRscGrp";
     }
 
+    /**
+     * Returns the layerlist of the resourceGroup with encryption(LUKS) added 
above STORAGE.
+     * If the resourceGroup layer list already contains LUKS this layer list 
will be returned.
+     * @param api Linstor developers API
+     * @param resourceGroup Resource group to get the encryption layer list
+     * @return layer list with LUKS added
+     */
+    public List<LayerType> getEncryptedLayerList(DevelopersApi api, String 
resourceGroup) {
+        try {
+            List<ResourceGroup> rscGrps = api.resourceGroupList(
+                    Collections.singletonList(resourceGroup), 
Collections.emptyList(), null, null);
+
+            if (rscGrps == null || rscGrps.isEmpty()) {

Review Comment:
   ```suggestion
               if (CollectionUtils.isEmpty(rscGrps)) {
   ```



-- 
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-unsubscr...@cloudstack.apache.org

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

Reply via email to