Merge release branch 4.18 to 4.19

* 4.18:
  linstor: deleteAsync fallback to volume UUID if path not set yet (#9325)
  linstor: do not use the same static ApiClient for all calls (#9326)
This commit is contained in:
Vishesh 2024-07-05 12:45:27 +05:30
commit ba85b4d4ff
No known key found for this signature in database
GPG Key ID: 4E395186CBFA790B
2 changed files with 4 additions and 3 deletions

View File

@ -271,7 +271,9 @@ public class LinstorPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
case VOLUME:
{
final VolumeInfo volumeInfo = (VolumeInfo) dataObject;
final String rscName = LinstorUtil.RSC_PREFIX + volumeInfo.getPath();
// if volume creation wasn't completely done .setPath wasn't called, so we fallback to vol.getUuid()
final String volUuid = volumeInfo.getPath() != null ? volumeInfo.getPath() : volumeInfo.getUuid();
final String rscName = LinstorUtil.RSC_PREFIX + volUuid;
deleteResourceDefinition(storagePool, rscName);
long usedBytes = storagePool.getUsedBytes();

View File

@ -18,7 +18,6 @@ package org.apache.cloudstack.storage.datastore.util;
import com.linbit.linstor.api.ApiClient;
import com.linbit.linstor.api.ApiException;
import com.linbit.linstor.api.Configuration;
import com.linbit.linstor.api.DevelopersApi;
import com.linbit.linstor.api.model.ApiCallRc;
import com.linbit.linstor.api.model.ApiCallRcList;
@ -52,7 +51,7 @@ public class LinstorUtil {
public static final String CLUSTER_DEFAULT_MAX_IOPS = "clusterDefaultMaxIops";
public static DevelopersApi getLinstorAPI(String linstorUrl) {
ApiClient client = Configuration.getDefaultApiClient();
ApiClient client = new ApiClient();
client.setBasePath(linstorUrl);
return new DevelopersApi(client);
}