Commit Graph

888 Commits

Author SHA1 Message Date
Katrina Verey 5105e147ad Fix kubectl drain --dry-run=server
Adds missing type meta to PodDelete items

Kubernetes-commit: ff9ada1b550852c697af5250c90e8e4de69110e4
2021-03-12 16:26:48 -08:00
Hidetatsu Yaginuma ea99c2e0e8 use AllowedFormat in kubectl get help to avoid code duplication (#99983)
Kubernetes-commit: 0486f1a728c964f643c70d1f3aea59243a4fedf8
2021-04-09 09:10:22 +09:00
Hong Xu e8a9ba311e Use os.CreateTemp in kubectl editor (#99921)
os.CreateTemp seems to perform the exactly same task here, and its
implementation seems having considered many more edge cases than the
implementation here. This patch uses os.CreateTemp here to avoid
reinventing the wheel.

Kubernetes-commit: de0f030bcec55944dcbf81a9eec4f4d87f76567f
2021-04-08 16:00:25 -07:00
changshuchao 7d1600ce5a code cleanup for kubectl apply_edit_last_applied.go,wait.go,completion.go,cp.go
Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>

Kubernetes-commit: e229ca33cff782e0bf602f43312b9a168aa58c4c
2021-03-07 05:04:30 +08:00
Chok Yip Lau c2974ae03d Fixed describe ingress causing SEGFAULT
Kubernetes-commit: 12f8468fe03291a1da0803b9e5375ec079abd6e6
2021-03-23 18:21:20 -04:00
Aldo Culquicondor eb94c78123 Only default Job fields when feature gates are enabled
Also use pointer for completionMode enum

Kubernetes-commit: e6c3d7b34dff0324adb80591c00519b6f6a4a2e1
2021-03-12 17:26:40 +00:00
mengjiao.liu a0af655b7a kubectl default container behavior
Kubernetes-commit: 88e530117ff3fff29e670aee51c677a8e0fe8dec
2021-03-05 17:04:40 +08:00
Patrick Ohly 5274b1e590 generic ephemeral volumes: drop ReadOnly field
As discussed during the alpha review, the ReadOnly field is not really
needed because volume mounts can also be read-only. It's a historical
oddity that can be avoided for generic ephemeral volumes as part
of the promotion to beta.

Kubernetes-commit: 555d4a12bf58f19cbd79f866e2abce13490bde40
2021-03-03 17:16:13 +01:00
yuzhiquan 0ca8bbb1ad remove --ignore-errors flag deprecated warning message
Kubernetes-commit: 01d0d15562ccb7377176f72fb70a3cf18d0d7666
2021-02-24 19:02:24 +08:00
Jordan Liggitt 9967facf23 kubectl describe policy/v1 PodDisruptionBudget
Kubernetes-commit: 7956a9239ab6e28b5260340aeae5f3e6b1b94a36
2021-03-09 10:56:48 -05:00
Chok Yip Lau c66790ded2 Fixed set env did not support keys with dot in it
Kubernetes-commit: ab5a81cd1502418b1c8a8f55da7f0550b42e7ab7
2021-02-06 22:27:44 -05:00
Maciej Szulik 69bc307556 Fix batch/v1 CronJob support in create, describe and polymorphichelpers
Kubernetes-commit: a68582d6086ffc8608779b0459de8d387042eed1
2021-03-09 09:44:02 +01:00
Morten Torkildsen 8ae7711ae6 Promote PDBs to GA
Kubernetes-commit: 21fba79d453b0bab7153f46916126c754d10341e
2021-02-20 12:56:31 -08:00
bl-ue 91c5000b38 Fix case of Age column in kubectl describe node
Kubernetes-commit: df1955208b9a1950b79630b2fe88376452d70e02
2020-11-30 14:06:34 -05:00
rkilingr 1d4a9f61b6 Provides capacity for make slice
* Providing capacity for slice decreases memory allocations performed

Kubernetes-commit: dfe29ae7f84dccb3a989ed1f5d73bde3f58d4ed8
2021-01-31 20:56:11 +05:30
monopole a767deb039 Manually update kustomize attachment points.
Kubernetes-commit: 6c9460f0b405630ebd21cd432b8b8ffede6d7554
2021-02-25 12:06:47 -08:00
monopole ae675e730f Delete staging/src/k8s.io/cli-runtime/pkg/kustomize
Kubernetes-commit: 073ca8b42e9b5e4bed4c7f5cec12e9c8c17ea0d9
2021-02-13 14:52:06 -08:00
Swetha Repakula 691cc30112 Add v1 describers for EndpointSlice
Kubernetes-commit: ba34956dd6bb348e5ba83580c6864001316cd67c
2021-03-08 13:32:26 -08:00
Heng WU 408faf6867 Wrong command (kubectl top) description (#99060)
* Update top.go

* Update top_pod.go

* Update top_node.go

Kubernetes-commit: b7613c4315c18592621ecae4d4959985ed497623
2021-03-08 22:01:04 +00:00
Jan Chaloupka ba75977126 kubectl explain: detect resource group in case there are two or more groups discovered
Assume the following CRDs exist (ordered by priority, the first is the highest):
- authentications.migration.k8s.io (K=Authentications, G=migration.k8s.io)
- authentications.metal3.io (K=Authentications, G=metal3.io)
- authentications.whereabouts.cni.cncf.io (K=Authentications, G=whereabouts.cni.cncf.io)
- authentications.snapshot.storage.k8s.io (K=Authentications, G=snapshot.storage.k8s.io)

In case 'kubectl explain authentications' is ran, the highest priority definition (in this case authentications.migration.k8s.io)
is returned. In case a user wants to explain authentication CRD of a different group, --api-version flag has to be set alongside
to point to a specific group and version. E.g. --api-version=metal3.io/v1

This PR allows to dismiss --api-version flag and perform a prefix check to select a resource (e.g. CRD) whose (resource, group) pair
fully prefixes requested resource. E.g. running 'kubectl explain authentications.metal3.io' will return
description of authentications.metal3.io. The same holds for optional field path.
I.e. 'kubectl explain authentications.metal3.io.spec' will return description of spec field
of authentications.metal3.io.spec. In case no resource match is found, the search falls back
to selecting the highest priority gvr that matches the resource.
In case --api-version is set, no prefix matching is performed. To cover cases
such as 'kubectl explain authentications.metal3.io --api-version=authentications.metal3.io/v1' where
fields path coincide with the resource fully specified name (to access .metal3.io field of authentications.metal3.io).

Kubernetes-commit: 30674db1595e3a24273ceb71cbfe67bb300ad951
2021-01-14 09:08:20 +01:00
Maciej Szulik 1198e26232 Drop deprecated run flags and deprecate unused ones
Kubernetes-commit: f38ef2fbc6299f4b050a0daa578bfbf393df467c
2021-03-03 22:22:58 +01:00
Harry Bagdi 62d08a495c Add namespace scoped ParametersReference to IngressClass
Kubernetes-commit: a7fc92089a42aff0c2f10d56b0ee290440adfbc4
2021-03-06 03:03:20 +05:30
Maciej Szulik 5e9caaade6 Clean unused generators
Kubernetes-commit: da19e5b2583fa00a13110de97448bf6452010988
2021-03-03 22:47:53 +01:00
Marek Siarkowicz bc5d348632 Use protobuf for kubectl top
Kubernetes-commit: 560394da38422cf106917b7addc3fa828e746b6b
2020-11-18 00:14:20 +01:00
Clayton Coleman 56434236a4 kubectl: Inline the containers for the user in attach/exec
The behavior of the container defaulting in attach/exec is inconsistent
and should be unified. As a user, when we default the vast majority of
pods will have a small number of containers and so printing the container
names inline (as kubectl logs did) is more appropriate. The debug message
we printed about using describe was already longer than 99% of all pod
container names, so we were wasting user time.

Unify container selection for exec and attach to be consistent with old
behavior. Properly handle the --quiet flag (should not print in that case)
for both commands. Remove EnableCmdSuggestion and the machinery it needs.

The message now prints:

> Defaulted container "etcdctl" out of: etcdctl, etcd, etcd-metrics, etcd-ensure-env-vars (init), etcd-resources-copy (init)

Kubernetes-commit: 43e8ebbbcd3f57d18d8151efb6242f88a763b06d
2021-02-11 11:40:25 -05:00
Clayton Coleman 46f90dca38 kubectl: Properly respect --quiet in exec/attach
--quiet means no informational output for the human that could be
confused with the output of the shell / command on the other side.

Kubernetes-commit: 75700d32bff0e28c7093ef384de78dbdd0db61b2
2021-02-11 11:48:43 -05:00
Maciej Szulik 10f53d93f7 Fix kubectl openapi test to use apps/v1/Deployment
Kubernetes-commit: 7c194bb3e3daaadcf0bb785a16bffb3c1add274f
2021-03-01 19:24:15 +01:00
Maciej Szulik 341b878121 kubectl create job support both v1beta1 and v1 cronjob
Kubernetes-commit: 470e23e770223fb9ddb147b3d431c7727f342255
2021-02-12 17:04:50 +01:00
xiongzhongliang 4c524fcbeb fix kubectl patch command error message
Kubernetes-commit: 99f0369f9d9110dbe5d36c20e067e25077a50d9d
2021-02-04 19:15:18 +08:00
Ricardo Pchevuzinske Katz 922a8a5058 Remove extensions v1beta1 from addon manager and kubectl prune
Kubernetes-commit: 25f3cf55509acdd3bd31bc9ca028c5d5a3bd22b0
2021-02-05 09:38:28 -03:00
caodonghui a93288022b remove duplicate logs
Kubernetes-commit: 60991daf1ca6ccd24ae14e6643b8374d55bc75bb
2021-03-02 18:20:12 +08:00
brianpursley 79dc7a9183 Add warning if client/server version difference exceeds the supported skew
Kubernetes-commit: 0c28cad8d142059b488347badd46433d50e47feb
2021-03-03 20:55:05 -05:00
Julian V. Modesto 04f62ffb0b Cache the OpenAPI schema for server-side dry-run.
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.

This change fetches the OpenAPI schema only once.

Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
2021-01-19 16:36:14 -05:00
Shiming Zhang 1bc7e4aa19 Fix MakeRegexpArray handling empty strings
Kubernetes-commit: 63860270e303476cdef282c6bb071c70952b4fbb
2021-03-02 17:53:00 +08:00
John Howard c8325cdd3b Improve warnings for default-container
Right now, there is no way to use these annotations, support multiple
`kubectl` versions, and not give users annoying warnings every time they
run `kubectl log`.

If a user is setting *both* annotations, they clearly know that the old
on is deprecated. Therefor, we should not warn them.

Kubernetes-commit: a7882d8a4264cdb9eaab9dc3d67cf0cc5afd5886
2021-03-02 09:07:50 -08:00
Sean Sullivan 76c2cf7eb6 Kubectl command headers in requests: KEP 859
Kubernetes-commit: 211fc12b67ea2d04a46b24ef245b3513f2cfeb03
2021-02-09 23:09:22 -08:00
Aldo Culquicondor 3af483b7e4 Add Job.spec.completionMode and Job.status.completedIndexes
And IndexedJob feature gate, disabled by default.
Update JobDescriber

Kubernetes-commit: a1a5868a5ae8c18df39b386d2424ff04c89826fb
2020-12-30 11:42:01 -05:00
mengjiao.liu 0a33eeb176 update kubectl cp --container flag description
Kubernetes-commit: 6be7b00b455f632a92c2c9c1a3878ecf5201e955
2021-03-01 18:02:02 +08:00
pacoxu 4245d9e7b5 print log for default container of kubectl
Kubernetes-commit: 96f8d6262459e802510244d2880886f8b481ee0e
2021-03-01 12:04:29 +08:00
Chok Yip Lau 0b4fea3c25 Remove dependency of generators from create secret
Kubernetes-commit: 5d3c4eaf562dcdcdc783dee8861e1a2be031ee69
2021-01-13 18:59:18 -05:00
pacoxu aedad91395 fix: will logs the default container only even --all-containers is specified
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: 71db08d15a580cee1592eb699a3ff448f5fe4fe1
2021-03-01 11:00:05 +08:00
wzshiming ad07682396 Fix --ignore-errors does not take effect if multiple logs are printed and unfollowed
Kubernetes-commit: 336e464caef8234a57d150c2944916445ca91e69
2021-01-07 10:43:36 +08:00
pacoxu 8d367eb060 move default container annotation to kubectl pkg
Kubernetes-commit: 27bd94e54d2f8a7676411b280ab9d0ac7f9e921b
2021-02-26 10:11:12 +08:00
pacoxu 360e8d2b15 feature: use default container annotation for logs and exec
- update according to KEP: move getContainerName to helper

Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: b54e823dbce08bff6fab979243663b0fea5a351f
2020-12-07 15:30:30 +08:00
fabiankramm f32b960dd4 override request host for kubectl proxy
Signed-off-by: fabiankramm <fab.kramm@googlemail.com>

Kubernetes-commit: 379b541070bf5a5f31abe513d717c0f7b12845a8
2020-12-18 10:02:59 +01:00
Philipp Stehle 2aa5185d01 bash-completion for comma separated list on get
`kubectl get` supports specifying a comma separated list of resource types. E.g.:

```bash
kubectl get pods,secrets
```

Will list all pods and secrets in the current namespace.

This commit adds support to the kubectl bash completion for this feature. Which means if you type `kubectl get pods,sec<tab>` it will be auto-completed to `kubectl get pods,secrets` (assuming the cluster does not have a CRD starting with `sec`).

Kubernetes-commit: 51671ecc2e258d50c7b1315b7b68c4e239f7e829
2021-01-22 10:04:56 +01:00
Nikhita Raghunath 75f0d51ce1 kubectl: fix error message for client-side SMP for CRs
Kubernetes-commit: a9a3e4d1c95fcfd8d3b2dbbca31cf7ad6441abbb
2021-02-17 13:44:36 +05:30
Heng WU 58dd520868 Update plugin.go
Kubernetes-commit: 3c1c53c06c7b95283a84b28d3566e74c201e0e21
2021-02-14 11:10:20 +08:00
Heng WU e405ba800f Remove redundant code in kubectl top pod (#99062)
* Update top_pod.go

* Update top_pod.go

Kubernetes-commit: 93ab4e96f3c07e99ff32724aafe6887b6eab94ee
2021-02-17 11:17:06 -06:00
Maciej Szulik 6b4e2b9b05 Drop batch/v2alpha1 API
Kubernetes-commit: 3dab7462d1ff6e20f7efe38249dd9958e4e32c89
2020-12-01 16:33:47 +01:00
Guangwen Feng dec49d660e Fix typo in comment
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>

Kubernetes-commit: 23adf46008aaef329375d5bbfbc9568dc6494a5b
2020-12-25 13:58:13 +08:00
CaiyuhangC 1fa4fffb96 Remove the dependency between create namespace command and generators (#96556)
* Remove the dependency between create namespace command and generators

* Update create_namespace.go

format the file

rename "kruntime" package to "runtime"

remove the reliance of generators

replace dynamic client with typed client

rename "options" to "o" in "NewNamespaceOptions" fun for better reading and comparison with other create cmd

remove Namespace and EnforceNamespace from NamespaceOptions

remove Mapper from NamespaceOptions

refactory the "Run" fun

refactory the "Run" fun

Update create_namespace.go and create_namespace_test.go

* Update create_namespace.go and create_namespace_test.go

* fix createNamespace function

* fix createNamespace function

* fix createNamespace function

* remove the wrong comment in NamespaceOptions

* add validate operation for cobra.Command

* add some unit tests

* add some unit tests

* remove the call of Validate() from createNamespace() and update return type of createNamespace()

* update test suite for the new createNamespace()

Kubernetes-commit: 6990d75625b6aaa32c1aa5a99a174775868263bc
2021-02-05 17:33:15 +00:00
Chok Yip Lau 45c537a0ee Fixed typo in create_priorityclass
Kubernetes-commit: 2edbea60a58c0ec3b5951722a3c90c1752561b50
2021-02-03 21:46:10 -05:00
chymy b2c6b4b00c Remove heapster flag in 'top node'
Signed-off-by: chymy <chang.min1@zte.com.cn>

Kubernetes-commit: 01f521aac6d275be4da31d87bffa7ae29b6216f3
2021-01-27 15:33:04 +08:00
Nick Maliwacki f3ec5d79c4 add .status.observedGeneration tests & update names
Kubernetes-commit: bca0ddeba0d669093d04a148cef4d4179e2fa271
2021-01-13 22:35:58 -08:00
Nick Maliwacki a84bbc2022 wait ensures observedGeneration >= generation
Kubernetes-commit: 44aff9917566885ab5d8cc712a3330bac1923214
2020-12-20 00:35:31 -08:00
yuzhiquan 7e8ba7c82e add ignore-errors flag, support none break drain in group
add warning msg

Kubernetes-commit: db264eaa6e2db5f344ec40dc6dd632ece8fe5768
2021-01-20 15:02:00 +08:00
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