Commit Graph

725 Commits

Author SHA1 Message Date
Brian Pursley 852454f7f7 Improve performance of TestForceApply unit test.
Change backOffPeriod from const to var, so that it can be set lower during unit test.

Kubernetes-commit: f011ed5ca5b23971f2dc620971b3b5bebb346b84
2024-04-23 22:04:38 -04:00
carlory 7f19a8d4f7 fix unusable secret manifest for type docker-registry
Kubernetes-commit: c12e12bd89570979efd7798a3a809228d36e7ec3
2023-07-26 18:08:01 +08:00
Claudiu Belu 0ee0d225f2 Replaces path.Operation with filepath.Operation (staging)
The path module has a few different functions:
Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not
take into account the OS-specific path separator, meaning that they
won't behave as intended on Windows.

For example, Dir is supposed to return all but the last element of the
path. For the path "C:\some\dir\somewhere", it is supposed to return
"C:\some\dir\", however, it returns ".".

Instead of these functions, the ones in filepath should be used instead.

Kubernetes-commit: 856bb5c8f266f5276f1a576f47be622d7cb384e7
2022-06-15 15:17:24 +03:00
Dr. Stefan Schimanski bea8dbbff9 kubectl: fix plugin lookup with positional arguments
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: 62d379fa5abd4f109b1f1dfe2112feff03c569b4
2024-03-31 19:44:03 +02:00
Amirsadra Abdollahi 41e94233a1 Fix: correct dryRunStratergy typo in kubectl expose cmd
Kubernetes-commit: 041337648938dee4229a4147a0239527b3689082
2024-03-25 18:58:35 +03:30
Arda Güçlü 49f3ec973c Add e2e test for kubectl interactive delete
Kubernetes-commit: 7faa8bbac3bbd36a4ee680e6f82460d587186139
2024-01-09 10:12:42 +03:00
Arda Güçlü 14d23cc879 Add custom debug profiles on top of static profiles
This PR adds `custom` flag to let user customizes debug resources.
`custom` flag accepts partial container spec in json format.

