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 class SCMContainerManager implements ContainerManager {
|
||||||
Collections.sort(containersIds);
|
Collections.sort(containersIds);
|
||||||
|
|
||||||
return containersIds.stream()
|
return containersIds.stream()
|
||||||
.filter(id -> id.getId() >= startId)
|
.filter(id -> id.getId() > startId)
|
||||||
.limit(count)
|
.limit(count)
|
||||||
.map(id -> {
|
.map(id -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -294,8 +294,13 @@ public class SCMClientProtocolServer implements
|
||||||
auditMap.put("startContainerID", String.valueOf(startContainerID));
|
auditMap.put("startContainerID", String.valueOf(startContainerID));
|
||||||
auditMap.put("count", String.valueOf(count));
|
auditMap.put("count", String.valueOf(count));
|
||||||
try {
|
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().
|
return scm.getContainerManager().
|
||||||
listContainer(ContainerID.valueof(startContainerID), count);
|
listContainer(containerId, count);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
auditSuccess = false;
|
auditSuccess = false;
|
||||||
AUDIT.logReadFailure(
|
AUDIT.logReadFailure(
|
||||||
|
|
Loading…
Reference in New Issue