Commit Graph

211 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
6079cebfae
Merge pull request #90187 from julianvmodesto/last-applied-updater
Implement server-side apply upgrade and downgrade
2020-07-13 16:45:20 -07:00
Julian V. Modesto
e4368eb67e Implement server-side apply upgrade & downgrade.
- Allow client-side to server-side apply upgrade.

  Ensure that a user can change management of an object from client-side apply to
  server-side apply without conflicts.

- Allow server-side apply to client-side downgrade.

  For an object managed with client-side apply, a user may upgrade to
  managing the object with server-side apply, then decide to downgrade.

  We can support this downgrade by keeping the last-applied-configuration
  annotation for client-side apply updated with server-side apply.
2020-07-08 19:14:03 -04:00
Anders Eknert
c595f983fa Move kube_flags_without_token creation 2020-07-06 21:55:23 +02:00
Anders Eknert
b423216a3b Presence of bearer token should cancel exec action
If a bearer token is present in a request, the exec credential plugin should accept that as the chosen method of authentication. Judging by an [earlier comment in exec.go](c18bc7e9f7/staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go (L217)), this was already intended. This would however not work since UpdateTransportConfig would set the GetCert callback which would then get called by the transport, triggering the exec plugin action even with a token present in the request. See linked issue for further details.

See #87369 for further details.

Signed-off-by: Anders Eknert <anders.eknert@bisnode.com>
2020-07-02 12:12:32 +02:00
Kubernetes Prow Robot
e529bd0bca
Merge pull request #92404 from BenTheElder/agnhost-primary2
s/master/primary in agnhost guestbook usage
2020-06-25 05:30:37 -07:00
Benjamin Elder
f2b2d44614 s/master/primary in agnhost guestbook usage 2020-06-24 12:14:33 -07:00
Jordan Liggitt
a2dd5112c0 go1.14: fix test/cmd timeout message check 2020-06-23 19:04:43 -04:00
Kubernetes Prow Robot
1faf097f3f
Merge pull request #88649 from oke-py/remove-deprecated-export
Remove --export flag from kubectl get command.
2020-06-18 15:19:10 -07:00
Naoki Oketani
c0562815fa Remove --export flag from kubectl get command. 2020-06-17 18:35:03 +09:00
Jordan Liggitt
0d674c4edb cmd: silence warnings in kube-controller-manager/kube-apiserver, dedupe/color warnings in kubectl 2020-06-11 16:04:19 -04:00
Brian Pursley
f5dc5300c6 Replaced 4 kube::test::get_object_assert() calls with 1 call using regex to match all combinations 2020-06-09 08:35:54 -04:00
Rares Folea
d6b55b4469
Fix typo test/cmd/README
Typo in `Adding Tests` section
2020-06-02 14:50:55 +03:00
Kubernetes Prow Robot
83f343011f
Merge pull request #91308 from julianvmodesto/remove-deprecated-server-dry-run-flag
Remove deprecated --server-dry-run from kubectl apply
2020-05-29 01:05:35 -07:00
Kubernetes Prow Robot
8b3c00c661
Merge pull request #89799 from julianvmodesto/patcher
Make kubectl client-side apply with server-side dry-run safer
2020-05-27 20:50:02 -07:00
Kubernetes Prow Robot
7c3f7065db
Merge pull request #91113 from soltysh/create_deployment
Refactor create deployment and add --port flag
2020-05-26 23:24:54 -07:00
Maciej Szulik
ed1a0e9456
Refactor create deployment and add --port flag 2020-05-26 17:33:28 +02:00
Kubernetes Prow Robot
f097cee156
Merge pull request #90960 from zhouya0/fix_kubectl_create_secret_docker_registry
Fix kubectl create secret docker-registry --from-file
2020-05-26 05:39:12 -07:00
Kubernetes Prow Robot
97145d685c
Merge pull request #91077 from brianpursley/kubectl-501-2
Changed kubectl config set-cluster and set-credentials to support process substitution for filenames
2020-05-20 16:45:25 -07:00
Julian V. Modesto
3e93f99262 Remove deprecated --server-dry-run.
For the beta server-side dry-run feature, `kubectl apply` provided the
`--server-dry-run` flag.

As of 1.18, this flag was deprecated and marked to be removed after 1
release.
2020-05-20 16:53:53 -04:00
Julian V. Modesto
f0eb68c0cf Make client-side apply safer
- Remove the ServerDryRun field and delegate it entirely to the resource.Helper
- Use resource.Helper for deletions (as in `kubectl apply --force`)
instead of using the pruner's method that uses a dynamic client
- Reduce the resource.Helpers and times we check for server-side dry-run
in apply
2020-05-19 17:01:47 -04:00
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