Skip to content

Conversation

@Gargi-jais11
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-12078 added a method ContainerIDParameters#getValidatedIDs to validate and convert container IDs passed from the command line, and fail the command quickly if IDs with invalid syntax are used. This was added for ozone admin container reconcile but should be used for ozone admin container info as well.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13592

How was this patch tested?

Added robot test and new unit tests to TestInfoSubCommand.
Below is the output after local check on docker cluster.

bash-5.1$ ozone admin container info 13 -2  
Container IDs must be positive integers. Invalid container IDs: -2

bash-5.1$ ozone admin container info 14 abc
Container IDs must be positive integers. Invalid container IDs: abc

bash-5.1$ ozone admin container info 1 23 45  
Container id: 1
Pipeline id: cf19c04e-f553-4d38-ab65-0418cb18a3dd
Write PipelineId: 744e21de-3b8c-465e-89c9-76ae5dbb6b29
Write Pipeline State: OPEN
Container State: CLOSED
Datanodes: [ba8cbb1f-8932-4bf7-94bb-df3101063236/ozone-datanode-3.ozone_default]
Replicas: [State: CLOSED; ReplicaIndex: 0; Origin: ba8cbb1f-8932-4bf7-94bb-df3101063236; Location: ba8cbb1f-8932-4bf7-94bb-df3101063236/ozone-datanode-3.ozone_default]

Container id: 23
Pipeline id: 80991d77-4fe5-44cb-a589-774d88921444
Write PipelineId: 744e21de-3b8c-465e-89c9-76ae5dbb6b29
Write Pipeline State: OPEN
Container State: CLOSED
Datanodes: [ba8cbb1f-8932-4bf7-94bb-df3101063236/ozone-datanode-3.ozone_default]
Replicas: [State: CLOSED; ReplicaIndex: 0; Origin: ba8cbb1f-8932-4bf7-94bb-df3101063236; Location: ba8cbb1f-8932-4bf7-94bb-df3101063236/ozone-datanode-3.ozone_default]

Container id: 45
Pipeline id: 61f615a0-f572-4e59-a44c-0f981f4d84ec
Write PipelineId: 744e21de-3b8c-465e-89c9-76ae5dbb6b29
Write Pipeline State: OPEN
Container State: CLOSED
Datanodes: [ba8cbb1f-8932-4bf7-94bb-df3101063236/ozone-datanode-3.ozone_default]
Replicas: [State: CLOSED; ReplicaIndex: 0; Origin: ba8cbb1f-8932-4bf7-94bb-df3101063236; Location: ba8cbb1f-8932-4bf7-94bb-df3101063236/ozone-datanode-3.ozone_default]

@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review September 4, 2025 09:17
@errose28 errose28 self-requested a review September 4, 2025 13:28
Gargi Jaiswal added 2 commits September 8, 2025 10:35
# Conflicts:
#	hadoop-ozone/cli-admin/src/test/java/org/apache/hadoop/hdds/scm/cli/container/TestInfoSubCommand.java
Copy link
Contributor

@sarvekshayr sarvekshayr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @Gargi-jais11

Overall the changes are looking good.

Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment otherwise LGTM.

Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, running the CI now.

@Tejaskriya Tejaskriya merged commit 5c7da6d into apache:master Sep 16, 2025
42 checks passed
@Tejaskriya
Copy link
Contributor

Thanks for the patch @Gargi-jais11 and the reviews @errose28 @sarvekshayr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants