Repository navigation
Description
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 $NODEOutput:
rpc error: code = Unavailable desc = name resolver error: produced zero addresses
Workaround — use the long flag:
talm get hostnames --namespace network --nodes $NODE --endpoints $NODEWorks.
Expected
Either:
- Document the collision in the talm README /
--helpfor--nodes: "Note:-nis bound globally to--nodes; use the long--namespacefor 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-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.
Activity
feat(commands): wrapper UX hardening — persistent flags, -n drop, cra…
feat(commands): wrapper UX hardening — persistent flags, -n drop, cra…
feat(commands): wrapper UX hardening — persistent flags, -n drop, cra…
feat(commands): wrapper UX hardening — persistent flags, -n drop, cra…