Commit Graph

279 Commits

Author SHA1 Message Date
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
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
Chok Yip Lau 31e15a5c73 Remove dependency of generators from create configmap
Kubernetes-commit: 838b189130e1a7f19b11a0764f15df1c8de32769
2021-01-10 18:47:32 -05: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
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
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
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
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