kubectl/pkg/cmd
Ondra Kupka edad3048e9 kubectl: Cache Verifier.HasSupport calls
The underlying implementation decodes OpenAPI schema on every HasSupport
call. This causes these calls to be expensive and noticable when many
resources are being applied.

This patch wraps the verifier with a thread-safe cache so that when many
resources of the same kind are being checked, only the first call
includes schema decoding.

This solution is specifically limited to the kubectl codebase without
any changes required in client-go, for now, although that is where the
issue is actually originating.

Kubernetes-commit: 9043afae6d98585dd14d203d48807b14b433d730
2025-05-23 21:58:05 +02:00
..
annotate Use canonical json-patch v4 import 2024-02-16 13:57:24 +01:00
apiresources Use generic sets rather than deprecated sets.String 2024-11-21 13:22:39 +03:00
apply kubectl: drop dependency on github.com/pkg/errors 2025-05-26 10:44:46 +02:00
attach Add warning message for attach 2024-09-06 02:31:14 +00:00
auth Drop null creationTimestamp from test fixtures 2025-03-24 09:37:26 -04:00
autoscale feature(kubectl): support mem-percent,cpu-value,cpu-average-value,mem-value,mem-average-value flag to kubectl autoscale 2024-12-24 10:01:25 +08:00
certificates Update CLI help text for grammar and consistency 2023-06-12 15:55:59 -04:00
clusterinfo Drop go-colortext and its usage 2024-11-01 09:55:42 -04:00
completion Update CLI help text for grammar and consistency 2023-06-12 15:55:59 -04:00
config Deprecate kubeconfig's preference field in favor of kuberc 2025-05-13 13:39:13 +02:00
cp Increase kubectl cp command timeout to 30 seconds 2025-03-28 12:39:01 +03:00
create Drop null creationTimestamp from test fixtures 2025-03-24 09:37:26 -04:00
debug feat: kubectl debug: add label for debugger pod 2025-05-15 17:32:06 +07:00
delete show namespace on delete (#126619) 2025-06-24 02:15:09 +00:00
describe Use generic sets rather than deprecated sets.String 2024-11-21 13:22:39 +03:00
diff Set LANGUAGE env variable in TestDiffProgram for consistent locale behavior 2025-03-21 17:28:41 +00:00
drain Use generic sets rather than deprecated sets.String 2024-11-21 13:22:39 +03:00
edit switch to latest sigs.k8s.io/yaml v1.5.0 (run update-gofmt.sh as well) 2025-06-25 08:03:06 -04:00
events Use generic sets rather than deprecated sets.String 2024-11-21 13:22:39 +03:00
exec kubectl: expose context parameter in DefaultRemoteExecutor 2025-03-12 15:51:13 +01:00
explain Revert shorthand for kubectl explain --output 2025-05-26 12:16:24 +09:00
expose Drop null creationTimestamp from test fixtures 2025-03-24 09:37:26 -04:00
get Drop null creationTimestamp from test fixtures 2025-03-24 09:37:26 -04:00
help Move pkg/kubectl/cmd/{command} to staging 2019-08-01 11:01:40 -07:00
kustomize Migrate genericclioptions.IOStreams usage to genericiooptions 2023-04-05 14:07:46 +03:00
label Use canonical json-patch v4 import 2024-02-16 13:57:24 +01:00
logs Wire context to logs command and add interrupt handler (#127503) 2024-10-22 21:49:06 +03:00
options replace deprecated setoutput 2022-04-05 14:04:22 +08:00
patch kubectl: drop dependency on github.com/pkg/errors 2025-05-26 10:44:46 +02:00
plugin correcting link to krew install 2024-05-27 16:52:19 +05:30
portforward Use generic sets rather than deprecated sets.String 2024-11-21 13:22:39 +03:00
proxy Migrate genericclioptions.IOStreams usage to genericiooptions 2023-04-05 14:07:46 +03:00
replace Replace PollImmediate with PollUntilContextTimeout (#128147) 2024-11-07 16:57:29 +02:00
rollout Unhandled panic crash on rollout_history printer.PrintObj (#130503) 2025-04-24 00:01:14 +03:30
run Drop null creationTimestamp from test fixtures 2025-03-24 09:37:26 -04:00
scale bug(kubectl): return resource builder error in scale cmd 2024-10-14 18:25:13 +08:00
set remove import doc comments 2024-12-02 14:43:58 +01:00
taint Use generic sets rather than deprecated sets.String 2024-11-21 13:22:39 +03:00
testing Add feature toggle for OpenAPI V3 apply in kubectl 2023-10-27 01:23:19 -04:00
top Enhance help text for the 'top' command 2025-06-26 16:53:50 -07:00
util kubectl: Cache Verifier.HasSupport calls 2025-05-23 21:58:05 +02:00
version Kubectl: check version skew (#127365) 2025-05-19 20:19:14 +03:00
wait kubectl: fix wait --for=create to work correctly with label selectors (#128662) 2024-12-12 06:49:46 +00:00
alpha.go Migrate genericclioptions.IOStreams usage to genericiooptions 2023-04-05 14:07:46 +03:00
cmd.go Swap KUBECTL_COMMAND_HEADERS to use the proper feature gate mechanism 2025-05-08 14:09:17 +02:00
cmd_test.go Swap KUBECTL_COMMAND_HEADERS to use the proper feature gate mechanism 2025-05-08 14:09:17 +02:00
profiling.go Add Close() for profile 2021-12-15 21:03:34 +08:00
skiplookerr_go118.go Adjust for os/exec changes in 1.19 2022-07-22 17:42:11 -04:00
skiplookerr_go119.go Adjust for os/exec changes in 1.19 2022-07-22 17:42:11 -04:00