Commit Graph

239 Commits (f34a24e98e7c837b567b78be3af958ac1156cd80)

Author SHA1 Message Date
Maru Newby adc338d330 Remove all traces of federation 2017-10-26 13:37:37 -07:00
Mark Janssen a9ed995a81 Add missing short names to kubectl help text
Add two resource type short names that are available but not included in
the resource types help text that appears when running `kubectl get`.
2017-10-08 15:59:44 +02:00
Kubernetes Submit Queue 551c4581c2 Merge pull request #48267 from superbrothers/clusterrole-flag-completion
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support completions for --clusterrole of kubectl create clusterrolebinding

**What this PR does / why we need it**:
This PR supports completion for --clusterrole of kubectl create clusterrolebinding.
```
$ kubectl create clusterrolebinding hoge --clusterrole <tab>
admin                                         system:controller:daemon-set-controller       system:controller:node-controller             system:controller:service-controller          system:kube-scheduler
cluster-admin                                 system:controller:deployment-controller       system:controller:persistent-volume-binder    system:controller:statefulset-controller      system:node
edit                                          system:controller:disruption-controller       system:controller:pod-garbage-collector       system:controller:ttl-controller              system:node-bootstrapper
system:auth-delegator                         system:controller:endpoint-controller         system:controller:replicaset-controller       system:discovery                              system:node-problem-detector
system:basic-user                             system:controller:generic-garbage-collector   system:controller:replication-controller      system:heapster                               system:node-proxier
system:controller:attachdetach-controller     system:controller:horizontal-pod-autoscaler   system:controller:resourcequota-controller    system:kube-aggregator                        system:persistent-volume-provisioner
system:controller:certificate-controller      system:controller:job-controller              system:controller:route-controller            system:kube-controller-manager                view
system:controller:cronjob-controller          system:controller:namespace-controller        system:controller:service-account-controller  system:kube-dns
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

I feel that it is better to except system clusterroles from completion candidates. What do you think about it?

**Release note**:

```release-note
Support completion for --clusterrole of kubectl create clusterrolebinding
```
2017-10-03 22:04:00 -07:00
juanvallejo dfef8574cf
error msg fixes
Miscellaneous error message tweaks.
Makes the error message displayed in `kubectl get` more visible.
Returns exit code 1 if a patch fails.
2017-09-13 17:55:29 -04:00
zhengjiajin 357db0c39c Add kubectl set env command 2017-08-25 19:53:22 +08:00
Kubernetes Submit Queue d5ab597eb3 Merge pull request #49935 from xiangpengzhao/remove-dep-alias
Automatic merge from submit-queue (batch tested with PRs 50806, 48789, 49922, 49935, 50438)

Remove deprecated kubectl command aliases

**What this PR does / why we need it**:
These command aliases have been deprecated for more than two years. It's time to remove them.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
ref: #8319 #6118 #8596

**Special notes for your reviewer**:
/sig cli

**Release note**:

```release-note
Remove deprecated kubectl command aliases `apiversions, clusterinfo, resize, rollingupdate, run-container, update`
```
2017-08-22 19:45:34 -07:00
ymqytw b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
Kazuki Suda 1b4da8f66a Support completions for --clusterrole of kubectl create clusterrolebinding 2017-08-16 19:36:40 +09:00
shiywang d14660c271 remove deprecated command 'kubectl stop' 2017-08-16 08:34:44 +08:00
xiangpengzhao d6aca27b53 Remove deprecated kubectl command aliases 2017-08-02 03:08:48 -04:00
xiangpengzhao 396c596e07
Add customresourcedefinition and its shortcut in "kubectl get" 2017-07-18 15:31:56 +08:00
Kubernetes Submit Queue 4b4e91977d Merge pull request #48274 from superbrothers/fix-to-override-kubectl-flags
Automatic merge from submit-queue (batch tested with PRs 48381, 48274)

Fix completions for --namespace to override kubectl flags

**What this PR does / why we need it**:
This PR fixes completions for --namespace to override kubectl flags. Due to not using __kubectl_parse_get, __kubectl_get_namespaces doesn't support to override kubectl flags.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-16 19:03:36 -07:00
Kubernetes Submit Queue 0049dd0717 Merge pull request #48381 from superbrothers/completion-kubectl-config-delete-cluster
Automatic merge from submit-queue

Support completion for kubectl config delete-cluster

**What this PR does / why we need it**:
This PR supports completion for kubectl config delete-cluster.
```
$ kubectl config delete-cluster <tab>
cluster01  minikube
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Support completion for kubectl config delete-cluster
```
2017-07-16 18:50:08 -07:00
juanvallejo f28ffdb5e9
replace hardcoded use of "kubectl" in apply warning msg 2017-07-13 16:19:19 -04:00
deads2k 0801ded425 remove dead code 2017-07-07 09:12:29 -04:00
Kazuki Suda 4eee8ea119 Support completion for kubectl config delete-cluster 2017-07-01 22:01:43 +09:00
Kazuki Suda 4cdc5247fc Rename function to follow other similar functions 2017-06-29 23:32:22 +09:00
Kazuki Suda fe598e0401 Fix completions for --namespace to override flags
Due to not using __kubectl_parse_get, __kubectl_get_namespaces doesn't
support to override kubectl flags.
2017-06-29 23:25:12 +09:00
Kubernetes Submit Queue 1864a2403c Merge pull request #46151 from verb/kubectl-featuregate
Automatic merge from submit-queue

Add alpha command to kubectl

Also allow new commands to disable themselves by returning a nil value. This can be used to disable commands based on feature gates.

**What this PR does / why we need it**: Method of enabling alpha functionality in kubectl

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: ref #45922

**Special notes for your reviewer**: Part of a discussion in #45922 with @pwittrock

**Release note**:

```release-note
NONE
```
2017-06-23 05:00:35 -07:00
Kubernetes Submit Queue 625a980941 Merge pull request #46696 from xiangpengzhao/mark-deprecated-command
Automatic merge from submit-queue (batch tested with PRs 47227, 47119, 46280, 47414, 46696)

Mark deprecated info in short description of deprecated commands.

**What this PR does / why we need it**:
Mark deprecated commands in 'kubectl help'. See https://github.com/kubernetes/kubectl/issues/20

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/kubernetes/kubectl/issues/20

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-06-22 23:59:28 -07:00
Lee Verberne 01c7d129fb Create a kubectl alpha subcommand
Alpha commands can be added under `kubectl alpha` and are always
accessible (regardless of feature gates). If no alpha commands have been
defined then `alpha` is not displayed in `help`.
2017-06-16 07:09:21 +00:00
Kazuki Suda 11230907b3 Fix missing __kubectl_parse_config 2017-06-11 07:12:23 +09:00
Janet Kuo 97ebcc8382 Add controllerrevisions as valid resource in kubectl help 2017-05-31 13:18:26 -07:00
xiangpengzhao 7092307f5e
Mark deprecated info in short description of deprecated commands. 2017-05-30 15:43:50 +08:00
Alexander Campbell 0d65d9594c cmd/options: `kubectl options` writes to `out` stream
Previous behavior was to write to stderr (thanks to the fallback system
in the Cobra library), which made it difficult to grep for flags.

For example:

	kubectl options | grep recursive
2017-05-28 11:23:44 -07:00
Alexander Campbell 2f0faedbee kubectl: make "Deprecated" a private function
There's no reason to export this function, so I've made it private.
2017-05-19 10:45:49 -07:00
Alexander Campbell bf2fc62144 kubectl: renmae deprecatedCmd -> deprecatedAlias
This will clear up some of the confusion around the deprecatedCmd /
Deprecated function.
2017-05-19 10:40:21 -07:00
Alexander Campbell b3fc6556e4 kubectl: improve docstring on deprecatedCmd 2017-05-19 08:55:12 -07:00
Alexander Campbell 9e7f29c3fb cmd: fix deprecation warning bug
Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl scale [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 scale [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.
2017-05-18 16:48:13 -07:00
Kubernetes Submit Queue 148b5da60b Merge pull request #44746 from xiangpengzhao/fix-podpreset
Automatic merge from submit-queue

Add support for PodPreset in `kubectl get` command

**What this PR does / why we need it**:
PR title

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #44736

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-09 21:16:17 -07:00
xiangpengzhao baafbf406e Add support for PodPreset in kubectl get command 2017-05-10 08:59:22 +08:00
Kubernetes Submit Queue d4ece0abc3 Merge pull request #37499 from fabianofranz/kubectl_plugins
Automatic merge from submit-queue

kubectl binary plugins

**What this PR does / why we need it**:

Introduces the ability to extend `kubectl` by adding third-party plugins that will be exposed through `kubectl`.

Plugins are executable commands written in any language. To be included as a plugin, a binary or script file has to

1. be located under one of the supported plugin path locations:
1.1 `~/.kubectl/plugins` dir
1.2. one or more directory set in the `KUBECTL_PLUGINS_PATH` env var
1.3. the `kubectl/plugins` dir under one or more directory set in the `XDG_DATA_DIRS` env var, which defaults to `/usr/local/share:/usr/share`
2. in any of the plugin path above, have a subfolder with the plugin file(s)
3. in the subfolder, contain at least a `plugin.yaml` file that describes the plugin

Example:

```
$ cat ~/.kube/plugins/myplugin/plugin.yaml
name: "myplugin"
shortDesc: "My plugin's short description"
command: "echo Hello plugins!"

$ kubectl myplugin
Hello plugins!
```

~~In case the plugin declares `tunnel: true`, the plugin engine will pass the `KUBECTL_PLUGIN_API_HOST` env var when calling the plugin binary. Plugins can then access the Kube REST API in "http://$KUBECTL_PLUGIN_API_HOST/api" using the same context currently in use by `kubectl`.~~

Test plugins are provided in `pkg/kubectl/plugins/examples`. Just copy (or symlink) the files to `~/.kube/plugins` to test.

**Which issue this PR fixes**:

Related to the discussions in the proposal document: https://github.com/kubernetes/kubernetes/pull/30086 and https://github.com/kubernetes/community/pull/122.

**Release note**:
```release-note
Introduces the ability to extend kubectl by adding third-party plugins. Developer preview, please refer to the documentation for instructions about how to use it.
```
2017-04-28 12:23:59 -07:00
Fabiano Franz 2158473474 Plugins are loaded under the 'kubectl plugin' command 2017-04-28 01:34:07 -03:00
Fabiano Franz 2b178ad608 Basic support for kubectl plugins 2017-04-28 01:34:07 -03:00
bruceauyeung ab4029c85b Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
rename variables to make sure that they conform to golang variable name convention
2017-04-25 15:07:01 +08:00
Kubernetes Submit Queue 390e98721f Merge pull request #42241 from xiangpengzhao/shortname-np
Automatic merge from submit-queue (batch tested with PRs 44862, 42241, 42101, 43181, 44147)

Add short name "netpol" for networkpolicies

**What this PR does / why we need it**:
Add short name for `networkpolicies` in kubectl command for good user experience.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
None

**Special notes for your reviewer**:
None

**Release note**:

```release-note
Add short name "netpol" for networkpolicies
```
2017-04-24 19:39:40 -07:00
Kubernetes Submit Queue c3463d737e Merge pull request #44251 from superbrothers/completion-cluster-user-flags
Automatic merge from submit-queue

Support completion for --cluster and --user

**What this PR does / why we need it**:

kubectl is supported completion for `--cluster` and `--user`.

```
$ kubectl --user=<tab>
--user=minikube  --user=user01

