Skip to content

Commit e09f425

Browse files
committed
cli: add node attributes to node status
This change add node attributes to the node status endpoint. Without: ```bash ./cockroach node status --insecure id | address | sql_address | build | started_at | updated_at | locality | is_available | is_live -----+-------------------------------+-------------------------------+---------------------+--------------------------------------+--------------------------------------+----------+--------------+---------- 1 | Brams-MacBook-Pro.local:26257 | Brams-MacBook-Pro.local:26257 | v25.2.0-alpha.1-dev | 2025-03-20 17:59:58.470609 +0000 UTC | 2025-03-20 18:03:19.492982 +0000 UTC | | true | true ``` With: ```bash ./cockroach node status --insecure id | address | sql_address | build | started_at | updated_at | locality | attrs | is_available | is_live -----+-------------------------------+-------------------------------+---------------------+--------------------------------------+--------------------------------------+----------+------------------+--------------+---------- 1 | Brams-MacBook-Pro.local:26257 | Brams-MacBook-Pro.local:26257 | v25.2.0-alpha.1-dev | 2025-03-20 17:59:58.470609 +0000 UTC | 2025-03-20 18:03:19.492982 +0000 UTC | | [attrs on node] | true | true ``` This helps with complex setups in which one might use the node attributes in conjuction with zone configs. That they are not currently present seems like an oversight. Part of: https://cockroachlabs.atlassian.net/browse/TREQ-955 Part of: https://cockroachlabs.atlassian.net/browse/FEB-78 Release note (cli change): Node attributes (attrs) will now appear in the node status cli command.
1 parent 099b201 commit e09f425

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/cli/node.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ var baseNodeColumnHeaders = []string{
8989
"started_at",
9090
"updated_at",
9191
"locality",
92+
"attrs",
9293
"is_available",
9394
"is_live",
9495
}
@@ -168,6 +169,7 @@ func runStatusNodeInner(
168169
started_at,
169170
updated_at,
170171
locality,
172+
attrs,
171173
CASE WHEN split_part(expiration,',',1)::decimal > now()::decimal
172174
THEN true
173175
ELSE false

0 commit comments

Comments
 (0)