Commit Graph

881 Commits

Author SHA1 Message Date
chymy 942504dab2 add i18n.T in waitExample
Signed-off-by: chymy <chang.min1@zte.com.cn>

Kubernetes-commit: e472a7724bc6f105e07c9a0d6362cd0e8390d2fe
2021-01-28 10:35:21 +08:00
bl-ue 3bac60a8ed Fix typo in kubectl/.../attach_test.go
exepctedErr -> expectedErr

Kubernetes-commit: b34d00aa09084d5786d4ca5cf11b173be9f791eb
2020-11-27 14:55:23 -05:00
Sagar Muchhal 72f141c577 Passes a context to the drain helper object
Enables the PatchOrReplace call for the cordon helper to accept a
user-supplied context to be used for the client.Patch/Update calls to
alter the node status while cordoning/uncordoning the node.

Signed-off-by: Sagar Muchhal <muchhals@vmware.com>

Kubernetes-commit: 017eaa519de5926fd75a9ddc61bedf2398b69653
2020-12-04 15:13:03 -08:00
xiongzhongliang c6d8fe03b9 cleanup: fix the format of kubectl proxy examples
Kubernetes-commit: 5a77916666a0aa7893da1bebf706a8e98793b81e
2021-01-05 06:02:37 +08:00
xiongzhongliang b0de341b90 Remove kubectl alpha debug command in 1.21
Kubernetes-commit: e650a8a38c30ff3707292c060613acdb0714b2ec
2021-01-16 20:17:22 +08:00
xiongzhongliang bfad7fa736 code cleanup for kubectl alpha -h
Kubernetes-commit: 5eff181ec30624706eb024467fb1b9d5c9a473f7
2020-12-27 07:30:44 +08:00
Bryan Boreham 40c811e2d9 Comment default behaviour of GracePeriodSeconds
It took me a while to spot this subtlety.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

Kubernetes-commit: 7c764c8550121b48a6e2678700b6a80fa7d3e2f0
2020-11-23 17:46:14 +00:00
Chok Yip Lau 31e15a5c73 Remove dependency of generators from create configmap
Kubernetes-commit: 838b189130e1a7f19b11a0764f15df1c8de32769
2021-01-10 18:47:32 -05:00
Li Bo 1d8a42052c fix problem that NewReplicaSet shows <none> when describing deployments
Kubernetes-commit: a286455a3e230eb1373002b302669c6999c949f1
2021-01-06 11:05:31 +08:00
Sachin Kumar Singh 8e81e1d9ff Remove the dependency between create poddisruptionbudget and generators
Kubernetes-commit: 1e4cba79ef8972248ac360b4ac5b21b085f6a8dc
2020-12-22 01:50:52 +05:30
Chok Yip Lau a306e7043b Moving kubectl logs Long command into variable
Kubernetes-commit: bd4bf6a28e1080ee9f5c4b2885eecb94542f35f8
2021-01-10 14:54:27 -05:00
Masashi Honma 3c3bc4f5e8 Namespace has no effect when exposing deployment with --dry-run=client
This is how to reproduce.

$ kubectl create ns testns
$ kubectl -n testns create deployment test-deploy --image=nginx
$ kubectl -n testns expose deployment.apps/test-deploy --port=80 --dry-run=client -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    app: test-deploy
  name: test-deploy
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: test-deploy
status:
  loadBalancer: {}

If --dry-run=client is not specified, namespace element is contained in the yaml.

Kubernetes-commit: 8d83dfe2075be68344a633418de7ef81e1dd5957
2020-12-24 09:40:10 +09:00
Henrique Fernandes 5d79d7168d Remove debug print
Kubernetes-commit: 32b8d5ae20105c88fd33c1a34f245639c4a0f6f7
2021-01-19 17:21:50 -03:00
Douglas Schilling Landgraf 2560231a8d kubectl diff: update regex to allow equal param
When using GNU diffutils, some commands (e.g. --color[=WHEN])
requires an equal sign.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>

Kubernetes-commit: 722751accf7607f4d0573778e85027c63e1802ce
2021-01-18 23:22:36 -05:00
Douglas Schilling Landgraf b839958e59 kubectl: run - remove unneeded vars
No need extra vars just for a single validation.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>

Kubernetes-commit: ea017e53af84b05154f275fabcfc95a61b091493
2021-01-15 21:03:27 -05:00
Hidetatsu Yaginuma 0668abe1cd fix invalid indentation
Kubernetes-commit: f00f114ecaca6065be0cbc4c16c670370e202b1a
2021-01-12 13:02:52 +09:00
xiongzhongliang b5ead8eb49 Add statefulset to kubectl autoscale bash completions
Add statefulset to kubectl autoscale bash completions

Kubernetes-commit: 0c74749ec9f2e8ca5ae4710f1d16831998d55625
2021-01-08 03:40:55 +08:00
Chok Yip Lau e9514842ae Fix golint errors for kubectl/pkg/cmd/certificates/certificates.go
Kubernetes-commit: 9a3148291d499a7dc8e25caf429a9a7a8ac06a56
2021-01-09 19:51:51 -05:00
xiongzhongliang ceb5d08972 add -q as shorthand for --quiet
Kubernetes-commit: a7e15c7606d24f0ff11c5ddf05f3cbc6ab891e16
2020-12-31 19:18:17 +08:00
熊中谅10171568 1d4e99420e add more usage info for kubectl wait option --for
add more usage info for kubectl wait option --for

Kubernetes-commit: 033e4a58182fb90e36d5f6cc3f291a2ea114998a
2020-12-29 21:08:03 +08:00
ramnar 75a9c11d24 implemented review comments
Kubernetes-commit: ffc5c5c054bb8138d8fe456f1d9b5a071cdbdbdc
2020-11-18 09:42:36 +05:30
ramnar 23b2c5aba6 remove generator dependency in create service account
Kubernetes-commit: 7000c28b74b6069fd3b5179d89178271b9fafe42
2020-11-12 07:21:46 +05:30
Haoran Wang 8226a30e69 Add NewProxyHandler func
Kubernetes-commit: 930cfe74087080440b1abc58d7918e2fd435377d
2021-01-04 15:58:23 +08:00
xiongzhongliang 862982a5ec cleanup: change klog.Fatalf to fmt.Errorf for kubectl auth reconcile
cleanup: change klog.Fatalf to fmt.Errorf for kubectl auth reconcile

cleanup: change klog.Fatalf to fmt.Errorf for

Kubernetes-commit: 3b3a6d27cd1a55fff173427ac9d74d35de7f5acf
2021-01-01 22:43:51 +08:00
xiongzhongliang 7222c38716 code cleanup for kubectl port-forward
code cleanup for kubectl port-forward

code cleanup for kubectl port-forward

Kubernetes-commit: 555fa97cda1f24631642698e31c2b7b55c003cca
2020-12-27 00:49:18 +08:00
xiongzhongliang 13d5d50660 fix kubectl label error when local=true is set.
fix kubectl label error when local=true is set.

fix kubectl label error when local=true is set.

Kubernetes-commit: cb7009a63bbc90569493f070463ae6715088d46a
2020-12-23 00:03:48 +08:00
xiongzhongliang 269a0a3ee5 fix typo of kubectl completion -h
Kubernetes-commit: fe094b20d2d66a28d4cfb78fcb493d213136cded
2020-12-22 16:49:39 +08:00
cpanato 1feceb70c9 add initial translation for pt_BR
Kubernetes-commit: 0697918749ad7f8997f464016f490bc1fa66a1c2
2018-03-23 13:59:35 +01:00
Sachin Kumar Singh 7259471acb Fix typos and add comments in functions for `kubectl create` subcommands
Certain missing comments and typos in comments are fixed in the files
that implement `kubectl create` subcommands.

Kubernetes-commit: 1c5c8601e479cc3b32809868c250aeb256796484
2020-12-02 03:35:34 +05:30
wangyamei d67b96c166 Fix the wrong link to server-side-apply conflicts
Kubernetes-commit: 958411f452377fda0e3e69a212fe339e73ff499b
2020-12-05 22:59:43 +08:00
Jan Chaloupka 6fea4885d8 kubectl/pkg/cmd tests: set explicit namespace
Otherwise, the namespace gets set to what's a current namespace
in provided kubeconfig. Which can be different from default.

Kubernetes-commit: d4e89547f065ac5eee67ab4646fb3cee874dc1a9
2020-11-20 19:09:54 +01:00
lala123912 11b0ae584d fix staticcheck:vendor/k8s.io/kubectl/pkg/cmd/scale
vendor/k8s.io/kubectl/pkg/cmd/scale/scale.go:212:2: this value of err is never used (SA4006)

Kubernetes-commit: 5710e1b162ea90a3df2622d09864bf2411eb5fd7
2020-11-10 15:19:14 +08:00
cprayer 34c68d249f Added 'No resources found' message to logs command
Kubernetes-commit: 00083d153575e50937d7e0035d27f9b9912f6763
2020-10-17 00:36:57 +09:00
Martin Schimandl 66944ff3b5 remove generator from service in kubectl
Kubernetes-commit: 12a58f3f15a428111d8053a577ac3d21d229a81b
2020-10-02 18:16:28 +02:00
Maciej Szulik d64f53f6eb Move the remaining kubectl bits to k8s.io/kubectl
Kubernetes-commit: 9b8247e5ddb15f3fb9ffe59871172d9a3268af55
2020-11-03 22:11:39 +01:00
Maciej Szulik e650b90b3e Change at which level klog.Fatal is invoked
Kubernetes-commit: 6b4dd3d774bcc84a1f969214096b9cfa373ad389
2020-09-09 21:41:56 +02:00
Derek Carr 74ecab5f7e Downward API hugepages
Kubernetes-commit: 45bd6cb186c05eb3a6cdb2cc4927bbcb50a8ff74
2020-11-06 14:22:53 -05:00
zhouya0 ccd9dd871c Move kubectl get-context validate logic to Validate function
Kubernetes-commit: c41fb9e3bfe5d13347a46d6b08f1b2a8347b1bc8
2020-07-15 19:02:26 +08:00
Bilal Amarni aa373084bf [kubectl] Fail when local source file doesn't exist
When trying to upload an unexisting file to a pod,
kubectl currently doesn't print any error message
and terminates with a zero exit code.

This adds a check and fails explicitly in such cases.

Kubernetes-commit: 3fa5b504423f169723b911547cd22ae85da168e0
2020-04-22 11:09:41 +02:00
Lee Verberne 4dec993ea4 kubectl debug: allow set-image-only invocation
Kubernetes-commit: d6024ce18dd66de2ebe076afa5b33ae4fcfbee67
2020-11-05 13:40:11 +01:00
Aurélien Baumann 1511413ad8 Remove the dependency between create priorityclass command and generators
Kubernetes-commit: 9fff7f70e6d28fd621b2a3ee890b710f05301dad
2020-09-18 11:00:29 -04:00
Sai Harsha Kottapalli 61b85bce7c warn user about resource being deleted
Kubernetes-commit: 7b0ef888f3205f06c871cff901ef0f5b8fdb250c
2020-10-11 02:21:32 +05:30
Karl 'NaN' Wikström 38408eaa8c cleanup: use i18n.T on all command descriptions
cleanup: use i18n.T only on string literals

cleanup: sort imports

Add i18n dependency for wait.go

Remove translation on envResource

cleanup: translate string instead of variable

cleanup: sort imports

cleanup: translate string literal only

Kubernetes-commit: cc8428566ea7160c5b20410a1bee53ca7ddb998e
2020-10-09 13:16:13 +02:00
Douglas Schilling Landgraf bafd13fd9f kubectl: allow users to use args with KUBECTL_EXTERNAL_DIFF
Currently, if users try to use external diff command with arguments
will fail because the entire command won't be available through $PATH.
This patch allow users to use external diff tools with args (or not)
via KUBECTL_EXTERNAL_DIFF env.

Reference: https://github.com/kubernetes/kubectl/issues/937

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>

Kubernetes-commit: a6158c01b9add5b580059d24cb66e54c37ea2531
2020-10-04 23:29:27 -04:00
blade 9cc15e588a return success if cordon node by replace
Kubernetes-commit: c825e8ec16482ebbefc3ae96a26f4dcf924e750c
2019-12-12 20:20:29 +08:00
Obeyda Djeffal 6ff4f17e24 Update staging/src/k8s.io/kubectl/pkg/cmd/create/create_rolebinding_test.go
Co-authored-by: Jian Zeng <anonymousknight96@gmail.com>

Kubernetes-commit: 20da5a9d8e7d5a1290c028b9489a7ab31a0c45bb
2020-11-04 11:50:03 +01:00
Obeyda Djeffal 4507bdb448 replace string casting with fmt.sprintf in test
in: staging/src/k8s.io/kubectl/pkg/cmd/create/create_rolebinding_test.go
test: TestCreateRoleBinding

On go version 1.15.3, casting int to string using `string(int)` causes
the test to fail with this error:

>> k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/create
vendor/k8s.io/kubectl/pkg/cmd/create/create_rolebinding_test.go:75:9:
    conversion from int to string yields a string of one rune, not a
    string of digits (did you mean fmt.Sprint(x)?)
FAIL    k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/create
    [build failed]
FAIL
make: *** [Makefile:185: test] Error 1

Kubernetes-commit: 1e0bbe61ae4d4e186bc8d0991210d1613dc71996
2020-11-04 09:51:01 +01:00
David Eads 6cadd0558f add GVK to fake dynamic client to match actual behavior
Kubernetes-commit: f4383458432cd67714e9ce0acde56a2ed5c24a21
2020-10-29 15:53:34 -04:00
Lee Verberne 5ed93efa24 Remove alpha from kubectl debug
Kubernetes-commit: 30262e9b14e2369528fd27241adb16fae02f684d
2020-11-04 16:30:49 +01:00
Yixiang2019 4f04245659 cleanup: fix some error log capitalization
Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn>

Kubernetes-commit: 62710bc0341dc413bba996351f7f6ab2313f3fa1
2020-10-28 16:44:54 +08:00
Lee Verberne fdd6fda024 kubectl debug: Allow mutating image names
Kubernetes-commit: ee9f11b95f01b32dade5d8dc7329625c40ac0e63
2020-10-30 18:23:34 +01:00
Lee Verberne 6a3c6f9a42 kubectl debug: add tests for Complete,Validate
Kubernetes-commit: 3cfcf3a74fc24e6b4b3f58710fe454d1bc3644cc
2020-10-30 08:54:13 +01:00
Jan Chaloupka 64350dbb8b Move pkg/kubectl/cmd/auth under staging/src/k8s.io/kubectl/pkg/cmd/auth
Kubernetes-commit: d3726b91e2c4c0a945151649230c41d326cf643c
2020-11-03 10:22:36 +01:00
Douglas Schilling Landgraf 56ea9621b7 kubectl: deprecate --delete-local-data
The option --delete-local-data according with users is not clear.
This patch deprecate --delete-local-data in favor of --delete-emptydir-data.

Reference:
https://github.com/kubernetes/kubernetes/issues/80228

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>

Kubernetes-commit: 625e47aaa2769d221c59e5b9b05b4ac97212719b
2020-09-25 17:33:45 -04:00
Anderson Duboc c5f4b7e0f0 remove debug print from create quota
Kubernetes-commit: d88da2855f2d078b2a48a7dd99e1236e041b9ea1
2020-10-15 11:07:19 -03:00
SataQiu d747728794 kubectl: remove the dependency between autoscale command and generators
Signed-off-by: SataQiu <1527062125@qq.com>

Kubernetes-commit: bef2296814afaff32e336fe51bf9e3eb5f2a471f
2020-07-12 13:23:49 +08:00
Marek Siarkowicz 01f27135e8 Add datapolicy tags to staging/src/k8s.io/kubectl
Kubernetes-commit: 4b29b03573ff66c32224672d9e7e4c1dbfe2c414
2020-10-29 18:11:22 +01:00
zhouya0 a60df0a351 Remove dependency between create rolebinding
Kubernetes-commit: 8ab7f6f5cced2cad56e8b71879379715e9bb5f76
2020-07-10 09:43:22 +08:00
shahra 1588007e10 Change pvc describe test
Kubernetes-commit: ff6711140a2319faee57580143a504a3e5adfbf0
2020-10-26 10:49:48 -07:00
shahra 7342d00241 Alter wording to describe pods using a pvc
Kubernetes-commit: bcff03f7d21305a613c7cbfde3143daf6a1d8546
2020-10-14 20:53:10 -07:00
Khaled Henidak (Kal) 2bf7244939 dual stack services (#91824)
* api: structure change

* api: defaulting, conversion, and validation

* [FIX] validation: auto remove second ip/family when service changes to SingleStack

* [FIX] api: defaulting, conversion, and validation

* api-server: clusterIPs alloc, printers, storage and strategy

* [FIX] clusterIPs default on read

* alloc: auto remove second ip/family when service changes to SingleStack

* api-server: repair loop handling for clusterIPs

* api-server: force kubernetes default service into single stack

* api-server: tie dualstack feature flag with endpoint feature flag

* controller-manager: feature flag, endpoint, and endpointSlice controllers handling multi family service

* [FIX] controller-manager: feature flag, endpoint, and endpointSlicecontrollers handling multi family service

* kube-proxy: feature-flag, utils, proxier, and meta proxier

* [FIX] kubeproxy: call both proxier at the same time

* kubenet: remove forced pod IP sorting

* kubectl: modify describe to include ClusterIPs, IPFamilies, and IPFamilyPolicy

* e2e: fix tests that depends on IPFamily field AND add dual stack tests

* e2e: fix expected error message for ClusterIP immutability

* add integration tests for dualstack

the third phase of dual stack is a very complex change in the API,
basically it introduces Dual Stack services. Main changes are:

- It pluralizes the Service IPFamily field to IPFamilies,
and removes the singular field.
- It introduces a new field IPFamilyPolicyType that can take
3 values to express the "dual-stack(mad)ness" of the cluster:
SingleStack, PreferDualStack and RequireDualStack
- It pluralizes ClusterIP to ClusterIPs.

The goal is to add coverage to the services API operations,
taking into account the 6 different modes a cluster can have:

- single stack: IP4 or IPv6 (as of today)
- dual stack: IPv4 only, IPv6 only, IPv4 - IPv6, IPv6 - IPv4

* [FIX] add integration tests for dualstack

* generated data

* generated files

Co-authored-by: Antonio Ojea <aojea@redhat.com>

Kubernetes-commit: 6675eba3eff1c8e565c4060a9c1396f75da7cc3e
2020-10-26 20:46:34 +00:00
Arjun Naik b8a1016326 Added functionality and API for pod autoscaling based on container resources
Signed-off-by: Arjun Naik <anaik@redhat.com>

Kubernetes-commit: 0fec7b0f7e2dfd4b0c6c57e086472546f6c69efa
2020-10-21 11:29:17 +02:00
Ricardo Pchevuzinske Katz ecb02de74e Fix catch all regex and missing DryRun Options
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

Kubernetes-commit: 45d6672a98516faecd94263b9d8e4e9d760c7c1e
2020-10-16 15:45:15 -03:00
Amanda Hager Lopes de Andrade Katz 587d894118 Fixes high CPU usage in kubectl drain
Kubernetes-commit: de9c2c2090bbf66943022e902868a5457410af90
2020-10-02 16:02:12 -03:00
Masashi Honma 309d0ee885 test: Fix deprecated --dry-run parameter
Some unit tests throw this warning.

W1013 09:06:21.581870  176998 helpers.go:567] --dry-run=true is deprecated (boolean value) and can be replaced with --dry-run=client.

This patch removes the warning by using --dry-run=client instead of --dry-run=true.

The unit tests that are affected are:

make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/apply GOFLAGS=-v
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/create GOFLAGS=-v

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>

Kubernetes-commit: ad7cbac16354e19981e986bbc2b3fd9cfa930d45
2020-10-14 10:00:08 +09:00
lixiaobing1 d674eb771e fix func name NewCreateCreateDeploymentOptions
Kubernetes-commit: bd17ef4f767a21868edafa19d7596e8df914b2db
2020-06-09 14:35:15 +08:00
Ricardo Pchevuzinske Katz 4ba72b5c67 Add support for create ingress in kubectl
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

Kubernetes-commit: 73aa0a92f8c79d18a53dd39d3064ac3b0257f11b
2020-10-13 15:22:00 -03:00
Quan Tian 81f5e57cae kubectl: add a space between effect and operator when printing tolerations
Empty key and non-empty effect means to match all keys and values and
the specified effect. However "kubectl describe" prints it without space
between effect and operator. This patch adds the space for this case.

Kubernetes-commit: 04185f4e533b9b8ebaabe1ed09516e85c5ed1ae1
2020-09-21 23:45:31 +08:00
John Howard 5a3ba07822 Fix `kubectl describe ingress` format
Fixes https://github.com/kubernetes/kubernetes/issues/94980

Fixes two formatting issues:
* Un-opened parenthesis (`10.244.0.6:8080)`)
* Bad format string and spacing

Before this PR:
```
Name:             example-ingress
Namespace:        default
Address:
Default backend:  istio-ingressgateway:80 (<error: endpoints "istio-ingressgateway" not found>)
Rules:
  Host                                                                                                      Path  Backends
  ----                                                                                                      ----  --------
                                                                                                            * *
%!(EXTRA string=istio-ingressgateway:80 (<error: endpoints "istio-ingressgateway" not found>))Annotations:  <none>
Events:                                                                                                     <none>
```

After this PR:
```
Name:             example-ingress
Namespace:        default
Address:
Default backend:  istio-ingressgateway:80 (<error: endpoints "istio-ingressgateway" not found>)
Rules:
  Host        Path  Backends
  ----        ----  --------
  *           *     istio-ingressgateway:80 (<error: endpoints "istio-ingressgateway" not found>)
Annotations:  <none>
Events:       <none>
```

Compare to an old kubectl without the bug:
```
Name:             example-ingress
Namespace:        default
Address:
Default backend:  istio-ingressgateway:80 (<none>)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *     *     istio-ingressgateway:80 (<none>)
Annotations:
  kubectl.kubernetes.io/last-applied-configuration: ...

Events:  <none>
```

Kubernetes-commit: 9a0b9138aff179e601f854c70271a50842742b12
2020-09-22 13:29:11 -07:00
Amir Mofasser 77e9a6f47f Add `create ingress` command to `cmd/kubectl`
Add `create ingress` unit tests

Move src code to staging dir

Update create command to reflect new API

Replaced deprecated `extensions` api with `networking`

Fix `missing strict dependencies`

Update BUILD

Update BUILD

Fix commit conflict with upstream

Update after review

* Removed obsolete files
* Moved v1beta to v1 api

Fixed gofmt

Fixed deps imports

Merge with PR #94327

Revert changes

Revert go.mod

Revert BUILD

No need to update generated BUILD

Add required deps to BUILD

Update BUILD

Kubernetes-commit: be45584a03aa9f3a3fd73e3d9cc69545da92616e
2020-10-13 16:54:17 +02:00
Sai Harsha Kottapalli 58a00a6dde Remove the dependency between create quota command and generators
Kubernetes-commit: 0222f2d033e8bef5e9b0657cf50e1bcd39b43a57
2020-10-03 03:04:09 +05:30
Christopher Montoro 74d55cc94b Update the example for kubectl port-forward
Clarify that `REMOTE_PORT` is interpreted as identifying a _Service_ port when provided `TYPE` is `service`.
Also, highlight support for specifying a named port as `REMOTE_PORT`.

Kubernetes-commit: 68e8fd5f33647f22a1bd9ff8508003a969036e25
2020-10-07 21:37:03 -04:00
zhouya0 fd930e3995 Clean up nits in delete cascade
Kubernetes-commit: f5a035a7e66b25c932a82fc8bc7cde195dd05884
2020-09-25 11:38:28 +08:00
Sally O'Malley 87d74c1a63 clarify help for --api-version: note it's API group/version
Kubernetes-commit: 29cd320d89b286c175623a95dd7df8f2cd762c5d
2020-10-05 14:06:32 -04:00
Sally O'Malley 684354b3b1 include APIVersion in output of 'kubectl api-resources'
Kubernetes-commit: 068dbb44f39a3ff4c3cfaf82242c91598582ecd4
2020-10-02 09:28:27 -04:00
Renato Viana aaaf1de578 Fixed percentage behavior in instr
fixed syntax, wrote a test

fixed a test

.

1

Update staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go

Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>

added test

.

fix

fix test

fixed a test

gofmt

lint

fix

function name

validation fix

.

godocs added

.

Kubernetes-commit: 316eff8dee1bb7a5929a28bc07bace910bb0e126
2020-03-22 23:41:45 +00:00
SataQiu 7a93b067f4 kubectl: improve the warning message when doing kubectl apply to the resource without expected annotation
Signed-off-by: SataQiu <1527062125@qq.com>

Kubernetes-commit: 9c163f0a0a97a9bcf10c3f91d2cee02567700d84
2020-07-29 10:39:59 +08:00
wawa0210 c1aa9082c9 Keep the imagePullPolicy of kubectl alpha debug consistent with the default
Kubernetes-commit: 6709d4f93855d485f6a809237efbdc1951fbc30a
2020-09-19 11:46:41 +08:00
Sai Harsha Kottapalli ac26f503e8 fix staticcheck for kubectl pkg files
Kubernetes-commit: f6b3c5fb3f78d1d2736fe97326b976783b34f6b7
2020-09-30 15:33:29 +05:30
Ricardo Pchevuzinske Katz aef03d78a9 Change kubectl clusterinfo to non offensive words
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

Kubernetes-commit: ab129349acadb4539cc8c584e4f9a43dd8b45761
2020-09-30 17:59:35 -03:00
Eddie Zaneski 951c0caa13 Add get-users and delete-user to kubectl config
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 95b189fd8f69812738ba9ea472237ab946863d23
2020-04-03 16:41:46 -06:00
Lee Verberne 9e9322bdd6 Update the use message for kubectl debug
The command now supports type syntax similar to `kubectl get`.

Kubernetes-commit: 40904c7a7de4bcb050030eaf53dfb21c3f076ae9
2020-09-23 15:06:16 +02:00
zhouya0 8411619cbf Support kubectl delete foreground
Kubernetes-commit: 383b5f676670d99dc1fba4254ba7f6a81a052ba3
2020-07-23 18:45:59 +08:00
Dinesh b17989102f Add tests for daemonset view history
Signed-off-by: Dinesh <dineshudt17@gmail.com>

Kubernetes-commit: c88b5e2ef36b4d026ec5852beff404197c199797
2020-09-05 22:10:28 +05:30
Dinesh 55c16b433f Add commend for printHistory function
Signed-off-by: Dinesh <dineshudt17@gmail.com>

Kubernetes-commit: 548b3a784bf2d05a8cfbaf289ce257d7b71efab2
2020-09-05 21:43:22 +05:30
Dinesh 88b59619ba dedup the printHistory logic in DaemonSetHistoryViewer,StatefulSetHistoryViewer
Signed-off-by: Dinesh <dineshudt17@gmail.com>

Kubernetes-commit: fe1e72e792c0f9f42e0ba2e3291ed0dde2cf262a
2020-03-29 21:12:49 +05:30
Dinesh e112514f70 Describe sts on rollout history if the revision
Signed-off-by: Dinesh <dineshudt17@gmail.com>

Kubernetes-commit: 2749dbdc9a1f1e6947278e70daed966749d80426
2019-12-21 15:16:50 +05:30
Sai Harsha Kottapalli abcbb6390c allow adding annotations to pod when using kubectl run and add tests
Kubernetes-commit: 661de7f39eeab6a6977d59f9a24129477f7c5815
2020-07-23 19:37:22 +05:30
Eddie Zaneski 1ac77cf17d Warn when creating roles with custom verbs kubectl
Remove errors when using custom verbs

Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: c9420cd703b9431528e91a78428bb982d3b20b67
2020-06-24 16:20:13 -06:00
renzheng.wang 26aa5c6585 make kubectl/kubeadm completion script support busybox
Kubernetes-commit: ff888f3a43abcb48b773e108baa38858220d88e3
2020-04-08 23:03:53 +08:00
Maciej Szulik 62a25b9910 Handle nil elements when sorting, instead of panicking
Kubernetes-commit: a2d96fcbac6c4d92565fd0453cb6bc8c3b422bcb
2020-09-09 22:39:46 +02:00
brianpursley f9c04a0266 Sort kubectl top output when --sort-by and --containers are used together
- Changed kubectl top to sort first at the pod level and then at the container level when --sort-by and --containers are used together.
- Refactored printSinglePodMetrics into two separate functions instead of passing in bool to change behavior.
- Refactored MetricsSorters to simplify code.
- Added unit tests to test container sorting.
- Fixed pod sorting unit tests which were not working because it was checking for --sort-by command line flag which was never true.

Kubernetes-commit: 04266b37ded103ddb84a192ec816499904fce1d1
2020-08-06 11:47:09 -04:00
Adrian Moreno 3de8ce8105 portforward: Fix UDP-only ports calculation
If a service has both TCP and UDP but the TCP port appears before in the
range loop, it will be considered a UDP-only port and the forwarding
will fail.

Fix that by calculating the difference between UDP ports and TCP ports.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>

Kubernetes-commit: 21b598cbe752dc5d2a2bca0e46729c9e72d162a3
2020-09-11 19:50:11 +02:00
zhouya0 3c159f733a kubectl wait add ignore not found flag
Kubernetes-commit: 3d2d95e99dd1219331ef3d32e63b39122a0ef116
2020-05-11 09:19:10 +08:00
David Eads 084c87563e remove pod presets
Kubernetes-commit: c7911a384cbc11a4b5003da081b181d6b814d07e
2020-08-18 16:31:46 -04:00
Kiyoshi Muranaka 5457c2b27c Fix index out of range panic for kubectl alpha debug
Fix containerNameToRef func to get init containers and ephemeral containers properly.

Set EphemeralContainers in generatePodCopyWithDebugContainer func to nil which means
dropping ephemeral containers from a copy of pod so that it can be created successfully,
otherwise it is rejected by the API server.

Kubernetes-commit: bf3dfaf99942eab20fac1570ca0146d32cb93b57
2020-09-07 02:43:21 +09:00
Michael Gugino a28f944c90 kubectl/drain add support for custom pod filters
Currently, there is no way to supply custom pod filters to
exclude pods meeting arbitrary criteria when using drain
as a library.

This commit adds the ability for developers to add custom
filters to the drain operation when utilizing drain
as a library.

This commit exports certain types that were previously
private to allow for better code reuse.

This commit also adds appropriate unit tests.

Kubernetes-commit: 85004f030dc3dceb9d15f41fdd607545758d5da2
2020-02-18 19:15:07 -05:00
Gaurav Singh 66f1998dda kubectl: Use Fprintf
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Fix typo

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Change Fprintf to Fprintln

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Use %q instead of %s

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Change %q to %s

Kubernetes-commit: b326948a9a317dbc17c6f32dfeea26e090bde3b0
2020-05-25 18:19:27 -04:00
Eddie Zaneski ac345319b3 Update kubectl to use new vendored github.com/fvbommel/sortorder dependency
The author of this dependency is removing the vanity url and has
instructed users to use the GitHub path.

This updates the dependency to the module-less pin to the v1 module tag.

https://github.com/fvbommel/util/issues/5
https://github.com/fvbommel/util/issues/6

Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: db826b14583be77a1757f7f8aaef864ece627042
2020-09-02 17:52:26 -06:00
Jan Chaloupka 81135b09fa kubectl describe pod: use ReportingController as an event source
With https://github.com/kubernetes/kubernetes/pull/91645 merged (promotion of v1beta1 events to v1),
it's no longer permitted to set Source field.
Based on https://stupefied-goodall-e282f7.netlify.app/contributors/design-proposals/instrumentation/events-redesign/#backward-compatibility
Source.Component is supposed to be replaced by ReportingController.
Source.Host is supposed to be replaced by DeprecatedHost, though DeprecatedHost
was never implemented. Thus, ignoring the second field.

Kubernetes-commit: 71edf075de3ea0e26aa40f06f1670862aaebcf33
2020-08-04 18:10:34 +02:00
Michael Gugino e5ddedb459 Handle eviction of pods in deleted namespace
If a pod is already marked deleted, and the eviction
api returns an unauthorized response, ignore that
error since the pod is marked for deletion already.

If the pod is not already marked deleted, retry.

Kubernetes-commit: 8d2a2ffe014ed06b5f8971e7f3dc25ec155e44d4
2020-08-12 16:15:54 -04:00
Ryan Phillips de06b92a12 drain: eviction creates in a deleting namespace will throw a forbidden error
we can safely ignore this error since a deleting namespace will delete
all pods

Kubernetes-commit: 93f62dad6c58bb41c396c48f54c0a73830779599
2020-03-20 14:43:33 -05:00
Clayton Coleman 8a21d7e297 kubectl: Allow --patch-file to be passed to `kubectl patch`
The current structure is limited in the size of the patch it can
accept depending on the shell of the environment (for instance, a
900kb patch cannot be applied in bash 4 on Fedora 32). Allow a user
to specify `--patch-file` to provide a file containing the patch
rather than directly on the command line.

Kubernetes-commit: 6c165083ce4665dbdbc29fbdea03e538e87abaa2
2020-07-29 18:40:55 -04:00
David Eads 25d0565d86 update drain message to include namespace for pod in kubectl get compatible format
Kubernetes-commit: 9655953000406ce413772ac7d5082c923e913bb4
2020-08-26 11:58:14 -04:00
jingxueli 1cf6fb3a8f add line break when describe hpa
Kubernetes-commit: 1bfd6ed6ec7478038fd3dd9839ac7e7a3bab46fb
2020-06-18 20:40:54 +08:00
Maciej Szulik e80cf9ce71 Use temporary directory when creating temporary file in tests
Kubernetes-commit: a7529f4cd90ea6f662e1398608eccd86e886026f
2020-07-17 10:41:16 +02:00
Abhishek Raut 05cb9b1f24 Fix NetworkPolicy describe for egress-all policies
NetworkPolicy egress-all `kubectl describe` output should refer
to the term "destination" as opposed to "source" for describing
policies which do not restrict traffic based on the destination.

Kubernetes-commit: e0caf0b46f061c3fafa10aef83592fe300f2bf52
2020-07-15 18:58:25 -07:00
Adrian Smith e8b951b248 Add unit test to kubectl/cmd/run
This test verifies that adding the "expose" parameter results in a
service being created for the pod.

Kubernetes-commit: c5c48c96804a6dd47cb8fbac25280f3b456f1cae
2020-06-15 20:25:45 +01:00
Sally O'Malley ecd37ea662 get: -o yaml, json set ServerPrint false
Kubernetes-commit: 01e344feb6368647dc1a48c7a3a27b5852f9b89d
2020-08-12 12:23:23 -04:00
Antoine Pelisse 197a2c448d Mention background deletion in kubectl delete cascade help
Kubernetes-commit: 6b7dea4c03ee5aab41fa5575bd0a45ca195add54
2020-07-22 16:06:50 -07:00
Cornelius Weig 8560c536e9 Link to krew's new project site
Kubernetes-commit: 152ee3b57a207abb1279f406b7832abb365e779f
2020-03-01 21:56:56 +01:00
Cornelius Weig 701d4a19e6 Use canonical URL for the krew project
Kubernetes-commit: 5a9a28f8ebdee91606afb2ec60757a4b6ed6ca1b
2020-02-26 23:05:28 +01:00
Davanum Srinivas 9e03232398 Add sigs for root folders
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 5c88b7f25b0781d60fea6017d3a939c0e962316c
2020-08-11 10:35:20 -04:00
Jordan Liggitt 197605389f Fix int->string casts
Kubernetes-commit: 124a5ddf725c4862520d8619017cac9db7a03522
2020-07-24 11:13:07 -04:00
weihan a693563834 better understanding of kubectl attach description
Kubernetes-commit: 4fc4eb0c91b17a438e4ef56215b275e242433c59
2020-05-11 10:12:48 +08:00
Lee Verberne 63b6f85e5d kubectl debug: add support for debugging nodes
When called with a node target, `kubectl debug` will create a run-once
pod in the target node's namespaces.

Kubernetes-commit: 7e63cc8b9d592abbb8a659205555e67b57080837
2020-04-03 18:36:32 +02:00
Sally O'Malley 8b7900f520 When combining PolicyRules, don't duplicate verbs
Kubernetes-commit: ea23faa523c8d118a76c636544a01314619ec21c
2020-05-18 15:20:06 -04:00
Patrick Ohly 953fac2d9a GenericEphemeralVolume: kubectl describe
This reuses the code for describing a PVC, except that the output gets
indented more and some fields are skipped.

Kubernetes-commit: c1178bd925b54898e66cace37d35bf551380a75b
2020-07-03 12:09:34 +02:00
Maciej Szulik c56b1f0b27 Strip .meta.managedFields for kubectl edit command
Kubernetes-commit: 9e5c533cb61b0afe50f926dea0e5562fd2cf7ea0
2020-06-09 14:56:57 +02:00
SataQiu 28378371e6 kubectl: fix the bug that kubectl scale does not honor --timeout flag
Signed-off-by: SataQiu <1527062125@qq.com>

Kubernetes-commit: 8d37c3b8f24478fe36da23f3ac453767f438e80b
2020-06-06 18:19:47 +08:00
SataQiu 4990be8686 kubectl: fix the bug that kubectl autoscale does not honor --name flag
Signed-off-by: SataQiu <1527062125@qq.com>

Kubernetes-commit: 84d177b6d4abab6193dc05302ad54378a0d34aec
2020-06-06 17:35:47 +08:00
Aylei c73a3aa1bf Add debug by copy support for kubectl alpha debug command
Signed-off-by: Aylei <rayingecho@gmail.com>

Update staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go

Co-Authored-By: Lee Verberne <lee@verb.is>

Apply suggestions from code review

Co-Authored-By: Lee Verberne <lee@verb.is>

