HDDS-1302. Fix SCM CLI does not list container with id 1.
This commit is contained in:
parent
dea6f2a065
commit
73f7b04e2b
@ -200,7 +200,7 @@ public List<ContainerInfo> listContainer(ContainerID startContainerID,
|
||||
Collections.sort(containersIds);
|
||||
|
||||
return containersIds.stream()
|
||||
.filter(id -> id.getId() >= startId)
|
||||
.filter(id -> id.getId() > startId)
|
||||
.limit(count)
|
||||
.map(id -> {
|
||||
try {
|
||||
|
@ -294,8 +294,13 @@ public List<ContainerInfo> listContainer(long startContainerID,
|
||||
auditMap.put("startContainerID", String.valueOf(startContainerID));
|
||||
auditMap.put("count", String.valueOf(count));
|
||||
try {
|
||||
// To allow startcontainerId to take the value "0",
|
||||
// "null" is assigned, so that its handled in the
|
||||
// scm.getContainerManager().listContainer method
|
||||
final ContainerID containerId = startContainerID != 0 ? ContainerID
|
||||
.valueof(startContainerID) : null;
|
||||
return scm.getContainerManager().
|
||||
listContainer(ContainerID.valueof(startContainerID), count);
|
||||
listContainer(containerId, count);
|
||||
} catch (Exception ex) {
|
||||
auditSuccess = false;
|
||||
AUDIT.logReadFailure(
|
||||
|
Loading…
Reference in New Issue
Block a user