Skip to content

Commit 936ebbb

Browse files
authored
api: Fix search cluster by name (#5782)
1 parent 995ce06 commit 936ebbb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ public Pair<List<? extends Cluster>, Integer> searchForClusters(final ListCluste
11461146

11471147
final SearchBuilder<ClusterVO> sb = _clusterDao.createSearchBuilder();
11481148
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
1149-
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
1149+
sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ);
11501150
sb.and("podId", sb.entity().getPodId(), SearchCriteria.Op.EQ);
11511151
sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ);
11521152
sb.and("hypervisorType", sb.entity().getHypervisorType(), SearchCriteria.Op.EQ);
@@ -1159,7 +1159,7 @@ public Pair<List<? extends Cluster>, Integer> searchForClusters(final ListCluste
11591159
}
11601160

11611161
if (name != null) {
1162-
sc.setParameters("name", "%" + name + "%");
1162+
sc.setParameters("name", name);
11631163
}
11641164

11651165
if (podId != null) {

0 commit comments

Comments
 (0)