Kubernetes-commit: cfece3edfe8a726fc5dc65ef89b89021316837c7
2020-04-13 01:58:36 +08:00
Aurélien Baumann bef6c5ee32 Remove the dependency between create clusterrolebinding command and generators
Kubernetes-commit: 484361a1d1eb1e7d37569d0bbe7f3a6ca0de986b
2020-05-15 00:07:01 +02:00
Yuvaraj Kakaraparthi 36c221e3cf kubectl: cannot use --force with --server-side
Kubernetes-commit: f93ad0204eeeb21e567df3d5841847373bf7a646
2020-07-06 10:07:26 -07:00
zhouya0 384af9bcb2 Change kubectl list option stdout
Kubernetes-commit: abad08d915531a6f8686f58a8cb41395ed77c714
2020-07-01 17:00:25 +08:00
zhouya0 1432c7799a Support kubectl annotate list
Kubernetes-commit: ca1d598e58ab3efe4a6f51aaff8fb9796a0a11d0
2020-06-28 11:30:41 +08:00
Alex Wang f00cf71393 Promote NonPreempt feature gate to beta (#91899)
* update nonpreempt featuregate to beta

* update

Kubernetes-commit: 209117413f32ec64e800dc32f69055ef2af75d54
2020-06-30 09:39:05 +00:00
Seth Pollack b55288a363 add labels to diff command
Kubernetes-commit: 75af2fca6125516dff42e9825ceea89367986f78
2020-05-07 14:30:00 -04:00
Jordan Liggitt ad76eea5b3 go1.14: fix gofmt errors
Kubernetes-commit: 14845f0c2d66697be0ae8bce4e1de9d9aad6c796
2020-06-23 15:06:11 -04:00
zhouya0 2b8a7e264f Remove kubectl run validate replicas logic
Kubernetes-commit: 4b82d5ae084719e5ff5e1d6a5036452eb91f4099
2020-06-16 17:01:33 +08:00
Christopher M. Luciano c87f320efb ingress: Add v1 describers for Ingress and IngressClass
Ingressv1 Get is attempted for Ingresses and IngressClasses
and falls back to Ingressv1beta1 if there is a failure.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 31520ccb9b9a96acc4721b69ae231a6cbb74a503
2020-05-19 16:34:34 -04:00
zhouya0 c6077ba088 Fix clusterdump info namespaces flag not working
Kubernetes-commit: 461fbad4122051f02422191f94b5ce26542b15a6
2020-06-08 14:21:31 +08:00
Naoki Oketani 404318cdbc Remove --export flag from kubectl get command.
Kubernetes-commit: c0562815fada455daf4826f59df895942dad8df0
2020-02-28 17:41:00 +09:00
knight42 0597d045eb refactor: move kubectl-cp to staging
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: 1b32dfdafdcd6cce21415c75385970a9ae5b0f01
2020-06-15 12:20:14 +08:00
knight42 5ee889da0a feat(port-forward): warn users about UDP port
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: ca8da7e2984a92a9c024f8f0e6cac2b9ae87339b
2020-06-01 12:28:01 +08:00
zhouya0 7b9fac0696 Add kubectl apply generate name error message
Kubernetes-commit: c91ef266973904c82894492b887deb2a04b6d998
2020-03-10 15:51:41 +08:00
Jordan Liggitt ad0a815d75 cmd: silence warnings in kube-controller-manager/kube-apiserver, dedupe/color warnings in kubectl
Kubernetes-commit: 0d674c4edb3af80a5630223819d9203e43679ba5
2020-06-08 15:20:19 -04:00
Brian Pursley b4594b0812 Added kubectl apply check to prevent using --dry-run=server with --force
Kubernetes-commit: 99f6dca1a8d1ea64d22a68263c77bcafd6fedc48
2020-04-16 21:23:36 -04:00
Sergey Yedrikov a2bdd9d806 Fix for kubectl issue 834:
"kubectl help api-resources --sort-by" text mentions nodes, not API resources

Kubernetes-commit: e5370afba2842b844699b239f3f14306f9923eb6
2020-03-06 15:26:06 -05:00
Jordan Liggitt cd341c1697 Add v1 CSR support to kubectl describe
Kubernetes-commit: 92a665e83f223425608e38286fdf147acb85112d
2020-06-04 12:05:51 -04:00
Jordan Liggitt fe32c3454c Add support for v1 CSRs to kubectl certificate commands
Kubernetes-commit: ca234db60151ccffdd4dc8ceb2ec3c69fd83af69
2020-06-04 11:39:02 -04:00
Brian Pursley 683f5c08eb Added --privileged flag to kubectl run
Kubernetes-commit: cd005c1da41e54971319030687cecafec4884868
2020-04-28 16:30:59 -04:00
Yashpal Choudhary ee2d0387c2 Fix kubectl describe output format for empty annotations
Kubernetes-commit: 73a43f35f5c44e861eeb03353e372942e7e03761
2020-05-25 14:03:20 +05:30
Maciej Szulik f5762887af Fix --save-config for kubectl create commands, where it was missing
Kubernetes-commit: 42ee2068384dd47d684121db8f92e593af1f50fc
2020-06-08 14:02:33 +02:00
Jordan Liggitt 36e31fb164 Copy CSR v1beta1 to v1
* Remove prerelease tags
* Update copyright, package, imports to v1
* Remove signerName, usages, and condition status defaulting

Kubernetes-commit: e0f5cca41076bf24bdf6519698749f913a085071
2020-06-01 21:26:28 -04:00
Jordan Liggitt 610eeed98f Improve kubectl explain formatting-preservation
Kubernetes-commit: a22b6400a1492781aedecb79002718e3fbb023dc
2020-06-05 00:46:51 -04:00
zhouya0 c825cb5a2f Support kubectl create deployment with replicas
Kubernetes-commit: b6213ed931930eba27b4a53db54b4b4d224a1c59
2020-05-29 14:52:07 +08:00
Jordan Liggitt 695c3d2c06 Make kubectl tolerate other versions of the CSR API
Kubernetes-commit: ea6e5e53de03b791c2d30781e29ba9a0c5e0cbf6
2020-06-02 13:53:26 -04:00
Jordan Liggitt be12c7c870 Print and describe failed CSRs
Kubernetes-commit: 6b61cb290786688e3f994f4776f3a672c8f30fbb
2020-04-16 01:05:46 -04:00
drfish 6492d5773b Fix unsafe json construction for scale.go and codec_check.go
Kubernetes-commit: ef469a740a24b87f501606c897ea849d6478e162
2020-02-29 22:14:06 +08:00
Julian V. Modesto df62cad179 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.

Kubernetes-commit: 3e93f9926279db8a4d064d615c4ad7cfdc7ab38b
2020-05-20 16:53:53 -04:00
zhouya0 635dca932f Fix create deployment port not working
Kubernetes-commit: 24766024c17e6090b694b0f57d0b051884a2dac1
2020-05-27 15:56:35 +08:00
Julian V. Modesto 0d395d7c98 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

Kubernetes-commit: f0eb68c0cfcff6d50d9d5ec278f96820e3cb3f9a
2020-04-02 18:26:32 -04:00
Oleg Atamanenko 22e383f0f9 Ignore forbidden error for leases when describing node
Kubernetes-commit: 8aa0df4a74e987f8d0f67e71e2327efbdfd04814
2020-04-24 12:59:41 -07:00
Zhou Peng 27261dabef [kubectl/pkg/cmd/rollout]: fix typo & tidy imports
Signed-off-by: Zhou Peng <p@ctriple.cn>

Kubernetes-commit: ef1deb8b40ca3033309f2ba875560a7a49d3c486
2020-05-25 09:37:18 +08:00
Maciej Szulik 0fc32c9e63 Refactor create deployment and add --port flag
Kubernetes-commit: ed1a0e945649095618bd3484c82b58046bcbd60c
2020-05-14 18:34:40 +02:00
Maciej Szulik 731925c63c Set schedule and image flags required for create cronjob
Kubernetes-commit: 9e7ca872b4e2c9c95f7e7c224bc79c1b698789b9
2020-05-14 18:34:27 +02:00
zhouya0 c027f981b2 Fix kubectl create secret docker-registry
Kubernetes-commit: bbf41448f6c5494d5adabc4954d7230522b28d2e
2020-05-11 11:05:37 +08:00
Aurélien Baumann 3c8dea227e Refactor kubectl create deploy: isolate obj construction logic
Kubernetes-commit: c43f62c10b55a8722f1cd5c0547307da388d6b23
2020-05-18 11:32:23 +02:00
Brian Pursley 7ed1bb5485 Changed kubectl config set-cluster and set-credentials to support process substitution for filenames
Kubernetes-commit: 84d5e664afb809b92c31a4c36acb2baa1fc8649e
2020-05-15 09:22:59 -04:00
zhouya0 2ece9ead67 Fix dry run client ignore namespace
Kubernetes-commit: 2f117260fb50926cf0967dfa2817728eb75e1e90
2020-04-26 15:13:20 +08:00
zhouya0 4a94a16b14 Fix kubectl run ignore namespace
Kubernetes-commit: b3c830d4bf260c68d4299cd1879dbe9ce9913bc6
2020-05-04 22:35:03 +08:00
Aurélien Baumann d55dfd5661 Remove the dependency between create deploy command and generators
Kubernetes-commit: 0cbb2087dab0791956ac9233d9554399fd472bb5
2020-05-01 18:04:37 +02:00
Davanum Srinivas 445ad1366b switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Jan Chaloupka 50e4974848 kubectl describe: print toleration tolerating everything
An empty key with operator Exists matches all keys, values
and effects which means this will tolerate everything:
tolerations:
- operator: "Exists"

as stated in https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/.

However, the current printTolerationsMultilineWithIndent implementation ignores
this case. As the toleration is valid, there's no reason
to skip it when writing the list of all pod's tolerations.

Kubernetes-commit: 0bd9a4c6c5ba4fbbc8439effddc99004ddd6b232
2020-05-12 15:59:52 +02:00
Julian V. Modesto 415a73888a Set kubectl field manager names
Kubernetes-commit: 360c348d0eb5be8c7c9720d5bfda16dbe04e8d15
2020-03-04 22:04:01 -05:00
Maciej Szulik 9f4fb540db Set appropriate owner references when creating a job from cronjob
Kubernetes-commit: b1a068b0fcfeac586df28a8b3d65db33dc3e1aa5
2020-05-13 12:59:49 +02:00
Maciej Szulik b0e673d0df Fix create cronjob help message
Kubernetes-commit: b2b59527964a3629f5d50e4b724aa027b4c36cc5
2020-05-12 10:35:50 +02:00
张潇 41c5cfa5d2 Kubectl Taint now also accepts short forms for "node","nodes","no"
Kubernetes-commit: 8fda1f361c73aafa441e5a8b503cbf2a781fa019
2020-03-02 20:15:34 +08:00
zhouya0 425b3d2e14 Remove *cobra.command from options
Kubernetes-commit: 1ef5732c436463f405b8224c6885a50716bfc39b
2020-04-09 12:15:43 +08:00
Guangming Wang 26aadcf184 fix: add space in front of url in command desc
Kubernetes-commit: 016fe425e56f852bf2703c2548d23fb288f9ece2
2019-12-02 23:30:27 +08:00
Maciej Szulik d727dabb7d waitForPod should use different exitCondition depending on restart policy
Kubernetes-commit: 6f1484256db9579361d218aef7f7960446fd541d
2020-04-24 13:04:42 +02:00
wojtekt 5b27ac0ca2 Fix the flaky kubectl tests at scale
Kubernetes-commit: 98058a1b68da3726e1110dc8bba3838459d03b29
2020-04-23 22:05:55 +02:00
gavinfish 454ffd5141 Staticcheck: vendor/k8s.io/pkg/cmd/set|edit
Kubernetes-commit: 2b8e60bb21358608cfa46942e0b3210eee263ea8
2020-01-21 11:16:03 +08:00
Maru Newby 2cd642e11a kubectl: Update run's --restart help to reflect generator removal
PR #87077 ensured that only pods would created by `kubectl run`. This
change updates the help text for the `--restart` parameter to no longer
reference the removed job and deployment generators.

Kubernetes-commit: ab8b69b54eed552845c0548a30909f97ceaf0457
2020-04-02 21:30:25 -07:00
Maciej Szulik 6a446d6097 Re-use podAttachTimeout when waiting for pod readiness
Kubernetes-commit: c2bb76ebc902ea5172aa56db78d1fb59f4f88bec
2020-04-22 17:01:13 +02:00
Jie Shen 5b17a56c1b Use utils.net to parse ports instead of atoi (#89120)
Kubernetes-commit: 363bb3914296d5330dce29631fb6003c335cfcf7
2020-04-22 06:49:46 +00:00
knight42 b9bc004f47 fix(kubectl): explain crds with the same resource name with builtin objects
Kubernetes-commit: 397f107a0886999e0d45955dfe460112edd9ac5e
2020-03-26 16:07:06 +08:00
gosoon d47103fdcc kubectl: fix the Scheduled eventTime is <unknown> when use kubectl describe pod xxx
Kubernetes-commit: 798f677aaca0b28f22c09ba6b536c84bec6f5d2f
2020-04-17 19:58:27 +08:00
Maciej Szulik e6776b41f6 Fix kubectl version test to tolerate Run error coming from default
localhost:8080

Kubernetes-commit: 34865774a89db5f5b8684d5dd1042f6f4c2b21d0
2020-04-17 17:50:24 +02:00
Kazuki Suda 736b43aee9 Fix missing a shorthand for container flag of kubectl alpha debug
Kubernetes-commit: fca1027dd6d69ca7c5b3dd54059c29b2c8d04762
2020-03-31 12:15:17 +09:00
Riccardo Piccoli 9fae31af80 Change not found output when getting non namespaced resources
Signed-off-by: Riccardo Piccoli <riccardo.piccoli@gmail.com>

Kubernetes-commit: 818f011a2e7e1a05923f06c57ef6089e3a048fba
2020-02-13 17:28:06 +01:00
zhouya0 9d73fd8f3c Fix kubectl version should print version info
Kubernetes-commit: 948f4de2dbba3affca2de460d836158cbde5db78
2020-04-07 15:18:38 +08:00
Lee Verberne c401716d75 kubectl debug: support different kinds
This is a refactor ahead of adding support for supporting `kubectl debug` of nodes.

Kubernetes-commit: 8414d180feb9ddb0d4b9b80ea8e570dcacf98703
2020-04-03 14:31:18 +02:00
zhouya0 9e97ec383e Fix kubectl describe job event test nil pointer
Kubernetes-commit: a576a3c7070c9aeb1da1878e0ca956190979f03a
2020-03-27 19:07:18 +08:00
tipok b096826165 fix BusyBox sed
BusyBox sed works the same way as GNU sed

Kubernetes-commit: 6885919986250c33af63933d95b30d1896a8dd07
2020-02-28 11:06:30 +01:00
knight42 4e70f2b1a7 fix(kubectl): remove trailing space when completing file path
Kubernetes-commit: 2fefd9eea4db910eae2b3b86f4834d0892b659dc
2020-03-25 22:54:33 +08:00
Julian V. Modesto 489b062728 Support kubectl scale --dry-run=server|client
Kubernetes-commit: efed958779d564357a9965fccf43f64ee1feb972
2020-03-30 17:33:15 -04:00
Tatsuhiro Tsujikawa e7bb62301f 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.

Kubernetes-commit: 7af3b01f24edfde34e42640ee565a5a6bb66ce26
2020-03-27 01:11:36 +00:00
Morten Hauberg 84b55fb518 Remove double `kubectl` from output
Kubernetes-commit: 5fe57c61482611361502544f36e9df3d17898449
2020-04-07 12:54:26 +02:00
Sean R. Sullivan 34abefcfa8 Even with build error, kubectl apply should apply all valid resources
Kubernetes-commit: 748ad74245778a93a68652cd7e804d6a1e13ad9d
2020-04-03 19:50:25 -07:00
Jordan Liggitt b0aa950238 github.com/googleapis/gnostic v0.4.1
Kubernetes-commit: 93c7b24562d80959f45c308e7412456a410b9b25
2020-03-31 17:18:56 -04:00
Julian V. Modesto 1cfa7c66b3 Ensure diff doesn't persist patches
Kubernetes-commit: 9c0320f1bfd8edfb11c283b3fd422dc6e49360c5
2020-04-02 17:14:17 -04:00
zhouya0 ff83e52b28 Add kubectl describe CSINode test coverage
Kubernetes-commit: 991547edb6bc5d9302034fbb94b97204ea951348
2020-03-31 12:15:20 +08:00
zhouya0 6bc21dccc3 Fix kubectl describe CSINode nil pointer error
Kubernetes-commit: 55c455e61f6f1e52337e04eeb4ebd41668ffef17
2020-03-30 17:10:40 +08:00
Sean R. Sullivan 26ca5b3402 Fixes problem where kubectl apply stops after first error
Kubernetes-commit: b75990cc7bccc5693df34e29745eea0c98d095d1
2020-03-26 13:24:33 -07:00
Marek Siarkowicz 809652a24f Deprecate heapster related kubelet flags and remove their implementation
Heapster is retired since 1.11.
Having kubectl top mention Heapster is confusing for users.

Kubernetes-commit: 6d9fbd2d9f2fa77da20ebdf800d129e70ee7b932
2018-03-02 17:08:11 +01:00
Jordan Liggitt 53a6dfe9f1 Simplify dual or single port logic
Kubernetes-commit: dfeb617cc0e6a7b4c595eb5f7e927e9ceec1e18d
2020-03-23 22:04:14 -04:00
Marius Ziemke a45347152c fix kubectl port-forward for services with explicit local port
Kubernetes-commit: ef2eaa4f8f7ce85478310775a134047a77a8e310
2020-03-08 17:49:18 +01:00
Davanum Srinivas 196f0c117a Move k8s.io/apiserver/pkg/util/term to k8s.io/component-base/term
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 1d057da2f73118893b5cc27c15d59ff03beb271e
2020-03-16 16:27:44 -04:00