Problem
talm get <resource> -n <namespace> --nodes $NODE --endpoints $NODE fails with:
rpc error: code = Unavailable desc = name resolver error: produced zero addresses
The short flag -n is bound to the global talm --nodes flag (pkg/commands/root.go defines -n, --nodes strings), not to the subcommand's --namespace. cobra prefers the global short alias, so -n network is parsed as --nodes=network — and network doesn't resolve to any IP, hence the gRPC name-resolver failure.
Native talosctl get uses -n for --namespace. talm reassigned -n at the global level for --nodes, causing the collision for every subcommand that natively uses -n.
Reproduction
talm get hostnames -n network --nodes $NODE --endpoints $NODE
Output:
rpc error: code = Unavailable desc = name resolver error: produced zero addresses
Workaround — use the long flag:
talm get hostnames --namespace network --nodes $NODE --endpoints $NODE
Works.
Expected
Either:
- Document the collision in the talm README /
--help for --nodes: "Note: -n is bound globally to --nodes; use the long --namespace for subcommand namespace selection." (Cheapest fix.)
- Rebind the global short flag to something less common (e.g.
-N) — breaking change for talm users who already script around -n.
- Defer the flag locally for subcommands that have their own
-n — cobra supports per-subcommand short-flag rebinding; the wrapper could re-register -n as --namespace for get / logs / etc.
Option 1 is operator-friendly without breaking existing usage. Option 3 is the operator-best but more invasive.
Why this matters
get -n <ns> is the most idiomatic Talos query pattern (it's in every other doc example). Operators who paste from upstream Talos docs into a talm shell hit the wall. The error message blames DNS rather than flag collision, sending operators on a multi-minute red-herring.
Surfaced during the dev17 read-only sweep.
Problem
talm get <resource> -n <namespace> --nodes $NODE --endpoints $NODEfails with:The short flag
-nis bound to the global talm--nodesflag (pkg/commands/root.godefines-n, --nodes strings), not to the subcommand's--namespace. cobra prefers the global short alias, so-n networkis parsed as--nodes=network— andnetworkdoesn't resolve to any IP, hence the gRPC name-resolver failure.Native
talosctl getuses-nfor--namespace. talm reassigned-nat the global level for--nodes, causing the collision for every subcommand that natively uses-n.Reproduction
Output:
Workaround — use the long flag:
Works.
Expected
Either:
--helpfor--nodes: "Note:-nis bound globally to--nodes; use the long--namespacefor subcommand namespace selection." (Cheapest fix.)-N) — breaking change for talm users who already script around-n.-n— cobra supports per-subcommand short-flag rebinding; the wrapper could re-register-nas--namespaceforget/logs/ etc.Option 1 is operator-friendly without breaking existing usage. Option 3 is the operator-best but more invasive.
Why this matters
get -n <ns>is the most idiomatic Talos query pattern (it's in every other doc example). Operators who paste from upstream Talos docs into a talm shell hit the wall. The error message blames DNS rather than flag collision, sending operators on a multi-minute red-herring.Surfaced during the dev17 read-only sweep.