Commit Graph

342 Commits

Author SHA1 Message Date
Shang Ding
177905302e add integration tests for debug profiles general & baseline 2023-02-21 17:43:03 -06:00
Arda Güçlü
6c346e6cc9 Re-enable label selector 2023-02-20 09:10:51 +03:00
Arda Güçlü
6e8a1beda7 Add integration test for diff --prune --selector
This PR adds new integration tests for `kubectl diff --prune -l` to
catch possible regressions in the future.
2023-02-20 09:10:50 +03:00
Kubernetes Prow Robot
1749bb2991
Merge pull request #115579 from ardaguclu/fix-wait-sh-timeout
flaky test wait.sh: Add deployment assertion before running wait
2023-02-10 13:59:29 -08:00
Arda Güçlü
e0fedec69d (kubectl debug): Support debugging via files
Currently `kubectl debug` only supports passing names in command line.
However, users might want to pass resources in files by passing `-f` flag like
in all other kubectl commands.

This PR adds this ability.
2023-02-10 10:21:30 +03:00
Arda Güçlü
60401d35d1 flaky test wait.sh: Add deployment assertion before running wait
There is a test in wait.sh integration suite which is checking the
given timeout value(passed by user) is equal to actual happened timeout value.

However, this test rarely gets `no matching resources found` error and
causes flakyiness. The reason is we are running wait command, immediately
after applying deployment. In reality, timeout test does not care about
deployment, since it is testing the timeout by passing invalid configurations.
But we need this deployment to not get `no matching resources found` error.

That's why, this PR adds deployment assertion before executing wait command.
2023-02-07 14:19:34 +03: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
Kubernetes Prow Robot
4a5d8a4b08
Merge pull request #114627 from ardaguclu/fix-discovery-flaky
Ignore api-resources not found error until it's ready
2022-12-21 13:53:40 -08:00
Arda Güçlü
a5698efff2 Ignore api-resources not found error until it's ready 2022-12-21 10:34:53 +03:00
Maciej Szulik
132f8127a3
Fix wait test timeout 2022-12-20 17:02:23 +01:00
Arda Güçlü
369534c6ec
kubectl wait: wire generic context (#114574)
* Wire generic context to better handle timeout

* Add integration test for wait timeout

* kubectl wait: Fix integration test always passing issue

Currently, `kubectl wait` integration test always passes even if
it gets an error. Problem is object check is done after errexit is
turned off.

This PR redirects error to output and correctly assures that
object is expected status and if it is not, test should fail.
2022-12-19 09:21:56 -08:00
Kubernetes Prow Robot
3ceb213fc1
Merge pull request #113508 from p-slavcheva/fix-diff-osexit
Replace os.Exit in diff
2022-12-13 15:59:34 -08:00
petya.slavcheva1
2dce194e16 Replace os.exit in diff 2022-12-13 14:27:35 +01:00
Kubernetes Prow Robot
9758911fd5
Merge pull request #114252 from ardaguclu/scale-piped-input
kubectl scale: Use visitor only once
2022-12-10 07:55:19 -08:00
Kubernetes Prow Robot
9f85f6d1f1
Merge pull request #114249 from ardaguclu/improve-exec-multi-error
kubectl exec: return descriptive error message when multi resource passed
2022-12-10 07:55:12 -08:00
Arda Güçlü
76ee3788cc kubectl scale: Add dry-run prefix to indicate result is not applied
Currently, if user executes `kubectl scale --dry-run`, output has no
indicator showing that this is not applied in reality.

This PR adds dry run suffix to the output as well as more integration
tests to verify it.
2022-12-02 16:27:18 +03:00
Arda Güçlü
13be899b42 kubectl scale: Use visitor only once
`kubectl scale` calls visitor two times. Second call fails when
the piped input is passed by returning an
`error: no objects passed to scale` error.

This PR uses the result of first visitor and fixes that piped
input problem. In addition to that, this PR also adds new
scale test to verify.
2022-12-02 16:00:22 +03:00
Arda Güçlü
832644f0b3 kubectl exec: return descriptive error message when multi resource passed
`kubectl exec` command supports getting files as inputs. However,
if the file contains multiple resources, it returns unclear error message;
`cannot attach to *v1.List: selector for *v1.List not implemented`.

Since `exec` command does not support multi resources, this PR
handles that and returns descriptive error message earlier.
2022-12-02 14:05:11 +03: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ü
1f54f610e4 minor integration test fixes and more singular resource 2022-11-18 13:11:16 +03:00
Arda Güçlü
d6532f5eb8 run discovery tests if resources are supported 2022-11-18 12:21:13 +03:00
Arda Güçlü
0990ba1cc9 Introduce singularNameProvider for core types
This introduces `singularNameProvider`. This provider will be used
by core types to have their singular names are defined in discovery
endpoint. Thanks to that, core resources singular name always have
higher precedence than CRDs shortcuts or singular names.
2022-11-18 12:21:07 +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
Mark Rossetti
534f052a8d
Updating pause image refernces to 3.9
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-11-14 10:24:54 -08:00
Kubernetes Prow Robot
29ddedae1d
Merge pull request #113541 from oscr/update-shellcheck-0.8.0
Update shellcheck version (0.7.2 -> 0.8.0) and fix findings
2022-11-12 02:23:57 -08:00
Maciej Szulik
50c7ebb5b4
Move events command to top level 2022-11-10 14:44:22 +01:00
Kubernetes Prow Robot
f2fccffd9b
Merge pull request #113708 from apelisse/fix-ssa-flaky-test
Ignore error when getting api-resources until it's ready
2022-11-09 08:30:48 -08:00
Oscar Utbult
61cd37b806 Update shellcheck version (0.7.2 -> 0.8.0) and fix findings 2022-11-08 11:53:57 +01:00
Antoine Pelisse
7596488769 Ignore error when getting api-resources until it's ready 2022-11-07 16:36:24 -08:00
Alexander Zielenski
33b9552e70 add kubectl server-side apply migrate managedfields
in discussion with SIG, there is a strong interest in keeping the last-applied-configuration around for a bit longer as other tools transition for of it. This is OK since SSA maintains the annotation on kubectl's behalf on the server-side if it exists

migrate client-side-apply fields to SSA when --serverside-side is used

https://github.com/kubernetes/kubernetes/issues/107980

https://github.com/kubernetes/kubernetes/issues/108081

https://github.com/kubernetes/kubernetes/issues/107417

https://github.com/kubernetes/kubernetes/issues/112826

add test to make sure only one apply is needed after migration
2022-11-04 14:09:29 -07:00
Kubernetes Prow Robot
526650fc13
Merge pull request #109525 from jonyhy96/feat-wait
feat: make jsonpath wait logics consistent with condition
2022-10-30 09:12:43 -07:00
Kubernetes Prow Robot
fb9b466f30
Merge pull request #113159 from pacoxu/patch-3
flake: wait for crd ready in kubectl apply script
2022-10-20 12:06:56 -07:00
Paco Xu
da070707de flake: wait for crd ready in kubectl apply script 2022-10-20 12:58:04 +08:00
Sean Sullivan
9c18bdab9c Removes test of deprecated --dry-run value 2022-10-18 19:39:34 +00:00
Kubernetes Prow Robot
969d416bc4
Merge pull request #112603 from humblec/var-3
fix typos in pkg/validation and test/cmd
2022-09-21 19:11:02 -07:00
Shyam Jeedigunta
b31301fa24 Integration test for kubectl --disable-compression flag 2022-09-20 16:09:52 -07:00
Humble Chirammal
6621db7dd1 fix typos in pkg/validation and test/cmd
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-09-20 19:12:17 +05:30
Kubernetes Prow Robot
8674ce53ff
Merge pull request #111093 from brianpursley/k-110097
Fix rollout history bug
2022-08-24 07:42:03 -07:00
Arda Güçlü
63b8684cd3 Add new flags into alpha events
In order to promote kubectl alpha events to beta,
it should at least support flags which is already
supported by kubectl get events as well as new flags.

This PR adds;

--output: json|yaml support and does essential refactorings to
integrate other printing options easier in the future.

--no-headers: kubectl get events can hide headers when this flag is set for default printing.
Adds this ability to hide headers also for kubectl alpha events.
This flag has no effect when output is json or yaml for both commands.

--types: This will be used to filter certain events to be printed and
discard others(default behavior is same with --event=Normal,Warning).
2022-07-28 15:16:58 +03:00
Mark Rossetti
40f3e624a6 Switching everything to use pause:3.8
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2022-07-21 14:53:15 -07:00
Brian Pursley
693e1299a6 Fix rollout history bug
Fix rollout history bug where the latest revision was
always shown when requesting a specific revision and
specifying an output.

Add unit and integration tests for rollout history.
2022-07-13 18:27:05 -04:00
jonyhy96
7a1493be56 feat: make jsonpath wait logics consistent with condition
Signed-off-by: jonyhy96 <hy352144278@gmail.com>
2022-06-29 12:28:24 +08: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
Kubernetes Prow Robot
661cbe6823
Merge pull request #109850 from ardaguclu/validate-nooptdefval
Define NoOptDefVal for validate flag
2022-06-13 08:04:11 -07: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
Kubernetes Prow Robot
fdb2d54475
Merge pull request #108210 from jlsong01/update_kubectl_warning
coordinate the kubectl warning style
2022-05-23 15:57:09 -07:00
jlsong01
272e245f06 add a warning printer in cli-runtime to coordinate warning style
modified:   staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go
2022-05-23 19:10:15 +08:00
Kubernetes Prow Robot
47bb8c6d0c
Merge pull request #108777 from pjo256/recursive-rollout-status
feat(kubectl rollout): support multiple resources for rollout status
2022-05-13 13:15:55 -07:00
Kazuki Suda
d2b4c017c8
Fix discovery cache TTL to 6 hours
Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com>
2022-05-09 13:47:52 +09:00
Arda Güçlü
0245e74590 Define NoOptDefVal for validate flag
validate flag does not have default value defined when there is no
parameter passed, therefore it tries to use next irrelevant flag.

This PR defines NoOptDefVal for validate flag which is set "strict".
2022-05-06 14:17:50 +03:00