mirror of https://github.com/apache/cloudstack.git
linstor: do not use the same static ApiClient for all calls (#9326)
The client.setBasePath() would overwrite the Linstor controller IP/host for all current client users. This is basically a race condition that triggered as soon as you had configured 2 different primary storages with different Linstor controllers.
This commit is contained in:
parent
983f164c57
commit
121a35d666
|
|
@ -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;
|
||||
|
|
@ -46,7 +45,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue