Commit Graph

341 Commits

Author SHA1 Message Date
Brian Pursley
84d5e664af Changed kubectl config set-cluster and set-credentials to support process substitution for filenames 2020-05-15 09:22:59 -04:00
zhouya0
bbf41448f6 Fix kubectl create secret docker-registry 2020-05-15 12:14:03 +08:00
Julian V. Modesto
360c348d0e Set kubectl field manager names 2020-05-09 13:24:39 -04:00
Kubernetes Prow Robot
775feed217
Merge pull request #90018 from wojtek-t/deprecate_default_conversions
Deprecate default conversions
2020-04-23 10:23:10 -07:00
Maciej Szulik
a871738c86
Revert "stop defaulting kubeconfig to http://localhost:8080"
This reverts commit b19ad9e7a7.
2020-04-17 16:37:15 +02:00
Kubernetes Prow Robot
b0806d0c02
Merge pull request #90165 from ScrapCodes/fix_flake_run_apply
Fixed flaky test by changing get_object_assert -> wait_object_assert.
2020-04-16 08:38:59 -07:00
Prashant Sharma
5a765b1e15 Changed get_object_assert -> wait_object_assert, to fix the flaky test. 2020-04-16 10:01:18 +05:30
Kubernetes Prow Robot
4bba193bea
Merge pull request #89666 from julianvmodesto/kubectl-scale-dry-run
Support kubectl scale --dry-run=server|client
2020-04-11 10:45:47 -07:00
wojtekt
f624314f91 Fix multiple conversion tests 2020-04-10 17:03:35 +02:00
Kubernetes Prow Robot
897c10e7b2
Merge pull request #89551 from zlabjp/restore-kubectl-prune-multiple-namespaces
Restore the ability to `kubectl apply --prune` without -n flag
2020-04-09 07:49:43 -07:00
Tatsuhiro Tsujikawa
7af3b01f24 Restore the ability to kubectl apply --prune without -n flag
Before https://github.com/kubernetes/kubernetes/pull/83084, `kubectl
apply --prune` can prune resources in all namespaces specified in
config files.  After that PR got merged, only a single namespace is
considered for pruning.  It is OK if namespace is explicitly specified
by --namespace option, but what the PR does is use the default
namespace (or from kubeconfig) if not overridden by command line flag.
That breaks the existing usage of `kubectl apply --prune` without
--namespace option.  If --namespace is not used, there is no error,
and no one notices this issue unless they actually check that pruning
happens.  This issue also prevents resources in multiple namespaces in
config file from being pruned.

kubectl 1.16 does not have this bug.  Let's see the difference between
kubectl 1.16 and kubectl 1.17.  Suppose the following config file:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: foo
  namespace: a
  labels:
    pl: foo
data:
  foo: bar
---
apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: bar
  namespace: a
  labels:
    pl: foo
data:
  foo: bar
```

Apply it with `kubectl apply -f file`.  Then comment out ConfigMap foo
in this file.  kubectl 1.16 prunes ConfigMap foo with the following
command:

$ kubectl-1.16 apply -f file -l pl=foo --prune
configmap/bar configured
configmap/foo pruned

But kubectl 1.17 does not prune ConfigMap foo with the same command:

$ kubectl-1.17 apply -f file -l pl=foo --prune
configmap/bar configured

With this patch, kubectl once again can prune the resource as before.
2020-04-09 02:54:10 +00:00
Lubomir I. Ivanov
9bbd321fec remove /cluster/kubeadm.sh and /test/cmd/kubeadm.sh
/cluster/kubeadm.sh is used to find the kubeadm binary.
This file is legacy and is removed.

Remove /test/cmd/kubeadm.sh. This file contains a function that is used
to build kubeadm and invoke "make test". Move the function contents
to hack/make-rules/test-cmd.cmd.

Stop sourcing /test/cmd/kubeadm.sh in /test/cmd/legacy-script.sh.

