Hello folks, nice to meet you all.
When I inspect resources with kubectl get -o yaml, labels are displayed as key: value (YAML mapping syntax). But when I filter with a selector, I have to switch to kubectl get -l key=value. Copying a label straight from the YAML output into a -l flag doesn’t work because of the different separator.
I understand the selector grammar (=, ==, !=, in, notin) is an API-level spec, and that the colon is just YAML serialization. Still, since colons aren’t valid characters in label keys or values, accepting key:value in kubectl as sugar for key=value would be unambiguous.
Has this ever been discussed? I searched the kubernetes and kubectl repos and couldn’t find any issue proposing it. Would a proposal to SIG CLI make sense, or is there a known reason this was ruled out?
Thanks!
Regards,
Adol
Cluster information:
Kubernetes version: k8s v1.34
Cloud being used: AWS, Azure, Gcloud
Installation method: kOps/CAPI
Host OS: Ubuntu 24