$ kubectl --cluster=<tab>
--cluster=cluster01  --cluster=minikube
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Add completion support for --namespace and --cluster to kubectl
```
2017-04-13 08:42:04 -07:00
Kubernetes Submit Queue 19d722671b Merge pull request #43297 from mvdan/kubectl-params
Automatic merge from submit-queue

kubectl/cmd: remove a bunch of unused parameters

Found with github.com/mvdan/unparam.

**Release note**: NONE
2017-04-13 04:07:21 -07:00
Kazuki Suda 2b1078e61e Support completion for --cluster and --user
With this commit, kubectl is supported completion for `--cluster` and `--user`.

```
$ kubectl --user=<tab>
--user=minikube  --user=user01

$ kubectl --cluster=<tab>
--cluster=cluster01  --cluster=minikube
```
2017-04-09 15:11:21 +09:00
Kubernetes Submit Queue 0a7fa6926a Merge pull request #42336 from superbrothers/context-completion-for-config-use-context
Automatic merge from submit-queue (batch tested with PRs 44119, 42538, 43802, 42336, 43396)

Support context completion for kubectl config use-context

**What this PR does / why we need it**:

With this PRt, kubectl is supported context completion for config use-context.

```
$ ./kubectl config use-context
cluster01  minikube
```

/ref  #42103 

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

#29386

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-04-07 14:09:40 -07:00
Daniel Martí 810dbc5e98 kubectl/cmd: remove a bunch of unused parameters
Found with github.com/mvdan/unparam.
2017-04-04 10:36:30 +01:00
shiywang 4a3dad1da6 add cronjob resource name for get -h 2017-03-25 17:42:02 +08:00
Kazuki Suda a46b04dc78 Support context completion for kubectl config use-context
With this commit, kubectl is supported context completion for config
use-context.

```
$ ./kubectl config use-context
cluster01  minikube
```

/refs #42103, #29386
2017-03-02 00:48:08 +09:00
Kubernetes Submit Queue ba7c533fb0 Merge pull request #42103 from superbrothers/kubectl-context-completion
Automatic merge from submit-queue (batch tested with PRs 38676, 41765, 42103, 41833, 41702)

Support --context flag completion for kubectl

**What this PR does / why we need it**:

With this PR, `--context` flag completion is supported for kubectl.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-03-01 01:44:07 -08:00
xiangpengzhao 5daa6980e1 Add short name "netpol" for networkpolicies 2017-03-01 14:40:56 +08:00
Kazuki Suda 4da41ca56c Support --context flag completion for kubectl 2017-02-25 23:54:56 +09:00
deads2k 5b4a611fd7 add kubectl can-i to see if you can perform an action 2017-02-23 09:12:35 -05:00
Brendan Burns d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
Dr. Stefan Schimanski 82826ec273 pkg/util/flag: move to k8s.io/apiserver 2017-01-24 20:56:03 +01:00
deads2k 335ef747d6 mechanical 2017-01-23 10:03:55 -05:00