Kubernetes-commit: af2dadcb18a0411a0f9aa286c743801efdb81049
2023-09-01 11:46:01 +03:00
Sean Sullivan 18888dae3e adds comments to tunnelingResponseWriter
Kubernetes-commit: 3d56ff21fd3c9c9da82ff22044691ef0671ac7b6
2024-03-04 11:10:17 -08:00
Sean Sullivan 1ac3b7558a adds return context in RunPortForward()
Kubernetes-commit: 9e1546284302c66fda0bae12fc301ee8acf39933
2024-03-01 21:10:32 -08:00
Sean Sullivan 858d3a5b72 portforward: tunnel spdy through websockets
Kubernetes-commit: 8b447d8c97e8823b4308eb91cf7d75693e867c61
2024-02-21 08:56:07 +00:00
Craig Newton 0f1712d674 Add namespace to NotFound error for kubectl logs command (#120111)
Signed-off-by: Craig Newton <newtondev@gmail.com>

Kubernetes-commit: 20b28312ea9278c7b93340d0eca71023c45a43b3
2024-03-01 16:16:48 +00:00
ah8ad3 0184416a0c cleanup: add zero as a value for token create duration and act as default, added test, updated the help text
change duration validator text message in create token

unit bug fixed

Kubernetes-commit: 3b5a79f6471309055090b123a6f88197217e9276
2024-02-28 21:52:58 +03:30
Sean Sullivan 2b8ea3563c remote command turn on feature gates
Kubernetes-commit: a147693deb2e7f040cf367aae4a7ae5d1cb3e7aa
2024-02-13 14:10:40 -08:00
José Carlos Chávez 65a57a36aa chore: adds consistent vanity import to files and provides tooling for verifying and updating them. (#120642)
* chore: drops update vanity imports from script.

* chore: changes copyright year to 2024.

* chore: makes lint happy.

Kubernetes-commit: 6d6398ef9266abce3518a4c9a3d4e4d8feeffdc1
2024-02-08 15:58:16 +00:00
Francis Laniel 4bcd969a9e kubectl debug: add sysadmin profile
Add the sysadmin profile from KEP 1441 [1].

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
[1]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/1441-kubectl-debug#debugging-profiles

Kubernetes-commit: 4d6c0ba518d6c4037102736fe443490dde006fc2
2023-07-10 14:21:39 +02:00
Mohammed Yasin 3e5acb915d fix: create tls secret cert to crt for --cert flag
- Fixed help message for crete tls for --cert flag
- Renamed to "cert" to "crt"

Signed-off-by: Mohammed Yasin <yasindce1998@gmail.com>

Kubernetes-commit: 2203cb7dde8196da4e769d7f7a99918f2c7bb6d3
2023-12-29 06:19:28 +00:00
Vandit Singh 3731515d71 Negative index regression test for json-patch (#122625)
* add testcase with negative index

* exercise successful negative index patching

* use different values for testing

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

---------

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

Kubernetes-commit: 83ff8a2f49f820fb355b24c65b8629710dca8a54
2024-01-18 09:58:32 +00:00
Arda Güçlü cb3e3dd9f6 Use tristate for provideclusterinfo to manage provided flag
Kubernetes-commit: 38c67af789bc62b88275e6a12facfe3f7881208c
2023-11-29 08:58:59 +03:00
Arda Güçlü 2f794d398e move provideclusterinfo assignment into correct place
Kubernetes-commit: 5e5f8b1dd29d1c4f983620dd818b1bc1f00d7319
2023-11-28 08:54:54 +03:00
Arda Güçlü 7af2fcf712 kubectl config set-credentials: Add InteractiveMode and ProvideClusterInfo flags
`set-credentials` command can also be used to config kubeconfig with credentials
exec plugins. However, there is no flag provided by this command to set
`InteractiveMode` and `ProvideClusterInfo` fields in credentials exec plugins.
Since `InteractiveMode` is required field, this makes the command's output
is incomplete and invalid. This PR introduces 2 new flags in set-credentials
command to let users can configure these 2 fields in credentials exec plugins,
especially the one `InteractiveMode` which is required.

Kubernetes-commit: b088e65007761bda1aee0b5fb92f79d1aae82c05
2023-11-23 15:32:32 +03:00
Jefftree d8e26d70e5 Make OpenAPIGetter tolerant of nil
Kubernetes-commit: 9d1829c33ac457d2c803ff900f67df03af50fa94
2023-12-15 13:44:54 -05:00
Arda Güçlü bd6c3274b0 Initialize default attach func regardless of the value of flag
Kubernetes-commit: acbbaddada4cf302134962b1d7fd9fb2c0bdba37
2023-12-22 09:50:48 +03:00
Kazuki Suda 2f8da6f89c Update the help mesage of interactive flag in kubectl delete
Kubernetes-commit: 90e68e3a024cf3793a8a6aae5dcfbf7750f4c6e1
2023-12-21 21:42:23 +09:00
weilaaa b84e274c59 use build-in max and min func to instead of k8s.io/utils/integer funcs
Kubernetes-commit: eb8f3f194fed16484162aebdaab69168e02f8cb4
2023-12-15 15:09:11 +08:00
yulng 4afdc439d1 remove PruneWhitelist, use prune-allowlist instead
Signed-off-by: yulng <wei.yang@daocloud.io>
Signed-off-by: Paco Xu <paco.xu@daocloud.io>

Kubernetes-commit: 06679402e75d001d54770c9ec67cacbf28794009
2023-07-05 11:38:20 +08:00
Ritikaa96 54c3cc2496 making suggested changes
Signed-off-by: Ritikaa96 <ritika@india.nec.com>

Kubernetes-commit: 9efff41b8e0103361cd7b8a41dc9641638c5a292
2023-11-30 13:09:54 +05:30
Ritikaa96 b32cbdf03a Updated descriptions in kubectl create deployment help , added example for multiple images
Signed-off-by: Ritikaa96 <ritika@india.nec.com>

Kubernetes-commit: 76919e9569746e4e1ae0ec190892af3a142553c9
2023-09-04 13:53:57 +09:00
calvin 9a67ed3d47 cleanup the retrun style for cp execute function
Signed-off-by: calvin <wen.chen@daocloud.io>

Kubernetes-commit: 6e0ece85c49462c40221cb4e322197dbbcdc8fd4
2023-10-07 19:05:50 +08:00
Jefftree 351ba8bb1c Lazy load OpenAPIV2
Kubernetes-commit: eb32969ab8f3d1455c33a595bba5b3ce4d8a03b8
2023-10-30 15:42:22 -04:00
Jefftree 8c8a04f6d0 Add feature toggle for OpenAPI V3 apply in kubectl
Kubernetes-commit: f23ab829bee7951188d3196c16794cc489d0348c
2023-10-27 01:23:19 -04:00
Jefftree 03a47d93ec use OpenAPIV3 for kubectl diff
Kubernetes-commit: e7216c6623049d713fbf7cc04e2c42eb957a607e
2023-09-15 17:53:10 -04:00
Jefftree 8b0ab9a40e Use OpenAPI V3 for client side SMP
Kubernetes-commit: 4f3b0b15182d80b02d7a7bd2c210c145b7552f82
2023-09-15 16:46:53 -04:00
James Munnelly 468fb1fd0c KEP-4193: bound service account token improvements
Kubernetes-commit: 76463e21d4dec90b4d49975b182a13e1fdb6b20a
2023-09-19 15:23:28 +01:00
Sean Sullivan 5cdf0dd00c OpenAPIResourcesGetter allows lazy-loading OpenAPI V2
Kubernetes-commit: 2eb06e79ef3ac341bf660b86b390740977fc94e7
2023-03-13 20:28:40 -07:00
Sean Sullivan 348bd97228 OpenAPIResourcesGetter allows lazy-loading OpenAPI V2
Kubernetes-commit: 6614a29f470f802915d1467f5050dbca1f8bc562
2023-03-13 20:28:40 -07:00
Sean Sullivan 969a47ceed StreamTranslator and FallbackExecutor for WebSockets
Kubernetes-commit: 168998e87bfd49a1b0bc6402761fafd5ace3bb3b
2023-07-06 21:22:07 -07:00
Maciej Szulik bdf68c0441 Allow using upper and lower case true|false when setting kubectl feature flags
Kubernetes-commit: e74f2d41aabc2c27db6f2a2a005572c8dd332912
2023-10-23 11:40:41 +02:00
Arda Güçlü c2f0957625 KEP-3638: Promote plugin resolution to beta (#120663)
* Promote plugin resolution to beta

* Not use plugin for kubectl create -f command execution

`kubectl create -f` is legitimate command execution and we shouldn't
search plugins if user invokes this.

* Add integration test for plugin resolution for create command

* Reintroduce feature flag to ability to disable it explicitly

Kubernetes-commit: 074a8b00840e85cc95fd83b1825b14ab21ad09c4
2023-10-23 14:41:38 +03:00
Arda Güçlü 55333c0817 KEP-3895: Promote interactive delete to beta
Kubernetes-commit: e8564d6c5bcf5757238176f90318ae0164274af9
2023-09-05 10:40:12 +03:00
mochizuki875 04a8b4e325 add CAP_NET_RAW to netadmin profile and remove privileged
Kubernetes-commit: e22f8ed553c0c2ed86fa22c5b281ddf13577b8b1
2023-06-13 13:08:06 +09:00
ithrael 84a37fbc5d fix(test): fix error handling condition in test
Kubernetes-commit: d680bc540b5703510c95b9290bfb4317edc7b2e9
2023-08-27 21:11:39 +08: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
SataQiu 582f2b8418 kubectl: ensure '--duration' must be positive for 'kubectl create token' command
Kubernetes-commit: 4a8267f26bea6d47801ea8a18bf2635443de1a46
2023-10-07 11:19:33 +08:00
Abid Malik 64fc8b1f67 fixes the issue in the documentation of kubectl events
Signed-off-by: Abid Malik <AbidMunirMalik@gmail.com>

Kubernetes-commit: d8c145d20da7906722798218652583dea34b48bb
2023-07-13 13:10:33 -04:00
justinsb eda2d31bdd kubectl prune v2: switch to contains-group-kinds annotation
The contains-group-resources was an implementation error, we specified
contains-group-kinds in the KEP.

Because it is in alpha, we simply switch to the new annotation.

We will recognize the old annotation and migrate existing alpha
applysets, but support for this migration can be removed in beta/GA of
applyset.

Kubernetes-commit: 10caecb3b22cf93c7caa2ac70d40af9b550c0da2
2023-06-28 11:27:00 -04:00
Arda Güçlü 5691f5e6f9 Gracefully handle empty config error when local flag is used
`f.ToRawKubeConfigLoader().Namespace()` throws `ErrEmptyConfig` when
default configuration file can not be found, even if it invalid.

However, when user explicitly passes `--local` flag, that means
we can gracefully handle this error and continue. This commit does that
for the commands having `--local` flag.

Kubernetes-commit: ba49ccdbc9b4761d0c9589ab7ca9f41029a99568
2023-06-15 10:13:52 +03:00
Matthias Riegler 90963a2f06 feat: make user-defined plugins discoverable with e.g. kubectl help (#116752)
* feat: make user-defined plugins discoverable with e.g. kubectl help

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: make help text localizable & rename it

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* chore: address CRs, cleanup

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: plugin execution

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

---------

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

Kubernetes-commit: d7b7a85fbc0b3831cbc6a750a47dfdcdf777d519
2023-09-06 18:12:52 +02:00
ithrael 296dae746e fix(kubectl): kubectl events doesn't filter events by GroupVersion for resource with full name
Kubernetes-commit: 28621f1eb3f3a9ba212c844db4696f7f17450942
2023-08-23 11:34:44 +08:00
Davanum Srinivas 1fb897b3e0 New repo who dis? distribution/reference
github.com/docker/distribution/reference has a new home github.com/distribution/reference

and a new tag v0.5.0. Let's switch to that.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 889c8e919bdc8115ad579bb092a4dafdf695754e
2023-08-31 10:48:53 -04:00
ithrael 3225b852aa doc: Add example for restarting all deployments in a namespace
Kubernetes-commit: f4fc4b16b1d9837b4980850480421da318db04eb
2023-09-01 19:25:54 +08:00