Commit Graph

61 Commits

Author SHA1 Message Date
Shang Ding
177905302e add integration tests for debug profiles general & baseline 2023-02-21 17:43:03 -06:00
Kubernetes Prow Robot
12c71fdf1c
Merge pull request #113542 from ardaguclu/fix-shortname-disperancy
Set singular names for core types to pass to discovery
2023-01-03 09:29:43 -08:00
Brian Pursley
c0dea5e31a i18n: Fix bug where package-level variables are not translated.
Change i18n.T() to load translations if they have not yet been loaded.

Added new integration tests to test help output translation.
2022-11-29 23:09:57 -05:00
Arda Güçlü
d6532f5eb8 run discovery tests if resources are supported 2022-11-18 12:21:13 +03:00
Arda Güçlü
ab376e09dd Add integration tests for shortnames expanding to correct resources
This adds new integration tests to test shortnames and
singular names are expanding to correct resources.

In this case, core types have always higher precendence than
CRDs.
2022-11-18 12:18:31 +03:00
Arda Güçlü
f5af2d0e91 (kubectl events): Add integration tests
This PR adds integration tests for `kubectl alpha events`
2022-06-27 09:32:32 +03:00
Davanum Srinivas
50bea1dad8
Move from k8s.gcr.io to registry.k8s.io
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-05-31 10:16:53 -04:00
Jordan Liggitt
fba69f7eb9 Change test/cmd to test deprecations using a CRD 2022-05-04 16:00:57 -04:00
Jordan Liggitt
2a30f1c31b Reorder process shutdown in test-cmd and exit immediately 2022-04-03 22:40:30 -04:00
Kevin Delgado
fe3772890f add server-side validation support to kubectl 2022-03-26 03:45:13 +00:00
Kubernetes Prow Robot
39931456db
Merge pull request #107740 from brianpursley/legacy-script-fixes
legacy-script.sh fixes - junit output and add missing record_command
2022-02-03 17:34:00 -08:00
brianpursley
e120f11438 Change legacy-script.sh to produce junit output in location set by the
ARTIFACTS environment variables if KUBE_JUNIT_REPORT_DIR is not set.

Add missing record_command to a couple of tests in legacy-script.sh.

Fix some typos in /test/cmd/README.md
2022-02-02 21:51:15 -05:00
Arda Güçlü
43d8b3459b Add manually invalidate cache documentation into delete
When CRDs are deleted, discovery local cache is not invalidated.
This brings about `resource not found` error when new CRD with same name is created
with different fields(ie. changing scope from cluster-wide to namespaced).
Because this already deleted CRD still stays in serverresources.json and kubectl tries to use it.

This local cached files have 10 minutes TTL. After deletion, if user waits 10 minutes,
files will be expired and deleted and there will be no errors. However, 10 minutes is a long time
and cache needs to be invalidated after deletion occurs.

This PR adds a document into delete command by noting that there might be a need to invalidate discovery
cache when CRD is deleted. In addition to that this PR adds a test to catch this behavior.
2022-01-26 09:01:46 +03:00
Patrick Ohly
798bdab3d0 kubectl: add integration test for result reporting
This currently covers two cases:
- "kubectl list" (the regression from https://github.com/kubernetes/kubernetes/issues/107012)
- "kubectl get pods/no-such-pod" (no particular reason except that the output
should be deterministic)

In contrast to some other tests that check for strings inside the
output (run_deprecated_api_tests) or compare after
sorting (run_kubectl_version_tests), stdout, stderr and the return code must
match exactly.

This ensures that there is no extra, unexpected output and that the right
output stream is used.
2022-01-11 09:04:56 +01:00
wangyysde
d2abddd909 rename v2beta2 to v2
Signed-off-by: wangyysde <net_use@bzhy.com>

Generation swagger.json.

Use v2 path for hpa_cpu_field.

run update-codegen.sh

Signed-off-by: wangyysde <net_use@bzhy.com>
2021-11-09 10:34:54 +08:00
Andrew Keesler
e427d2f22a
test/cmd: kubectl and exec plugins don't fight for stdin
Signed-off-by: Andrew Keesler <akeesler@vmware.com>
2021-06-15 09:01:18 -04:00
David Eads
2fb8420756 update test-cmd to avoid removed beta APIs 2021-04-19 10:06:37 -04:00
Maciej Szulik
5681a58ef7
Add kubectl-convert tests 2021-02-22 17:01:34 +01:00
knight42
3c4d6859c8
refactor: migrate health checks of control-plane off insecure port in tests
Signed-off-by: knight42 <anonymousknight96@gmail.com>
2020-10-31 11:39:25 +08:00
knight42
cfc2b330a7
refactor(apiserver): ignore the insecure flags
Leave the insecure flags intact but stop serving on insecure port.
2020-10-29 23:20:17 +08:00
Lee Verberne
d0503b228f Add integration test for kubectl debug 2020-10-21 11:13:46 +02:00
Anders Eknert
c595f983fa Move kube_flags_without_token creation 2020-07-06 21:55:23 +02:00
Anders Eknert
b423216a3b Presence of bearer token should cancel exec action
If a bearer token is present in a request, the exec credential plugin should accept that as the chosen method of authentication. Judging by an [earlier comment in exec.go](c18bc7e9f7/staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go (L217)), this was already intended. This would however not work since UpdateTransportConfig would set the GetCert callback which would then get called by the transport, triggering the exec plugin action even with a token present in the request. See linked issue for further details.

See #87369 for further details.

Signed-off-by: Anders Eknert <anders.eknert@bisnode.com>
2020-07-02 12:12:32 +02:00
Brian Pursley
84d5e664af Changed kubectl config set-cluster and set-credentials to support process substitution for filenames 2020-05-15 09:22:59 -04:00
Kubernetes Prow Robot
775feed217
Merge pull request #90018 from wojtek-t/deprecate_default_conversions
Deprecate default conversions
2020-04-23 10:23:10 -07:00
Maciej Szulik
a871738c86
Revert "stop defaulting kubeconfig to http://localhost:8080"
This reverts commit b19ad9e7a7.
2020-04-17 16:37:15 +02:00
wojtekt
f624314f91 Fix multiple conversion tests 2020-04-10 17:03:35 +02:00
Lubomir I. Ivanov
9bbd321fec remove /cluster/kubeadm.sh and /test/cmd/kubeadm.sh
/cluster/kubeadm.sh is used to find the kubeadm binary.
This file is legacy and is removed.

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

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

Also remove the --kubeadm-path invocation as this can be handled
with an env. variable directly.
2020-04-09 00:47:15 +03:00
Sean R. Sullivan
4ca2d5a9da Fixes kubectl apply tests to run; updates broken tests 2020-03-30 17:04:10 -07:00
David Eads
b19ad9e7a7
stop defaulting kubeconfig to http://localhost:8080 2020-03-02 18:32:16 +01:00
Julian V. Modesto
d97169f59a Clean up --dry-run values.
- Clean up --dry-run values in tests, docs, and scripts
- Fix --dry-run for auth reconcile and add a test
2020-02-15 00:43:30 -05:00
Maciej Szulik
82f97775b7
Remove kubectl run generators 2020-01-22 16:44:00 +01:00
Jordan Liggitt
4c3bf1a660 Fix record_command suppression of test errors 2019-11-07 02:26:45 -05:00
Xiangyang Chu
23ce08a7d0 Fix review comments, will squash later. 2019-07-25 14:42:23 +08:00
Xiangyang Chu
4ef227c682 Fix of review comments. Will squash later.
Including:
- Remove external usage of resource name vars
- Add commments about why we export field helpers
2019-07-18 09:12:28 +08:00
Xiangyang Chu
313044abd7 Fix shellcheck failures in test/cmd/l.*.sh 2019-07-17 17:07:22 +08:00
Jordan Liggitt
cf3e75de70 Remove internal object printing from kubectl 2019-06-28 10:54:50 -07:00
Jordan Liggitt
6ca80760fd Switch test manifests to apps/v1, remove beta workloads calls 2019-06-22 13:58:07 -07:00
Xiangyang Chu
eee32a6a88 Fix shellcheck failures in test/cmd/g.*sh 2019-05-17 15:40:14 +08:00
Ahmad Nurus S
0c39d7d380 Kubectl exec support resource/name format 2019-04-25 17:44:01 +07:00
WanLinghao
7fbd71835e 'kubectl auth can-i` command would not hint user when they try to access
some resource out of scope. For example, try get namespace inside defaut namespace.
It would be reject by api-server but `kubectl auth can-i get namespace --namespace=default`
would give a `yes`. After this patch, a warning info would be given.
For more detail, please refer issue #75950
2019-04-10 13:12:45 +08:00
Aaron Crickenberger
3b3c977fc7
Update test/cmd/legacy-script.sh
Co-Authored-By: runyontr <runyontr@gmail.com>
2019-03-02 20:41:42 -05:00
Thomas Runyon
1e44e33517 pulled kubeadm tests out of runTests to run before tests in test/cmd
Added timeout for https://github.com/kubernetes/kubeadm/issues/1430
2019-03-01 12:17:25 -05:00
Kubernetes Prow Robot
81e6407393
Merge pull request #74140 from Liujingfang1/kflag
add -k flag in cli-runtime and kubectl to process kustomization directories
2019-02-26 19:40:16 -08:00
Jingfang Liu
beacc87ebf add cmdline tests for -k 2019-02-25 16:31:03 -08:00
Thomas Runyon
d4df8879f3 call kube:test:clear_all during cleanup 2019-02-22 21:23:53 -05:00
Thomas Runyon
30c78c7e1c Feedback from review 2019-02-21 06:15:13 -05:00
Thomas Runyon
6770fa7ba5 Merge remote-tracking branch 'upstream/master' into test-cmd-what 2019-02-06 12:28:52 -05:00
Thomas Runyon
4fc5be8d5a Merge remote-tracking branch 'upstream/master' into test-cmd-what 2019-02-05 19:23:21 -05:00
David Eads
66b1f5ba67 add --all-namespaces to 2019-02-05 13:37:14 -05:00