Skip to content

cmd/get: -o=custom-columns causes -L/--label-columns to be silently ignored #1829

@ahmetb

Description

@ahmetb

What happened:

Specifying both -o=custom-columns and -L causes to kubectl causes the -L/--label-columns flag to be silently ignored (and there's no warning/error printed).

What you expected to happen: If the user is providing a flag, it should be used; otherwise, it should be failing.

How to reproduce it (as minimally and precisely as possible):

kubectl get ns -L kubernetes.io/metadata.name -o=custom-columns=NAME:.metadata.name
NAME
default
kube-node-lease
...
kubectl get ns  -L kubernetes.io/metadata.name
NAME                 STATUS   AGE   METADATA.NAME
default              Active   73d   default
kube-node-lease      Active   73d   kube-node-lease
kube-public          Active   73d   kube-public

Anything else we need to know?: N/A

Environment:

  • Kubernetes client and server versions (use kubectl version): v1.35.0
  • Cloud provider or hardware configuration: irrelevant
  • OS (e.g: cat /etc/os-release): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions