kubectl/pkg/cmd
Arda Güçlü 119abb31f8 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.

Kubernetes-commit: 43d8b3459baec794c8a3a858c04f1562a09886a3
2021-12-21 11:53:09 +03:00
..
annotate Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
apiresources Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
apply Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
attach Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
auth Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
autoscale Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
certificates Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
clusterinfo Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
completion Upgrade Cobra from 1.2.1 to 1.3.0 to fix a bug where bash completions don't work when the kubectl command uses the --context flag to specify a context that contains a colon 2022-01-12 10:37:13 -05:00
config Add completion for 2021-11-30 18:20:05 +08:00
cp add option to make kubectl cp resume on errors 2021-09-06 10:04:15 +02:00
create Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
debug Add backwards compatibility for kubectl debug 2021-06-28 18:19:50 +02:00
delete Add manually invalidate cache documentation into delete 2021-12-21 11:53:09 +03:00
describe Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
diff Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
drain Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
edit Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
events 'kubectl events' command (#99557) 2021-10-29 17:13:38 +00:00
exec Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
explain Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
expose Add --override-type flag to kubectl run and kubectl expose to allow the choice of using a JSON Patch or Strategic Merge Patch to apply the override to the generated output. 2021-11-05 07:10:47 -04:00
get Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
help Move pkg/kubectl/cmd/{command} to staging 2019-08-01 11:01:40 -07:00
kustomize Manually update kustomize attachment points. 2021-07-01 17:10:28 -07:00
label fix label msg 2022-01-20 10:56:46 +08:00
logs Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
options cleanup: use i18n.T on all command descriptions 2020-10-09 13:16:13 +02:00
patch Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
plugin Adding an example for kubectl plugin list 2021-11-22 13:21:21 -05:00
portforward Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
proxy Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
replace Minor adjustments to descriptions and example text 2021-07-06 15:05:26 -04:00
rollout Add label selector in 'kubectl rollout' commands 2022-01-06 16:53:29 -05:00
run Add --override-type flag to kubectl run and kubectl expose to allow the choice of using a JSON Patch or Strategic Merge Patch to apply the override to the generated output. 2021-11-05 07:10:47 -04:00
scale Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
set Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
taint Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
testing generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
top Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar' 2022-01-06 23:28:44 -05:00
util Update label selector message to clarify that constraints use AND operator 2022-01-07 17:25:17 +00:00
version kubectl: remove unnecessary fmt.Sprintf 2021-11-04 13:45:47 +01:00
wait Added JSONPath wait for kubectl wait 2021-10-04 16:19:08 -04:00
alpha.go 'kubectl events' command (#99557) 2021-10-29 17:13:38 +00:00
cmd.go Fix default config flags 2021-12-19 19:59:46 -08:00
cmd_test.go Switch from arguments to an input structure for kubectl command 2021-11-04 16:29:08 +01:00
profiling.go Add Close() for profile 2021-12-15 21:03:34 +08:00