Skip to content

Could we add a shorthand for --field-selector in kubectl? #1649

Open
@tnqn

Description

@tnqn

What happened?

I’m wondering if the --field-selector option is used frequently enough to justify a shorthand like -F. In our extension API server, we have a field that users need to specify to limit objects within a particular scope, but --field-selector feels a bit lengthy to type compared to the -l shorthand for label selectors. Would it make sense to add a shorthand for --field-selector?

Creating the issue to gather some feedback before introducing such a shorthand as suggested by @soltysh.

The original thread in sig-cli slack channel: https://kubernetes.slack.com/archives/C2GL57FJ4/p1725613426106679

cc @soltysh @apelisse

/sig cli

What did you expect to happen?

A shorthand can be used to filter objects by field selector, such as kubectl get FOO -F .spec.region=BAR.

How can we reproduce it (as minimally and precisely as possible)?

NONE

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# paste output here

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.sig/cliCategorizes an issue or PR as relevant to SIG CLI.triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions