kubernetes / kubernetes/kubectl
Could we add a shorthand for --field-selector in kubectl?
- Dominant language
- Go
- Stars
- 3.3k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### 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
```console
$ kubectl version
# paste output here
```
### Cloud provider
### OS version
```console
# 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)
Contributor guide
Research direction
Start with the proposed `-F` syntax and the linked SIG CLI Slack discussion to understand the feedback and open questions. The issue names no files or tests, and completion is not defined beyond deciding whether kubectl should support a field-selector shorthand.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100