Documentation
¶
Overview ¶
Package ref handles parsing and formatting of [namespace/]name composite references supplied via the `--resource` CLI flag. Parse and Format are inverses: Parse turns a user-typed string into a NamespacedName, Format turns a NamespacedName back into the user's original spelling (bare "name" for cluster-scoped, "namespace/name" for namespaced).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
func Format(n k8stypes.NamespacedName) string
Format renders a NamespacedName the way the user typed it on the command line: bare "name" for cluster-scoped, "namespace/name" for namespaced.
NamespacedName.String() always renders "namespace/name" (so "/foo" for cluster-scoped), which is wrong for human-facing output where users expect their original spelling.
func Parse ¶
func Parse(value string) (k8stypes.NamespacedName, error)
Parse parses a "[namespace/]name" CLI arg into a NamespacedName. Bare "name" (no slash) means cluster-scoped (v1 XRs, v2 cluster-scoped XRs). "ns/name" means namespaced (Claims, v2 namespaced XRs). "/name" (empty namespace before slash) is rejected because the user's intent is clearly namespaced.
Types ¶
This section is empty.