Commit Graph

314 Commits

Author SHA1 Message Date
Julian V. Modesto
932500c015 Remove deprecated rolling-update command 2020-02-13 23:52:53 -05:00
Sean Sullivan
2a3f28863b Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
Maciej Szulik
ab1c56ae87
Move kubectl cp back to k/k 2019-08-29 09:00:47 +02:00
Sean Sullivan
2621e6a0d6 Unexport kubectl cmd profiling 2019-08-02 12:45:15 -07:00
Sean Sullivan
dc743f7edd Update BUILD files reflecting code move to staging 2019-08-01 13:12:31 -07:00
Sean Sullivan
acece3c296 Update import statements to reflect code move 2019-08-01 11:15:39 -07:00
Daisuke Taniwaki
707f1a2832
Fix unexpected line end in override flags 2019-07-31 18:46:28 +09:00
Sean Sullivan
6c96a059dd Move pkg/kubectl/cmd/util and subdirs to staging 2019-07-29 13:08:41 -07:00
Sean Sullivan
70984d8385 Moves pkg/kubectl/util/i18n to staging 2019-07-25 23:09:34 -07:00
Daisuke Taniwaki
4200d6c2cc
Avoid conflicts with other cobra auto completion 2019-07-10 13:32:29 +09:00
Kubernetes Prow Robot
dd9ae9a1d2
Merge pull request #76227 from sawlanipradeep/window-plugin-fix
Replace syscall.Execve with exec.Command.
2019-07-08 13:00:36 -07:00
Pradeep Sawlani
13be373ce7 For windows, use exec.Command instead of syscall.Execve.
sycall.Execve is not supported on windows.
2019-07-08 10:09:51 -07:00
Peter Swica
123fa89f21 Moved pkg/kubectl/util/term, pkg/kubectl/util/templates, pkg/kubectl/util/interrupt, and pkg/kubectl/util/interrupt to staging 2019-06-20 15:50:16 -04:00
Kubernetes Prow Robot
7511e93371
Merge pull request #71906 from Pingan2017/remove-deprecatedAlias
remove unused func deprecatedAlias
2019-04-25 10:18:48 -07:00
Pingan2017
c1243ddd05 remove unused func deprecatedAlias 2019-04-11 10:17:49 +08:00
Jordan Liggitt
a6034e511c Restore username and password kubectl flags 2019-03-18 17:16:49 -04:00
Marek Counts
7744f90830 Moved flag and globalflag
Moved all flag code from `staging/src/k8s.io/apiserver/pkg/util/[flag|globalflag]` to `component-base/cli/[flag|globalflag]` except for the term function because of unwanted dependencies.
2019-02-15 10:28:13 -05:00
Jingfang Liu
8d6ab20753 add kustomize as a subcommand in kubectl 2019-02-11 16:43:57 -08:00
juanvallejo
0257a2bcee
allow re-usability of plugin handler, allow support for multiple valid plugin filename prefixes 2019-02-01 16:17:47 -05:00
Danny Shemesh
aae1944a07 Added windows executable extensions to Kubectl plugins
Currently, the kubectl plugins system - when running under Windows - will determine that a plugin is executable
by looking at its extension, comparing it to '.exe'.

I think we should allow plugins w/ a few more known extensions (.bat, .com, .cmd; for example) -
This would give more of a similar experience to plugins under *nix, where shell scripts are often used.

Moreover, there were two windows-specific behaviors that were redundant,
which I've removed:

1. In plugin.go - There's no need to differentiate between windows and
under OS-es when looking at the PATH variable; It can be refered as 'PATH'
in Windows as well

2. In cmd.go - There's no need to append a suffix when looking up
plugins on windows; One can safely use 'exec.LookPath' without a suffix
on Windows - and get automatic resolving for known executable types
2019-01-30 19:24:16 +02:00
Kubernetes Prow Robot
9d58c8fbcf
Merge pull request #71117 from dixudx/read_kubeconfig_once
loads kubeconfig only once
2019-01-19 02:25:26 -08:00
Kenjiro Nakayama
f7aca76bac Fix wrong completion for kubectl attach
Although `kubectl attach POD_NAME <tab>` completes container name,
kubectl attach needs `-c` option so the command causes error as:

```
$ kubectl attach nginx-7cdbd8cdc9-b5rhr nginx
error: the server doesn't have a resource type "nginx-7cdbd8cdc9-b5rhr"
```

This patch changes the completion to the same way as `kubectl exec`.
2018-12-31 13:34:56 +09:00
Di Xu
4b524ef995 kubectl loads config file once and uses persistent client config 2018-12-07 15:41:40 +08:00
k8s-ci-robot
1cdc918e11
Merge pull request #70728 from Pingan2017/remove-kubectl-run-container
Remove deprecated kubectl command aliases 'run-container'
2018-11-16 01:53:11 -08:00
Pingan2017
07696b6014 Remove deprecated kubectl command aliases kubectl run-container 2018-11-07 14:22:20 +08:00
Yang Li
3d0c961d57 Fix some golint errors for packages in pkg/kubectl
- Fix some golint errors for `pkg/kubectl`
- Fix a golint error for `pkg/kubectl/apps`
- Fix all golint errors for `pkg/kubectl/cmd`
- Fix some golint errors for `pkg/kubectl/generate/versioned`
- Fix a golint error for `pkg/kubectl/generate`
- Fix some golint errors for `pkg/kubectl/metricsutil`
- Fix all golint errors for `pkg/kubectl/util`
- Fix all golint errors for `pkg/kubectl/util/slice`
2018-11-02 11:55:40 +08:00
Maciej Szulik
21789b85a6
Move pkg/kubectl/cmd/templates -> pkg/kubectl/util/temlpates 2018-10-11 22:01:03 +02:00
Maciej Szulik
55d5df8a36
React to moves 2018-10-06 18:44:05 +02:00
Antoine Pelisse
e1eadc5031 Move diff command to root rather than alpha
New command is now `kubectl diff` rather than `kubectl alpha diff` since
it's moving out of alpha soon, and will be using dry-run apply to
produce the diff rather than the custom merge logic.
2018-09-27 13:11:43 -07:00
Damien Lespiau
5d634e7db6 Add go profile instrumentation to kubectl
This commit adds two new global options to kubectl: --profile and
--profile-output, writing out go profiles to disk to debug interesting and
unexpected kubectl behaviour.

