Skip to content

Commit 0d8f7d4

Browse files
committed
Merge release branch 4.19 to main
* 4.19: linstor: disconnect-disk also search for resource name in Linstor (#9035) ui: add support to change Account role for admins (#9012) Use parameter dcId as wrapper to prevent NPE (#8986)
2 parents ab8197c + 92ba476 commit 0d8f7d4

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ public interface EndPointSelector {
4747

4848
EndPoint select(DataStore store, String downloadUrl);
4949

50-
EndPoint findSsvm(long dcId);
50+
EndPoint findSsvm(Long dcId);
5151
}

engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
339339
* Finds an SSVM that can be used to execute a command.
340340
* For zone-wide image store, use SSVM for that zone. For region-wide store, we can arbitrarily pick one SSVM to do the task.
341341
* */
342-
public EndPoint findSsvm(long dcId) {
342+
@Override
343+
public EndPoint findSsvm(Long dcId) {
343344
List<HostVO> ssAHosts = listUpAndConnectingSecondaryStorageVmHost(dcId);
344345
if (ssAHosts == null || ssAHosts.isEmpty()) {
345346
return null;

plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ private boolean tryDisconnectLinstor(String volumePath, KVMStoragePool pool)
321321
null,
322322
null);
323323

324-
optRsc = getResourceByPath(resources, volumePath);
324+
optRsc = getResourceByPathOrName(resources, volumePath);
325325
} catch (ApiException apiEx) {
326326
// couldn't query linstor controller
327327
logger.error(apiEx.getBestMessage());
@@ -381,9 +381,10 @@ public boolean disconnectPhysicalDisk(Map<String, String> volumeToDisconnect)
381381
return false;
382382
}
383383

384-
private Optional<ResourceWithVolumes> getResourceByPath(final List<ResourceWithVolumes> resources, String path) {
384+
private Optional<ResourceWithVolumes> getResourceByPathOrName(
385+
final List<ResourceWithVolumes> resources, String path) {
385386
return resources.stream()
386-
.filter(rsc -> rsc.getVolumes().stream()
387+
.filter(rsc -> getLinstorRscName(path).equalsIgnoreCase(rsc.getName()) || rsc.getVolumes().stream()
387388
.anyMatch(v -> path.equals(v.getDevicePath())))
388389
.findFirst();
389390
}

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@
17861786
"label.restore.volume.attach": "Restore volume and attach",
17871787
"label.review": "Review",
17881788
"label.role": "Role",
1789+
"label.roleid": "Role",
17891790
"label.rolename": "Role",
17901791
"label.roles": "Roles",
17911792
"label.roletype": "Role Type",

ui/src/config/section/account.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default {
9191
icon: 'edit-outlined',
9292
label: 'label.action.edit.account',
9393
dataView: true,
94-
args: ['newname', 'account', 'domainid', 'networkdomain'],
94+
args: ['newname', 'account', 'domainid', 'networkdomain', 'roleid'],
9595
mapping: {
9696
account: {
9797
value: (record) => { return record.name }

0 commit comments

Comments
 (0)