Also remove the --kubeadm-path invocation as this can be handled
with an env. variable directly.
2020-04-09 00:47:15 +03:00
Kubernetes Prow Robot
38f0a8bc74
Merge pull request #89652 from liggitt/relist-timeout
Fix client watch reestablishment handling of client-side timeouts
2020-04-07 01:15:44 -07:00
Sean R. Sullivan
748ad74245 Even with build error, kubectl apply should apply all valid resources 2020-04-04 15:48:31 -07:00
Prashant Sharma
3ff54eb10c
Fixes a flaky test, by adding kubectl wait for delete deployment in apply.sh (#89725)
* Add kubectl wait for delete deployment.

* Even better to wait for all pods deleted.

* get_object_assert -> wait_object_assert
2020-04-04 00:07:47 -07:00
Julian V. Modesto
9c0320f1bf Ensure diff doesn't persist patches 2020-04-02 19:23:32 -04:00
Julian V. Modesto
efed958779 Support kubectl scale --dry-run=server|client 2020-03-31 16:19:52 -04:00
Sean R. Sullivan
4ca2d5a9da Fixes kubectl apply tests to run; updates broken tests 2020-03-30 17:04:10 -07:00
Jordan Liggitt
343c1e7636 Fix client watch reestablishment handling of client-side timeouts 2020-03-30 17:48:00 -04:00
Sean R. Sullivan
1083c0fe05 Adds integration test for apply failures when applying multiple resources 2020-03-26 22:33:04 -07:00
Julian V. Modesto
bacc2c4960 Set field manager for kubectl diff --server-side.
Bonus: check diff only dry-runs without persisting.

Co-authored-by: Takahiro HATORI <tahatori@zlab.co.jp>
2020-03-04 20:20:07 -05:00
Kubernetes Prow Robot
b5b675491b
Merge pull request #86173 from soltysh/cli_defaults
stop defaulting kubeconfig to http://localhost:8080
2020-03-04 07:23:47 -08:00
Maciej Szulik
9dac1699bf
Wire --filename flag to exec 2020-03-03 12:16:52 +01:00
David Eads
b19ad9e7a7
stop defaulting kubeconfig to http://localhost:8080 2020-03-02 18:32:16 +01:00
Kubernetes Prow Robot
641616362d
Merge pull request #88133 from julianvmodesto/dry-run-tests
Cleanup --dry-run values in tests, docs, and scripts
2020-02-27 11:33:42 -08:00
Kubernetes Prow Robot
1591590030
Merge pull request #88292 from julianvmodesto/add-dry-run
Add --dry-run=server|client|none to more kubectl commands
2020-02-20 16:30:25 -08:00
Haowei Cai
aecce98a54 wait for pruned CR to be invisible from API 2020-02-19 17:41:13 -08:00
Julian V. Modesto
a9ec444d74 Add --dry-run to more kubectl commands.
- delete
- taint
- replace
2020-02-19 17:53:21 -05:00
Julian V. Modesto
d97169f59a Clean up --dry-run values.
- Clean up --dry-run values in tests, docs, and scripts
- Fix --dry-run for auth reconcile and add a test
2020-02-15 00:43:30 -05:00
Benjamin Elder
3fb7183215 bump pause to 3.2 in test/ 2020-02-14 14:03:19 -08:00
Julian V. Modesto
13b80b48cd Use --dry-run=client,server in kubectl.
- Support --dry-run=server for subcommands apply, run, create, annotate,
expose, patch, label, autoscale, apply set-last-applied, drain, rollout undo
- Support --dry-run=server for set subcommands
  - image
  - resources
  - serviceaccount
  - selector
  - env
  - subject
- Support --dry-run=server for create subcommands.
  - clusterrole
  - clusterrolebinding
  - configmap
  - cronjob
  - job
  - deployment
  - namespace
  - poddisruptionbudget
  - priorityclass
  - quota
  - role
  - rolebinding
  - service
  - secret
  - serviceaccount
- Remove GetClientSideDryRun
2020-02-12 20:46:54 -05:00
Kubernetes Prow Robot
19ca6d30d2
Merge pull request #87437 from apelisse/kubectl-diff-exit-code
kubectl-diff: Return non-1 errors on kubectl failures
2020-02-01 18:33:20 -08:00
Kubernetes Prow Robot
dba8d60f8c
Merge pull request #87077 from soltysh/remove_run_generators
Remove kubectl run generators
2020-01-29 12:16:14 -08:00
Maciej Szulik
6972d6f33a
Fix kubectl taint's Complete parsing 2020-01-27 13:31:22 +01:00
Maciej Szulik
82f97775b7
Remove kubectl run generators 2020-01-22 16:44:00 +01:00
Antoine Pelisse
38c5f318c9 kubectl-diff: Test return code on failure and changes 2020-01-21 15:34:22 -08:00
drfish
010b885236 Remove workaround for RS bug in cmd apps test 2020-01-10 09:39:54 +08:00
Jordan Liggitt
f50638f439 Isolate kubectl test-cmd plugin tests 2019-12-19 01:35:36 -05:00
Daniel Holbach
a252a617a5 drop KUBE_TIMEOUT in test/cmd/kubeadm.sh
As runyontr remarked in test/cmd/kubeadm.sh: when
	https://github.com/kubernetes/kubeadm/issues/1430 is closed,
	KUBE_TIMEOUT can be removed.
2019-11-28 10:49:41 +01:00
Rob Scott
7085d692b7
Reverting managed-by-setup annotation
This ended up causing far more problems than it was worth, especially
given that it just attempted to provide backwards compatibility with
the alpha release.
2019-11-15 11:50:58 -08:00
Kubernetes Prow Robot
141329fd21
Merge pull request #85285 from liggitt/kubectl-resource-version
Fix --resource-version handling in kubectl
2019-11-14 16:39:03 -08:00
Jordan Liggitt
0ac8345d3a Fix --resource-version handling in kubectl 2019-11-14 12:33:14 -05:00
Rob Scott
a7e589a8c6
Promoting EndpointSlices to beta 2019-11-13 14:20:19 -08:00
Jordan Liggitt
4c3bf1a660 Fix record_command suppression of test errors 2019-11-07 02:26:45 -05:00
Jordan Liggitt
cb17a2b6a6 Fix run_pod_tests 2019-11-07 02:26:45 -05:00
Jordan Liggitt
59dfac587f Fix assert methods 2019-11-07 02:26:45 -05:00
Odin Ugedal
4e44407fa9
Fix failing service test 2019-10-23 23:23:22 +02:00
Odin Ugedal
6a73c0899a
Fix shellcheck failures SC2251
https://github.com/koalaman/shellcheck/wiki/SC2251

This may be masking some test failures.

We have a bunch of test code like this:

set -o errexit
[...]
! kubectl get pod wrong-pod
[...]

This test will succeed no matter what the result (return code) of kubectl is.
2019-10-23 22:47:47 +02:00
Kubernetes Prow Robot
48b90db9c3
Merge pull request #83495 from tanjunchen/fix-typo
remove the repeat word in documents
2019-10-06 15:05:08 -07:00
tanjunchen
de3cf23414 remove the repeat word in documents 2019-10-06 23:32:01 +08:00
Kubernetes Prow Robot
791bfac90f
Merge pull request #83084 from yutedz/ns-prune
Prune should respect namespace option
2019-10-04 02:46:12 -07:00
Guangming Wang
c0a4c09040 fix wrong test in generic-resources.sh
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-10-01 20:45:17 +08:00
Ted Yu
88e2f8e04f Prune should respect namespace 2019-09-25 16:43:08 -07:00
ZP-AlwaysWin
d777b6aa94 replace with 2019-09-15 13:55:48 +08:00
calmkart
d558a89437 MOD:fix spelling errors 2019-09-11 15:59:15 +08:00
Antoine Pelisse
a3f4e6e933 Rename --experimental-* flags to --* for server-side apply 2019-08-28 15:03:41 -07:00
Xiangyang Chu
23ce08a7d0 Fix review comments, will squash later. 2019-07-25 14:42:23 +08:00
Xiangyang Chu
4ef227c682 Fix of review comments. Will squash later.
Including:
- Remove external usage of resource name vars
- Add commments about why we export field helpers
2019-07-18 09:12:28 +08:00
Xiangyang Chu
313044abd7 Fix shellcheck failures in test/cmd/l.*.sh 2019-07-17 17:07:22 +08:00
Xiangyang Chu
3a344c7168 Fix shellcheck failures in test/cmd/d.*.sh 2019-07-17 17:07:22 +08:00
Kubernetes Prow Robot
1c99825adf
Merge pull request #79566 from sukeesh/auditlog
Cleanup: Audit log and error capitalization
2019-07-11 14:33:59 -07:00
Kubernetes Prow Robot
b130ff4502
Merge pull request #79724 from deads2k/update-raw
make kubectl --raw consistent for create, update, get, delete
2019-07-09 08:26:17 -07:00
David Eads
09c55bd117 make kubectl --raw consistent for create, update, get, delete 2019-07-09 09:03:56 -04: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
Sukeesh
346fdbccf0 Cleanup: Audit log and error capitalization 2019-07-08 20:20:12 +09:00
Jordan Liggitt
cf3e75de70 Remove internal object printing from kubectl 2019-06-28 10:54:50 -07:00
Sean Sullivan
e851af0aab Removes test-cmd inappropriate dependency on kubectl 2019-06-27 10:49:42 -07:00
Jordan Liggitt
6ca80760fd Switch test manifests to apps/v1, remove beta workloads calls 2019-06-22 13:58:07 -07:00
Kubernetes Prow Robot
0f2b01ab33
Merge pull request #78022 from xychu/fix-shellchecks-g
Fix shellcheck failures in test/cmd/g.*sh
2019-06-20 20:46:35 -07:00
Kubernetes Prow Robot
ab3b24ac0a
Merge pull request #77798 from xychu/fix-shellchecks-b
Fix shellchecks in test/cmd/{b,c}.*.sh
2019-06-20 10:00:52 -07:00
Xiangyang Chu
38a785b1ee Fix review comments to use ${} 2019-06-20 10:46:41 +08:00
Xiangyang Chu
99b2184993 Fix shellcheck faulures in test/cmd
Including files after test/cmd/n*
2019-06-17 14:04:34 +08:00
Kubernetes Prow Robot
0f5650d68b
Merge pull request #75859 from k-toyoda-pi/fix_shellcheck_failure_make-rules
fix shellcheck failures in /hack/make-rules/test.sh
2019-06-13 20:36:47 -07:00
Kubernetes Prow Robot
8305729d7a
Merge pull request #74635 from xychu/fix-with-assert
Fix shellchecks follow the `${var:?}` pattern
2019-06-13 19:12:45 -07:00
Kubernetes Prow Robot
a04017a468
Merge pull request #78530 from liggitt/deflake-core-integration
Wait for pods to be garbage collected in integration test
2019-06-04 05:03:08 -07:00
Xiangyang Chu
cfc7b0d9c3 Change quoting format 2019-06-04 14:42:01 +08:00
Xiangyang Chu
81eb22900b Fix shellchecks in test/cmd/{b,c}.*.sh 2019-06-04 14:42:01 +08:00
Kubernetes Prow Robot
d817a7e9a0
Merge pull request #78325 from caesarxuchao/storageVersionHash-beta
Graduate storageVersionHash field in the discovery doc to beta
2019-05-31 23:22:33 -07:00
Jordan Liggitt
d93ef9396b Wait for pods to be garbage collected 2019-05-30 11:46:09 -04:00
Kubernetes Prow Robot
38afd9815e
Merge pull request #78445 from soltysh/remove_job_scale
Remove kubectl scale job
2019-05-30 02:24:33 -07:00
Chao Xu
2f4c273398 Graduate storageVersionHash field in the discovery doc to beta 2019-05-29 17:38:28 -07:00
Kubernetes Prow Robot
afba9c0355
Merge pull request #77877 from liggitt/deflake-integration
Wait for integration precondition
2019-05-28 22:21:12 -07:00
Maciej Szulik
85d8b0ce3f
Remove kubectl scale job 2019-05-28 15:24:38 +02:00
Xiangyang Chu
eee32a6a88 Fix shellcheck failures in test/cmd/g.*sh 2019-05-17 15:40:14 +08:00
Kohei Toyoda
62d5eb524b
Merge branch 'master' into fix_shellcheck_failure_make-rules 2019-05-17 08:43:08 +09:00
Kubernetes Prow Robot
6dfc996156
Merge pull request #77423 from apelisse/rollout-restart-other-workloads
Implement rollout restart for statefulset and daemonset
2019-05-16 16:27:06 -07:00
Antoine Pelisse
145935d815 Implement rollout restart for statefulset and daemonset 2019-05-16 08:50:42 -07:00
Jordan Liggitt
e3b4937440 Wait for integration precondition 2019-05-14 14:11:35 -04:00
Kubernetes Prow Robot
07e3b7cdca
Merge pull request #74639 from xychu/fix-shellchecks-a
Make test/cmd/a*.sh pass shellcheck
2019-05-10 10:38:12 -07:00
toyoda
34a120fc42 fix shellcheck failures in /hack/make-rules/test.sh 2019-05-09 17:47:12 +09:00
Jordan Liggitt
e5778f05b9 Fix unstructured list interface compatibility, fix kubectl paging 2019-05-08 02:00:18 -04:00
Jordan Liggitt
37c9e6b444 Expect the correct object type to be removed 2019-05-03 14:10:02 -04:00
Xiangyang Chu
7a385bf2ea Fix wrong pipe in grep -q 2019-04-26 14:23:53 +08:00
Xiangyang Chu
906058bf7b Update grep -q usage to avoid closed pipe 2019-04-26 11:39:11 +08:00
Xiangyang Chu
2260cc29b9 Make test/cmd/a*.sh pass shellcheck 2019-04-26 11:39:11 +08:00
Ahmad Nurus S
0c39d7d380 Kubectl exec support resource/name format 2019-04-25 17:44:01 +07:00
WanLinghao
7fbd71835e 'kubectl auth can-i` command would not hint user when they try to access
some resource out of scope. For example, try get namespace inside defaut namespace.
It would be reject by api-server but `kubectl auth can-i get namespace --namespace=default`
would give a `yes`. After this patch, a warning info would be given.
For more detail, please refer issue #75950
2019-04-10 13:12:45 +08:00
Kubernetes Prow Robot
3409a5362a
Merge pull request #76062 from apelisse/rollout-restart
Create `kubectl rollout restart deployment/$deployment` to do a rolling restart
2019-04-08 14:40:44 -07:00
Antoine Pelisse
1bf99e2e4e Create kubectl rollout restart deployment/$deployment to do a rolling restart 2019-04-06 21:14:40 -07:00
Kubernetes Prow Robot
9c2df998af
Merge pull request #75820 from YoubingLi/bugfix
Fixes #75706 - Show warning message when namespace is specified for deleting a cluster-scoped resource
2019-04-06 11:00:27 -07:00
Sean Sullivan
402d61c189 test-cmd: Fixes erroneous integration test that usually passes accidentally 2019-04-02 20:21:14 -07:00
Youbing Li
c438d7b495 Fixes #75706 - Show warning message when namespace is specified for deleting a cluster-scoped resource 2019-04-02 00:49:40 -04:00
Antoine Pelisse
eb904d8fa8 Add "fieldManager" to flag to PATCH/CREATE/UPDATE
And add a corresponding flag in kubectl (for apply), even though the
value is defaulted in kubectl with "kubectl".

The flag is required for Apply patch-type, and optional for other PATCH,
CREATE and UPDATE (in which case we fallback on the user-agent).
2019-03-08 16:03:03 -08:00
Aaron Crickenberger
3b3c977fc7
Update test/cmd/legacy-script.sh
Co-Authored-By: runyontr <runyontr@gmail.com>
2019-03-02 20:41:42 -05:00
Thomas Runyon
1e44e33517 pulled kubeadm tests out of runTests to run before tests in test/cmd
Added timeout for https://github.com/kubernetes/kubeadm/issues/1430
2019-03-01 12:17:25 -05:00
Kubernetes Prow Robot
81e6407393
Merge pull request #74140 from Liujingfang1/kflag
add -k flag in cli-runtime and kubectl to process kustomization directories
2019-02-26 19:40:16 -08:00
Xiangyang Chu
53c1fcf2c6 Fix shellchecks follow the ${var:?} pattern 2019-02-27 09:27:13 +08:00
Jingfang Liu
127c2f1e74 address comments 2019-02-26 14:12:58 -08:00
Jingfang Liu
beacc87ebf add cmdline tests for -k 2019-02-25 16:31:03 -08:00
Aaron Crickenberger
e563402701 Fix test-cmd kubectl_run flake
It is unrealistic to expect a cascading delete to immediately take
effect. Somehow this test got away with it for a while, but we
have finally reached a point where apiserver performance has changed
just enough to expsoe this flaky expectation.
2019-02-25 13:51:48 -08:00
Kubernetes Prow Robot
0133d14170
Merge pull request #72939 from runyontr/test-cmd-what
Test cmd what
2019-02-23 02:54:36 -08:00
Thomas Runyon
d4df8879f3 call kube:test:clear_all during cleanup 2019-02-22 21:23:53 -05:00
Kubernetes Prow Robot
105c9c35f7
Merge pull request #74358 from Katharine/fix-bad-junit-xml
Turn off command echoing in test to avoid illegal bytes in XML
2019-02-21 12:27:17 -08:00
Katharine Berry
dd4f1c1990 Turn off command echoing to avoid illegal bytes in XML. 2019-02-21 09:30:41 -08:00
Thomas Runyon
f97170ea38 Merge remote-tracking branch 'upstream/master' into test-cmd-what 2019-02-21 11:35:23 -05:00
Thomas Runyon
30c78c7e1c Feedback from review 2019-02-21 06:15:13 -05:00
Benjamin Elder
da859ae734 make test/cmd/delete.sh pass shellcheck 2019-02-21 00:45:37 -08:00
Kubernetes Prow Robot
d60b7d6a64
Merge pull request #73866 from apelisse/add-ssa-tests
Add basic server-side apply test to test-cmd
2019-02-20 11:33:02 -08:00
Kubernetes Prow Robot
b473d5c111
Merge pull request #73201 from YoubingLi/bugfix
Fixes #73077 - Allow to convert type across all version
2019-02-20 02:23:21 -08:00
Youbing Li
0756781994 Fixes #73077 - Allow to convert type across all version 2019-02-15 04:03:35 -05:00
Antoine Pelisse
308c981633 Add basic server-side apply test to test-cmd 2019-02-08 16:51:29 -08:00
Kubernetes Prow Robot
b50c643be0
Merge pull request #73540 from rlenferink/patch-5
Updated OWNERS files to include link to docs
2019-02-08 09:05:56 -08:00
Thomas Runyon
6770fa7ba5 Merge remote-tracking branch 'upstream/master' into test-cmd-what 2019-02-06 12:28:52 -05:00
Thomas Runyon
4fc5be8d5a Merge remote-tracking branch 'upstream/master' into test-cmd-what 2019-02-05 19:23:21 -05:00
David Eads
66b1f5ba67 add --all-namespaces to 2019-02-05 13:37:14 -05:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Rasmus Jönsson
4c31e9855d Add support for waiting by label selector or on all resources
Add test for multiple deletions in kubectl watch
2019-02-02 16:26:00 +01:00
Thomas Runyon
8772e26315 Fixed variable check for new WHAT command 2019-02-01 13:53:23 -05:00
Thomas Runyon
eecd88b450 fixed merge 2019-01-26 09:06:40 -05:00
Thomas Runyon
1a821ff5cf Merge remote-tracking branch 'upstream/master' into test-cmd-what
Conflicts:
	test/cmd/legacy-script.sh
2019-01-26 07:40:33 -05:00
Jordan Liggitt
89b0b0b84b Clean up initializer-related comments, test data 2019-01-25 12:37:45 -05:00
Thomas Runyon
a844df60f8 Fixed spacing in readme 2019-01-24 19:54:28 -05:00
Thomas Runyon
5d766bdb24 Removed resetting KUBE_ROOT 2019-01-23 07:01:55 -05:00
Thomas Runyon
f47e404125 removed debugging code 2019-01-15 16:21:59 -05:00
Thomas Runyon
163844cb13 Added ability to execute subsets of cli tests 2019-01-15 16:20:50 -05:00
Jordan Liggitt
9229399bd6 Remove build/verify scripts for swagger 1.2 API docs, API server swagger ui / swagger 1.2 config 2019-01-15 13:33:06 -05:00
Tara Gu
492c042d9f Surface error for run_recursive_resources_tests 2019-01-07 15:59:11 -05:00
Jordan Liggitt
e243e646fc Fix create secret docker-registry compatibility 2018-12-26 11:11:29 -05: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
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
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
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
Jordan Liggitt
03f26e4612 update kubectl run to generate apps/v1 deployments 2018-11-13 14:39:25 -05: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
k8s-ci-robot
3f5db92840
Merge pull request #68812 from WanLinghao/token_projection_ca_secret_create
Create Ca-certificate configmap  used by token projected volume
2018-11-08 10:57:25 -08:00
WanLinghao
efac533f92 To inject ca.crt into container when projected volume was specified, configmap should be created in each namespace.
This patch add a controller called "root-ca-cert-publisher" to complete above job as well as some bootstrap rbac policies.
2018-11-08 11:33:47 +08:00
k8s-ci-robot
77fd16e0e7
Merge pull request #69266 from SataQiu/fix-20180930
Remove the redundant space
2018-11-02 08:38:37 -07:00
SataQiu
c9bc625428 Remove the redundant space 2018-11-02 15:45:11 +08:00
Sean Sullivan
d5865240c5 kubectl: fixes expose bug for workload without selectors 2018-10-30 19:27:10 -07:00
Jordan Liggitt
57df11bc0f Switch kubectl rollout to directly rolling back deployments 2018-10-26 23:48:44 -04:00
k8s-ci-robot
c0d9a0728c
Merge pull request #69897 from code-sleuth/develop
Remove error output from stdout to stderr
2018-10-19 04:57:33 -07:00
Ibrahim Mbaziira
7480650e05
Remove error output from stdout to stderr 2018-10-19 00:28:36 +03:00
k8s-ci-robot
bba6e2583e
Merge pull request #69739 from mortent/UnflakeCmdRsTest
Remove flaky test by avoiding reuse of name for replicaset
2018-10-16 19:26:05 -07:00
Antoine Pelisse
572a028148 kubectl diff: Print error when something goes wrong 2018-10-12 14:12:32 -07:00
Morten Torkildsen
dcb3d8b14f Remove flaky test by avoiding reuse of name for replicaset 2018-10-12 12:01:07 -07: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
k8s-ci-robot
b25bf81573
Merge pull request #69044 from enj/enj/i/gv_remove_pointers
Remove pointer receivers from schema structs
2018-09-27 07:18:40 -07:00
Monis Khan
ad87465e2f
Remove pointer receivers from schema structs
This change makes the schema structs consistently use non-pointer
receivers.  This makes it easier to call these methods since these
structs are used as values instead of pointers.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2018-09-26 09:51:29 -04:00
Antoine Pelisse
0db6249740 kubectl-diff: Simplify interface
The current interface is kind of clunky and not super easy to use, since
you have to specify parameters to specify which versions to diff. Also
the default isn't the most useful setting.

Change the interface by removing all the parameters and force only one
useful use-case, that is: diffing what's currently live against
what would be live if applied.
2018-09-11 15:53:29 -07:00
Kubernetes Submit Queue
058b26f38e
Merge pull request #68069 from apelisse/kubectl-apply-dryrun
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Add --server-dry-run flag to `kubectl apply`

- Adds the flag
- changes the helper so that we can pass options for patch,
- Adds a test to make sure it doesn't change the object

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

**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
Add new `--server-dry-run` flag to `kubectl apply` so that the request will be sent to the server with the dry-run flag (alpha), which means that changes won't be persisted.
```
2018-09-02 15:31:05 -07:00
Antoine Pelisse
967280b58e Add --server-dry-run flag to kubectl apply 2018-09-02 13:13:46 -07:00
Kubernetes Submit Queue
85300f4f5d
Merge pull request #67803 from saad-ali/csiClusterReg3
Automatic merge from submit-queue (batch tested with PRs 64283, 67910, 67803, 68100). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

CSI Cluster Registry and Node Info CRDs

**What this PR does / why we need it**:
Introduces the new `CSIDriver` and `CSINodeInfo` API Object as proposed in https://github.com/kubernetes/community/pull/2514 and https://github.com/kubernetes/community/pull/2034

**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 https://github.com/kubernetes/features/issues/594

**Special notes for your reviewer**:
Per the discussion in https://groups.google.com/d/msg/kubernetes-sig-storage-wg-csi/x5CchIP9qiI/D_TyOrn2CwAJ the API is being added to the staging directory of the `kubernetes/kubernetes` repo because the consumers will be attach/detach controller and possibly kubelet, but it will be installed as a CRD (because we want to move in the direction where the API server is Kubernetes agnostic, and all Kubernetes specific types are installed).

**Release note**:

```release-note
Introduce CSI Cluster Registration mechanism to ease CSI plugin discovery and allow CSI drivers to customize Kubernetes' interaction with them.
```

CC @jsafrane
2018-08-31 16:46:41 -07:00
saad-ali
fdeb895d25 Automatically install CRDs during controller init 2018-08-31 12:25:59 -07:00
juanvallejo
c32d10f3cf
add prototype sorting for table rows 2018-08-30 16:09:05 -04:00
Kubernetes Submit Queue
0148f25fe7
Merge pull request #67734 from Huang-Wei/fix-nodelost-issue
Automatic merge from submit-queue (batch tested with PRs 64597, 67854, 67734, 67917, 67688). 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>.

fix an issue that scheduling doesn't respect NodeLost status of a node

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

- if Node is in UnknowStatus, apply unreachable taint with NoSchedule effect
- some internal data structure refactoring
- update unit test

**Which issue(s) this PR fixes**:
Fixes #67733, and very likely #67536

**Special notes for your reviewer**:

See detailed reproducing steps in #67733.

**Release note**:
```release-note
Apply unreachable taint to a node when it lost network connection.
```
2018-08-27 22:18:12 -07:00
Wei Huang
61e6acb1a8
update e2e shell script due to newly introduced unreachable:NoSchedule taint when the node is in Unknown status 2018-08-27 16:19:03 -07:00
Kubernetes Submit Queue
501e3f7e7d
Merge pull request #67707 from apelisse/fix-diff-404
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>.

diff: Fix crash when remote object doesn't exist

Since we're saving nil in an interface rather than the implementation,
we can't compare to nil to check if the remote object exists or
not. Change the struct to save in the implementation.



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

**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-08-23 15:32:14 -07:00
Kubernetes Submit Queue
2e82dd2715
Merge pull request #67713 from liggitt/process-substitution
Automatic merge from submit-queue (batch tested with PRs 59230, 66233, 67483, 67713). 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>.

Make kubectl create secret tls work with process substitution

Fixes #57909

```release-note
`kubectl create secret tls` can now read certificate and key files from process substitution arguments
```
2018-08-22 23:04:26 -07:00
Jordan Liggitt
24b639afcc
Make kubectl create secret tls work with process substitution 2018-08-22 10:35:07 -04:00
Antoine Pelisse
a3417fe62c diff: Fix crash when remote object doesn't exist
Since we're saving nil in an interface rather than the implementation,
we can't compare to nil to check if the remote object exists or
not. Change the struct to save in the implementation.
2018-08-22 06:36:29 -07:00
Maciej Szulik
59fc12006b
Fix NameFromCommandArgs when passing command after -- 2018-08-22 15:23:13 +02:00
Kubernetes Submit Queue
1737a43324
Merge pull request #66876 from juanvallejo/jvallejo/prototype-plugins
Automatic merge from submit-queue (batch tested with PRs 67062, 67169, 67539, 67504, 66876). 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>.

Update the kubectl plugin mechanism

**Release note**:
```release-note
The plugin mechanism functionality to closely follow the git plugin design
```

Replace the existing plugin mechanism with the design proposed in https://github.com/kubernetes/community/pull/2437.

~~_The full implementation of the plugin mechanism itself is entirely contained within the first commit._~~

## Walkthrough

Under the new design, there is no plugin installation or loading required to use plugins.
A plugin is simply any executable file on a user's PATH whose name begins with `kubectl-`.
- Plugins receive the inherited environment from the `kubectl` binary. All environment variables
accessible by `kubectl` become accessible by the plugin.
- Plugins decide which command path they wish to implement based on their name. For example, a plugin wanting to provide a new command `foo`, would simply be named `kubectl-foo`.

### Creating a plugin

Below is an example plugin, that we will use for this walkthrough. Plugins may be written in any language, and handle arguments and flags in any way, optionally (as a convention) providing a way to retrieve their version via a `version` subcommand.

```bash
#!/bin/bash

# optional argument handling
if [[ "$1" == "version" ]]
then
    echo "1.0.0"
    exit 0
fi

# optional argument handling
if [[ "$1" == "config" ]]
then
    echo $KUBECONFIG
    exit 0
fi

echo "I am a plugin named kubectl-foo"
```

### Using a plugin

To use a plugin, simply make it executable:

```bash
sudo chmod +x ./kubectl-foo
```

and place it anywhere in your PATH:

```bash
sudo mv ./kubectl-foo /usr/local/bin
```

You may now invoke your plugin as a `kubectl` command:

```bash
$ kubectl foo
I am a plugin named kubectl-foo
```

All args and flags are passed as-is to the executable:

```bash
$ kubectl foo version
1.0.0
```

All environment variables are also passed as-is to the executable:

```bash
$ export KUBECONFIG=~/.kube/config
$ kubectl foo config
/home/<user>/.kube/config

$ KUBECONFIG=/etc/kube/config kubectl foo config
/etc/kube/config
```

Additionally, the first argument that is passed to a plugin will always be the full path to the location where it was invoked (`$0` would equal `/usr/local/bin/kubectl-foo` in our example above).

### Plugin discoverability

Seeing as how the `kubectl plugin` command is left as a no-op with this PR (perhaps it could serve as an entrypoint towards additional plugin functionality in the future), a small subcommand has been included that _lists all available plugin executables on a user's PATH_, along with any warnings it finds.

Example usage of this new subcommand is included below:

```bash
$ kubectl plugin list
The following kubectl-compatible plugins are available:

test/fixtures/pkg/kubectl/plugins/kubectl-foo
plugins/kubectl-foo
  - warning: plugins/kubectl-foo is overshadowed by a similarly named plugin: test/fixtures/pkg/kubectl/plugins/kubectl-foo
plugins/kubectl-invalid
  - warning: plugins/kubectl-invalid identified as a kubectl plugin, but it is not executable
plugins/kubectl-bar

error: 2 plugin warnings were found
```

cc @kubernetes/kubectl-maintainers @kubernetes/sig-cli-pr-reviews @soltysh @seans3 @mengqiy
2018-08-17 11:58:22 -07:00
Kubernetes Submit Queue
d3a0bb6a84
Merge pull request #67137 from juanvallejo/jvallejo/usability-fix-kube-get
Automatic merge from submit-queue (batch tested with PRs 67137, 67372, 67505, 67373, 67357). 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>.

prevent "No resources found" output on forbidden error

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

This was originally fixed in https://github.com/kubernetes/kubernetes/pull/35115, but made its way back. Added a small test

cc @soltysh
2018-08-16 10:34:11 -07:00
juanvallejo
4bdc636380
add updated plugin mechanism 2018-08-15 15:06:29 -04:00
juanvallejo
df0077f362
prevent "No resources found" output on forbidden error 2018-08-15 13:54:23 -04:00
Nikhita Raghunath
3d33301332
kubectl: update message for a no-op patch 2018-08-14 18:42:27 +05:30
Di Xu
0af6faed09 kubectl: recreating resources for immutable fields when force is applied 2018-08-09 22:59:02 +08:00
Kubernetes Submit Queue
e322d1485d
Merge pull request #60316 from soltysh/create_job
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>.

Full blown kubectl create job

**What this PR does / why we need it**:
This is a followup to https://github.com/kubernetes/kubernetes/pull/60084 which adds full blown `create job` command

/assign @deads2k @juanvallejo 

**Release note**:

```release-note
Add kubectl create job command
```
2018-08-01 13:04:18 -07:00
Maciej Szulik
4ced88b162
Full blown kubectl create job 2018-08-01 15:04:04 +02:00
juanvallejo
ad11a1b7a6
update exit code to 0 if patch not needed 2018-07-31 14:41:30 -04:00
Jordan Liggitt
84ceaf1943
ensure rs pod cleanup happens 2018-07-10 15:43:43 -04:00
Kubernetes Submit Queue
24ee75e265
Merge pull request #65880 from juanvallejo/jvallejo/fix-template-printer-rollout-cmds
Automatic merge from submit-queue (batch tested with PRs 64226, 65880). 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 rollout commands

Binds PrintFlags to rollout commands.
Adds tests ensuring --template printing is supported by rollout cmds.

Fixes https://github.com/kubernetes/kubernetes/issues/65778

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

cc @soltysh @deads2k
2018-07-09 12:16:06 -07:00
Benjamin Elder
2583c12268 delete copied comment 2018-07-06 16:26:56 -07:00
Benjamin Elder
0b43710604 switch to glob 2018-07-06 16:25:28 -07:00
Benjamin Elder
ca79547e92 fix visibility of testdata for //test/cmd:legacy-script 2018-07-06 16:08:20 -07:00
juanvallejo
2b0b605c80
wire PrintFlags through rollout commands
Binds PrintFlags to rollout commands.
Adds tests ensuring --template printing is supported by rollout cmds.
2018-07-06 17:32:42 -04:00
David Eads
aa8110044d straight split of test-cmd 2018-07-05 11:38:26 -04:00
David Eads
a6f5dddc4f move test-cmd guts to separate sig-cli maintained directory 2018-07-05 11:38:26 -04:00