As an example, here is how to capture a block file, eg. for how long are we
blocked on I/O and where?

$ kubectl get nodes --profile=mutex -v6
$ go tool pprof -png ./profile.pprof > out.png
$ google-chrome out.png

Fixes: #68679
2018-09-18 18:28:43 +01:00
Maciej Szulik
5b55e1f8ed
Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
juanvallejo
4bdc636380
add updated plugin mechanism 2018-08-15 15:06:29 -04:00
Kubernetes Submit Queue
f9c8898116
Merge pull request #64034 from deads2k/cli-62-wait
Automatic merge from submit-queue (batch tested with PRs 64034, 64072, 64146, 64059, 64161). 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>.

add kubectl wait

Adds a `kubectl wait --for=[delete|condition=condition-name] resource/string` command.  This allows generic waiting on well behaved conditions and for a resource or set of resources to be deleted.

This was requested for delete to do foreground deletion

WIP because I need to add test cases.


@kubernetes/sig-cli-maintainers this is using a separation of concerns made possible by the genericclioptions to make an easily unit testable command.
@smarterclayton 

```release-note
adds a kubectl wait command
```
2018-05-22 19:20:12 -07:00
Kubernetes Submit Queue
cecbbad128
Merge pull request #63914 from superbrothers/completion-init-containers
Automatic merge from submit-queue (batch tested with PRs 63914, 63887, 64116, 64026, 62933). 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>.

Add initContainers into completion suggestions for kubectl logs/attach

**What this PR does / why we need it**: This PR improves autocomplete of kubectl logs/attach to add initContainers into completion suggestions in addition to containers.

```
$ cat <<EOL | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
spec:
  initContainers:
  - name: init-myservice
    image: busybox
    command: ['sh', '-c', 'until nslookup myservice; do echo waiting for myservice; sleep 2; done;']
  - name: init-mydb
    image: busybox
    command: ['sh', '-c', 'until nslookup mydb; do echo waiting for mydb; sleep 2; done;']
  containers:
  - name: myapp-container
    image: busybox
    command: ['sh', '-c', 'echo The app is running! && sleep 3600']
EOL
$ kubectl logs myapp-pod <tab><tab>
init-mydb        init-myservice   myapp-container
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 17:36:09 -07:00
David Eads
76794643c5 add wait 2018-05-22 08:47:42 -04:00
juanvallejo
876629f690 move ConfigFlags to pkg/kubectl/genericclioptions 2018-05-16 11:31:48 -04:00
Kazuki Suda
ca26a8b375 Add initContainers into completion suggestions for kubectl logs/attach 2018-05-16 18:27:14 +09:00
David Eads
080d6a4b0d wrap restclientgetter with match version option 2018-05-10 09:43:22 -04:00
Kubernetes Submit Queue
e70c4331a9
Merge pull request #60371 from superbrothers/__kubectl_cp-1
Automatic merge from submit-queue (batch tested with PRs 63526, 60371, 63444). 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 completion for kubectl cp

**What this PR does / why we need it**: With this PR, kubectl cp supports completion. I tested this PR in bash and zsh.

```
$ kubectl cp kube-system/<tab>
kube-system/kube-state-metrics-769566fdfb-4v52s:   kube-system/kubernetes-dashboard-6b6ddbd46-t5bv9:  kube-system/prometheus-694594c45b-qk5lq:
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubectl#5

**Special notes for your reviewer**: @cblecker

**Release note**:

```release-note
`kubectl cp` supports completion.
```
2018-05-08 15:24:08 -07:00
David Eads
facd04be43 use IOStreams for cli commands 2018-05-08 09:02:34 -04:00
juanvallejo
5a34e4f594 remove printer helpers 2018-05-07 15:37:55 -04:00
juanvallejo
3ca222b2d9 wire config flags through factory 2018-05-04 17:02:20 -04:00
Jordan Liggitt
0dd652cffd
Fix bash completion with --all-namespaces 2018-05-04 09:57:57 -04:00
Jordan Liggitt
4dfd26a4f2
Switch kubectl resource completion to discovery 2018-05-04 09:57:36 -04:00
Maciej Szulik
b7d4f15965
Remove Factory from more Run commands 2018-04-30 19:58:54 +02:00
juanvallejo
f432ebe262
finish wiring PrintFlags 2018-04-27 21:41:03 +02:00
juanvallejo
6d3652eded remove hardcoded list of resources 2018-04-26 09:31:58 -04:00
Kubernetes Submit Queue
acbccfba84
Merge pull request #62820 from juanvallejo/jvallejo/wire-more-print-flags
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>.

wire printflags through additional cmds

**Release note**:
```release-note
NONE
```

Adds PrintFlag pattern to more commands.

cc @deads2k @soltysh
2018-04-26 02:20:34 -07:00
juanvallejo
27bd4ded04 wire printflags through additional cmds 2018-04-25 16:07:32 -04:00
juanvallejo
191a48f4c3 wire PrintFlags through get cmd 2018-04-25 15:02:48 -04:00