Commit Graph

28 Commits

Author SHA1 Message Date
Jefftree 8c8a04f6d0 Add feature toggle for OpenAPI V3 apply in kubectl
Kubernetes-commit: f23ab829bee7951188d3196c16794cc489d0348c
2023-10-27 01:23:19 -04:00
Arda Güçlü 507fbad069 Add shortname ambiguity warning in shortcut expander (#117668)
* Add warning handler callback function in shortcut expander

Currently, errors in client-go are propagated back to the callers via
function returns. However, there is no elegant way for just warning users.
For example, when user wants to get a resource with it's short name format
and if there are multiple resources belonging to this short name, we need to
warn user about this ambugity which one is picked and which ones are discarded.

Not only to overcome this particular case mentioned above, but also propose a
way for the possible warnings in the future, this commit adds a warningHandler
callback function in shortcutExpander.

* Add warningPrinter functionality in ConfigFlags

ConfigFlags has neither warning user in a standardized
format functionality nor passing warning callback functions to other upper level
libraries such as client-go.

This commit adds an ability that user can set warningPrinters
according to their IOStreams and this warningPrinters will be used
to raise possible warnings happening not only in cli-runtime but
also in client-go.

* Pass warning callback function in ConfigFlags to shortcutExpander

This commit passes warning callback function to print possible
warnings happened in shortcut expander to warn user in a
standardized format.

* Add integration test for CRDs having ambiguous short names

This commit adds integration test to assure that warning message
related to this ambiguity is printed when resources are being retrieved via their short name
representations in cases where multiple resources have same
short names.

This integration test also ensures that the logic behind which resource
will be selected hasn't been changed which may cause disperancies in
clusters.

* Remove defaultConfigFlag global variable

* Move default config flags initialization into function

* Skip warning for versions of same group/resource

* Run update-vendor

* Warn only once when there are multiple versions registered for ambiguous resource

* Apply gocritic review

* Add multi-resource multi-version ambiguity unit test

Kubernetes-commit: a504aed54d028dbc8ea2508142c94d309f5f1ec6
2023-10-11 19:58:38 +00:00
HirazawaUi 08300912da fix fd leaks and failed file removing for pkg kubectl and pod-security-admission
Kubernetes-commit: b94c6daa0b7602e2d30e35cf2b94f9d1e8fde56e
2023-05-03 01:36:46 +08:00
Katrina Verey a038484b5c Allow conformant CRDs to be ApplySet parents
Kubernetes-commit: 923d9b63fd87e9446f5746f544237c7e0de009a0
2023-03-07 11:29:50 -05:00
Alexander Zielenski a56d6d4a49 refactor factory to support fake openapiv3
Kubernetes-commit: 81dd9e3d2565f827dae34d6aac24cca690d840d1
2023-01-23 19:09:43 -08:00
Katrina Verey 530dea246b Introduce CLI for ApplySet-based pruning (#115979)
* Introduce CLI for ApplySet-based pruning

* Address feedback from justinsb

* Fix parent namespace sourcing and restrict types. Increase test coverage.

Kubernetes-commit: 0dd346673c00158247c8232f9e81a308fb741463
2023-02-27 12:20:40 -05:00
Amir Alavi 749342438f kubectl: use v2 for hpa
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>

Kubernetes-commit: 69b853fa308cb7cb40486a733626d4344ab1be85
2023-01-06 23:45:54 -05:00
Sean Sullivan 7c10c1c878 Unexport OpenAPIGetter factory method
Kubernetes-commit: 1da46b2f28267421dad9a8e5164e6bce16ae9fcb
2022-12-12 16:01:05 -08:00
Sean Sullivan e5c05deb7b Refactor to simplify factory Validator
Kubernetes-commit: 5e8648b9f1cdbcbb10f22fd46b6ac40dbc471de2
2022-12-11 18:20:28 -08:00
inosato 8272d71ba6 Remove ioutil from kubectl
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 774ab1349bfd553c97a99b992e9f38659f541c84
2022-07-30 22:31:16 +09:00
m.nabokikh 2988d073de Add auth API to get self subject attributes
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Kubernetes-commit: 00dfba473b08528f0a21f7bd3b921f5dd35b013a
2022-07-22 04:01:52 +04:00
Brian Pursley 96f0c72304 Add unit tests for api-resources and api-versions commands
Kubernetes-commit: 13e0120bf0662c4530df2badf1f8f73426cf9e51
2022-05-14 11:06:49 -04:00
Kevin Delgado 61f42e595f add server-side validation support to kubectl
Kubernetes-commit: fe3772890f650f9bcf020b43dc5a51fab0fa17f4
2022-03-09 14:52:32 +00:00
Arda Güçlü 11acf004c8 Remove deprecated discovery/ServerResources function
ServerResources function was deprecated and instead ServerGroupsAndResources
function is suggested.

This PR removes ServerResources function and move every place to use ServerGroupsAndResources.

Kubernetes-commit: ef39a8914291ba200bd5486c88a7575ffd4b7d1d
2021-12-22 11:14:09 +03:00
Yuvaraj Kakaraparthi 38487e770c kubectl: add --support to get, patch, edit and replace commands
Co-authored-by: Nikhita Raghunath <nikitaraghunath@gmail.com>

Kubernetes-commit: a5aa858d44651ba48bdce634a39b55be91216614
2021-07-07 08:30:59 -07:00
Jefftree ef358291b5 googleapis/gnostic -> google/gnostic
Kubernetes-commit: 8a1d5947ad34ba275192341baa4e5fef8e6c7f24
2022-03-15 20:36:21 -07:00
brianpursley 5cd0db54d5 Add unit tests for cluster, context, and user command line completion functions
Kubernetes-commit: 996f79738e6f6c7dc9723cffe2b0bddc267777c6
2022-02-12 11:23:35 -05:00
Stephen Augustus 55e15b6165 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Jordan Liggitt 49f840d934 kubectl: send policy/v1 evictions to servers that support it
Kubernetes-commit: f07fc213b07568442b22757b2220b80a5041cced
2021-04-01 22:50:59 -04: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
Maciej Szulik 6b4e2b9b05 Drop batch/v2alpha1 API
Kubernetes-commit: 3dab7462d1ff6e20f7efe38249dd9958e4e32c89
2020-12-01 16:33:47 +01:00
Sai Harsha Kottapalli ac26f503e8 fix staticcheck for kubectl pkg files
Kubernetes-commit: f6b3c5fb3f78d1d2736fe97326b976783b34f6b7
2020-09-30 15:33:29 +05:30
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
Maciej Szulik e80cf9ce71 Use temporary directory when creating temporary file in tests
Kubernetes-commit: a7529f4cd90ea6f662e1398608eccd86e886026f
2020-07-17 10:41:16 +02:00
Jordan Liggitt fe32c3454c Add support for v1 CSRs to kubectl certificate commands
Kubernetes-commit: ca234db60151ccffdd4dc8ceb2ec3c69fd83af69
2020-06-04 11:39:02 -04:00
wojtekt 4f3723dc40 Register conversions for kubectl testing types
Kubernetes-commit: ea140f5e1a1a297e251cc28a40e2bbf77dfd02e4
2020-01-09 14:16:33 +01:00
clarklee92 87db492820 Modify the status code number to HTTP status semantics
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>

Kubernetes-commit: f86f5ee14ef3c8adf9855ce16dcc57beca949719
2019-11-06 00:45:35 +08:00
Sean Sullivan c6063dd846 Move pkg/kubectl/cmd/{command} to staging
Kubernetes-commit: 0e0ea523392f1121f61f99ac30a9bc2043eaed90
2019-08-01 11:01:40 -07:00