Commit Graph

3785 Commits (fd633d192f6c09c46368f4300af152216b1089fc)

Author SHA1 Message Date
Jordan Liggitt c12d8a56f8 Find current resourceVersion for waiting for deletion/conditions 2019-01-11 15:24:05 -05:00
Vikranth Thati f72072cd60 Allow setting images for initContainers through kubectl set command. 2019-01-10 22:28:26 +05:30
Kubernetes Prow Robot 1edd44bbe3
Merge pull request #72448 from nak3/attach-completion
Fix wrong completion for kubectl attach
2019-01-07 17:56:14 -08:00
Kubernetes Prow Robot 1831babae8
Merge pull request #72352 from liggitt/prune-apps-v1
Prune apps/v1 resources
2019-01-04 14:09:41 -08:00
Jordan Liggitt 2b1a2d361f Use tabwriter with remembered column widths 2019-01-01 22:27:36 -05: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
Jordan Liggitt 9186a81489 Prune apps/v1 resources 2018-12-27 00:44:09 -05:00
Pingan2017 672cad60e9 code cleanup for kubectl config 2018-12-25 15:24:57 +08:00
Kubernetes Prow Robot e2f2ca2b29
Merge pull request #70599 from caesarxuchao/kubectl-wait-all
Enable --all flag for kubectl wait
2018-12-21 20:19:21 -08:00
Kubernetes Prow Robot 6da32b078f
Merge pull request #72006 from soltysh/allnamespaces_shorthand
Introduce -A as a shorthand for --all-namespaces in kubectl
2018-12-19 14:13:40 -08:00
Jordan Liggitt 0ff455e340 generated files 2018-12-19 11:19:12 -05:00
Jordan Liggitt fd9e9b01b1 Remove uses of extensions/v1beta1 clients 2018-12-19 11:18:53 -05:00
Maciej Szulik 885bed15da Introduce -A as a shorthand for --all-namespaces in kubectl 2018-12-19 14:37:43 +01:00
Kubernetes Prow Robot 483dfc4902
Merge pull request #71934 from annehwatson/typo
Fix typo
2018-12-12 16:02:37 -08:00
Antoine Pelisse 95eec905c7 diff: Make filename cross-platform compatible 2018-12-11 15:36:26 -08:00
Antoine Pelisse b6135f63aa diff: Fix overlapping filenames
The filename can overlap when multiple resources have the same name (but
obviously are of a different type). Include the name of the type in the
file name to prevent the overlap.
2018-12-11 09:19:52 -08:00
annehwatson 0a8a07f666 Fix typo 2018-12-10 20:16:17 -08:00
Antoine Pelisse f9ca4aafc6 apply: fix detection of non-dry-run enabled servers
Apply only checks that the server supports dry-run in the create path,
not the update path, which is pretty bad.
2018-12-07 10:54:03 -08:00
Kubernetes Prow Robot 1a82272782
Merge pull request #71684 from danielqsj/typo-fix
Fix typos like limitting
2018-12-07 07:58:09 -08:00
Di Xu 4b524ef995 kubectl loads config file once and uses persistent client config 2018-12-07 15:41:40 +08:00
Jordan Liggitt 4611bb448e Fix sort-by regression 2018-12-06 12:32:30 -05:00
Kubernetes Prow Robot b1aed1593e
Merge pull request #70682 from idealhack/fix-golint-pkg-kubectl-cmd
Fix some golint errors for packages in `pkg/kubectl/cmd`
2018-12-04 00:49:09 -08:00
danielqsj 3c055aa4b4 Fix typos like limitting 2018-12-04 11:01:40 +08:00
k8s-ci-robot 64b96d426a
Merge pull request #69885 from clickyotomy/master
Fix local copy path for `kubectl cp'.
2018-11-28 23:31:21 -08:00
Jordan Liggitt 2fd10764c8 Clarify reconcile command documentation 2018-11-27 23:27:15 -05:00
k8s-ci-robot 1e50c57113
Merge pull request #70740 from mfpierre/fix-kubectl-get-sort-out-of-range
Fix index out of range error when sorting kubectl get
2018-11-24 12:19:06 -08:00
Yang Li 141d33a2a5 Fix some golint errors for packages in `pkg/kubectl/cmd`
Co-authored-by: Arijit Basu <sayanarijit@gmail.com>
2018-11-22 22:09:08 +08:00
k8s-ci-robot 28182b6606
Merge pull request #71156 from apelisse/race-condition-diff
Optimistic-locking on diff
2018-11-21 03:35:04 -08:00
Antoine Pelisse a889f37505 Optimistic-locking on diff
There is currently a race-condition when diffing, where we get the
object and then run a server-side dry-run patch and compare the two
results. If something changes the object on the server between the get
and the patch, the diff is going to show unrelated changes. We can now
specify the exact revisionversion that we want to patch, and that will
return a conflict, and we can retry multiple times to get a
non-conflicting diff. Eventually (after 3 times), we diff without
checking the version and throw a warning that the diff might be
partially wrong.
2018-11-20 14:34:37 -08:00
Antoine Pelisse 89daa462ff Allow kubectl patcher to patch specific version
Give a new "ResourceVersion" option to the patch so that the patch can
be forced against a specific version. Also there is no way to customize
how many retries the patcher should do on conflicts, so also add a
"Retries" option that let's one customize it.
2018-11-20 14:34:08 -08:00
k8s-ci-robot e26b730143
Merge pull request #71103 from Pingan2017/autoscale-sts-kubectl
support statefulset in kubectl autoscale command
2018-11-16 12:03:51 -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 c3bb1c4601 support statefulset in kubectl autoscale command 2018-11-16 10:42:39 +08:00
k8s-ci-robot e615df9d23
Merge pull request #70950 from yue9944882/chore/prune-cli-describer-internal
Use versioned types in kubectl describer
2018-11-15 15:00:12 -08:00
k8s-ci-robot 7cf211d7de
Merge pull request #69196 from CaoShuFeng/job.yaml
fix kubectl wait with no resource name provided
2018-11-15 14:59:42 -08:00
zuoxiu.jm da9387131e prune internal clients from kubectl describer 2018-11-16 00:11:10 +08:00
k8s-ci-robot 012a438dbe
Merge pull request #68655 from goodluckbot/kubectl-cordon-drain-uncordon
Support multiple arguments for cordon and drain
2018-11-14 20:34:48 -08:00
k8s-ci-robot 4c4a76557d
Merge pull request #70956 from apelisse/add-diff-test
Add test for CRD server-dry-run and fix bug
2018-11-13 19:45:53 -08:00
k8s-ci-robot 54243e1921
Merge pull request #69344 from zegl/improve-kubectl-apply-prune-output
Fix dry-run output in kubectl apply --prune
2018-11-13 19:45:34 -08:00
k8s-ci-robot d00cb23c8d
Merge pull request #71006 from liggitt/kubectl-run-apps-v1
update kubectl run to generate apps/v1 deployments
2018-11-13 16:14:23 -08:00
k8s-ci-robot 709e6ac3e2
Merge pull request #70413 from Pingan2017/kubectl-config-view
validate args for kubectl config view
2018-11-13 16:13:45 -08:00
k8s-ci-robot 68b4be3e19
Merge pull request #70775 from freehan/pod-ready-cli
add readiness gates in kubectl extended output for pods
2018-11-13 14:59:18 -08:00
Jordan Liggitt 03f26e4612 update kubectl run to generate apps/v1 deployments 2018-11-13 14:39:25 -05:00
Sean Sullivan e0b712d428 kubectl: move custom columns printers and flags 2018-11-12 14:31:59 -08:00
k8s-ci-robot 3bcbc5da79
Merge pull request #70887 from seans3/kubectl-get-fix
kubectl get: remove internal resource dependency
2018-11-12 13:20:08 -08:00
Antoine Pelisse d3d4d268ac Add test for CRD server-dry-run and fix bug
Add a new test to make sure we can server-dry-run CRDs and also fix a
typo now that we have a test, we could notice that it doesn't work.
2018-11-12 11:06:27 -08:00
goodluckbot df31468ce7 Support multiple arguments for cordon and drain 2018-11-12 00:28:36 +08:00
Gustav Westling 37c253aba1 Fix the TestRunApplyPrintsValidObjectList test
The fake webclient should return one ConfigMap per request, not the whole ConfigMapList

Also added additional tests to the output
2018-11-11 15:19:29 +01:00
Gustav Westling 74e63c8f00 Fix dry-run output in kubectl apply --prune
Makes dry-run output match what would happen when running in non dry-run mode.

Objects would only get added to visitedUids if running in non dry-run mode.

visitedUids is used by prune() to know if an action should be taked on the item or not.

Fixes #67863
2018-11-11 15:06:38 +01:00
Davanum Srinivas 954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
k8s-ci-robot 7872a1db2f
Merge pull request #70856 from lojies/cleanuptaint
code cleanup for kubectl taint
2018-11-10 00:14:22 -08:00
k8s-ci-robot 2dcdad297e
Merge pull request #70883 from seans3/printing-test-remove
kubectl: remove redundant test
2018-11-09 16:23:13 -08:00
Sean Sullivan c814f61510 kubectl get: remove internal resource dependency 2018-11-09 11:33:11 -08:00
Sean Sullivan 6b0f66d864 kubectl: remove redundant test 2018-11-09 11:12:20 -08:00
lojies e3d69d8c33 code cleanup for kubectl taint 2018-11-09 16:22:00 +08:00
Sean Sullivan 62ec499d6f kubectl convert: add deprecation warning for 1.13 2018-11-08 11:50:49 -08:00
Pierre bb9ea69195 Add unit test case for empty list 2018-11-08 18:35:52 +01:00
Minhan Xia c987e95282 add readiness gates column in the wide printout for pod 2018-11-07 16:45:49 -08:00
Davanum Srinivas 43f523d405
Switch to sigs.k8s.io/yaml from ghodss/yaml
Change-Id: Ic72b5131bf441d159012d67a6a3d87088d0e6d31
2018-11-07 13:17:32 -05:00
k8s-ci-robot 1f56cd801e
Merge pull request #70713 from deads2k/kubectl-15-wait
kubectl version should print just client information in the absence of kubeconfig
2018-11-07 09:06:18 -08:00
Pierre 3b6d8e8373 Fix index out of range error when sorting kubectl get 2018-11-07 11:52:39 +01:00
Pingan2017 07696b6014 Remove deprecated kubectl command aliases kubectl run-container 2018-11-07 14:22:20 +08:00
David Eads 4efb020860 kubectl version should print just client information in the absence of kubeconfig 2018-11-06 16:25:39 -05:00
Jordan Liggitt 9ae79f9653 authorizers subproject approvers/reviewers 2018-11-06 00:57:38 -05:00
k8s-ci-robot 5656ac754d
Merge pull request #70577 from WanLinghao/kubectl_logs_fix
fix a bug that --tail option does not take effects in 'kubectl logs --selector xx=xx --tail 3'
2018-11-05 16:32:53 -08:00
k8s-ci-robot 8fe6eb3076
Merge pull request #70420 from idealhack/fix-golint-pkg-kubectl
Fix some golint errors for packages in `pkg/kubectl`
2018-11-05 06:53:55 -08:00
Chao Xu 3873d828bc enable --all flag for kubectl wait 2018-11-02 14:10:37 -07:00
Sean Sullivan 68cea87cfd kubectl: remove unnecessary internal->external conversion before PrintObj 2018-11-02 10:03:52 -07:00
WanLinghao ea7065d471 fix a bug that --tail option does not take effects in 'kubectl logs --selector xx=xx --tail 3' 2018-11-02 18:20:58 +08:00
Pingan2017 f824b58ba2 validate args for kubectl config view 2018-11-02 16:17:43 +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
k8s-ci-robot bce51cc574
Merge pull request #70412 from Pingan2017/kubectl-top
code cleanup for kubectl top
2018-11-01 15:17:55 -07:00
qingsenLi 3ac9b27b2a remove repetitive word in annotation 2018-11-02 00:54:41 +08:00
Sean Sullivan 1e161bb329 kubectl: change legacyscheme codecs to direct codecs (no conversion) 2018-10-31 15:24:22 -07:00
juanvallejo 901c798681
prevent sorting of PATH dirs
This patch allows the `kubectl plugin list` command to display discovered
plugin paths in the same order as they appear in a user's PATH.
Prior to this patch, discovered plugin paths were sorted before being
displayed.

Additionally, any errors encountered while reading from any directory in a
user's PATH will now be printed to stderr at the end of the command's
output.
2018-10-30 14:13:13 -04:00
Pingan2017 eea9994112 code cleanup for kubectl top 2018-10-30 15:01:24 +08:00
k8s-ci-robot 117c6177c4
Merge pull request #70278 from jhvhs/master
Documentation re-formatting
2018-10-26 13:32:00 -07:00
Maciej Szulik fdcd6de9c0
Update deprecation warning for kubectl run 2018-10-26 16:22:33 +02:00
Konstantin Semenov 84ba7e8f69
Documentation re-formatting
The closing bracket in the link was automatically included in the link HREF.
Myself and @lurraca used standard markdown formatting to prevent that from happening.
2018-10-26 11:32:36 +01:00
k8s-ci-robot b6fd5d93b2
Merge pull request #69389 from smarterclayton/wait_error
kubectl wait must handle errors returned by watch
2018-10-25 09:40:41 -07:00
k8s-ci-robot 1af393d58e
Merge pull request #69866 from xichengliudui/fix181016
Remove duplicate words
2018-10-22 15:35:36 -07:00
k8s-ci-robot d8f9b5b668
Merge pull request #69958 from Pingan2017/cleanup-kubectl-delete
remove unneed if block for kubectl delete command
2018-10-18 19:50:53 -07:00
k8s-ci-robot 85e460e362
Merge pull request #69809 from sc14aec/create-context-error-messages
Fix error messages suggesting invalid flag
2018-10-18 19:50:43 -07:00
k8s-ci-robot 007ad9179c
Merge pull request #69760 from Pingan2017/validate-args
validate args for kubectl api-versions/api-resources command
2018-10-18 14:44:00 -07:00
k8s-ci-robot 00dd32b167
Merge pull request #69573 from bjhaid/master
Opt out of chowning and chmoding from kubectl cp.
2018-10-18 14:43:49 -07:00
bjhaid 44bed94f0e Opt out of chowning and chmoding from kubectl cp.
`kubectl cp` relies on tar to extract the copied file/directory in the
container, tar by default attempts to chown/chmod the extracted file
after extraction if the user is the "superuser"(root)

```
--same-owner
try extracting files with the same ownership as exists in the archive
(default for superuser)
-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)
```

This fails in environment where the container runs as root but is not
granted the OWNER or CHOWN capability.

Before this patch below was the behavior of `kubectl cp`

```
kubectl cp README.md foo-67b6fcbd4c-qjlt6:/tmp
tar: README.md: Cannot change ownership to uid 1000, gid 1000: Operation
not permitted
tar: Exiting with failure status due to previous errors
command terminated with exit code 2
kubectl exec -it foo-67b6fcbd4c-qjlt6 -- ls -l /tmp/README.md
-rw------- 1 1000 1000 3179 Oct  7 22:00 /tmp/README.md
```

After this patch

```
kubectl cp -x a foo-67b6fcbd4c-qjlt6:/
kubectl exec -it foo-67b6fcbd4c-qjlt6 -- ls -l /tmp/README.md
-rw-r--r-- 1 root root 3179 Oct  7 22:00 /tmp/README.md
```
2018-10-18 14:16:06 +00:00
Pingan2017 797f0ac660 remove unneed if block for kubectl delete command 2018-10-18 11:33:45 +08:00
k8s-ci-robot 0d6f6a680b
Merge pull request #68441 from smarterclayton/describe_dependency
Move versioned generators into their own package
2018-10-17 04:24:06 -07:00
Clayton Coleman 5a8afa073f
Dynamic client watchers should be able to handle ERROR gracefully
Watch can return type "ERROR" and a metav1.Status object. We need to
handle that during wait, and make it easy to handle the status object.
2018-10-16 12:55:23 -04:00
Clayton Coleman c21774e9de
Remove defaulting from test that uses kubectl.Scheme
The dependency on printers/internalversion was causing kubectl/scheme
to have defaulters registered, which should not be the case. Remove
defaults from the test.
2018-10-16 12:54:41 -04:00
Clayton Coleman 5e905f1f5f
Move versioned generators into their own package
pkg/kubectl has a lot of files. Move everything generator related
into pkg/kubectl/generate (generic) or pkg/kubectl/generate/versioned
(type specific).

Move the DescriberFn and GeneratorFn out of kubectl/cmd/util and into
the respective versioned packages, along with tests.
2018-10-16 12:54:40 -04:00
Srinidhi Kaushik 00720ba51d
Fix `gofmt' errors. 2018-10-16 21:31:59 +05:30
Clayton Coleman c291d3d7ed
Consistently print errors to stderr and add newlines to cordon 2018-10-16 11:16:15 -04:00
Srinidhi Kaushik d17ce325a6
Fix local copy path for `kubectl cp'.
Adds an extra check condition for "." in stripPathShortcuts
so that an empty string is returned, and the correct prefix
index is used untarAll when generating path names.

Resolves: #69804.
2018-10-16 20:11:54 +05:30
Pingan2017 2b2d8ba8c1 validte args for kubectl api-versions/api-resources 2018-10-16 19:22:17 +08:00
xichengliudui e394482373 Remove duplicate words 2018-10-15 15:55:49 -04:00
Sean Sullivan 6a2ef97d46 kubectl: update to use correct printers package 2018-10-15 11:02:19 -07:00
Andy Crow 4400996c48 Fix error messages suggesting invalid flag 2018-10-15 16:39:53 +01:00
k8s-ci-robot 2129bc9f85
Merge pull request #69742 from apelisse/fix-diff-error
Rename KUBERNETES_EXTERNAL_DIFF to KUBECTL_EXTERNAL_DIFF
2018-10-13 09:54:52 -07:00
k8s-ci-robot a5b489a3a3
Merge pull request #69751 from seans3/tabwriter-fix
kubectl: copy printer tabwriter into kubectl
2018-10-13 03:56:17 -07:00