mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue Implement --prune-whitelist(-w) flag to overwrite default whitelist for --prune From #34274. Updates: As suggested, the new commits implement a default whitelist for `kubectl apply --prune`, which could be overwritten by using `--prune-whitelist`or `-w` flag. The default whitelist and example as below. Also supports `--dry-run` for `--prune` to fix #35222. whitelist: ``` type pruneResource struct { group string version string kind string namespaced bool } *pruneResources = []pruneResource{ {"", "v1", "ConfigMap", true}, {"", "v1", "Endpoints", true}, {"", "v1", "Namespace", false}, {"", "v1", "PersistentVolumeClaim", true}, {"", "v1", "PersistentVolume", false}, {"", "v1", "Pod", true}, {"", "v1", "ReplicationController", true}, {"", "v1", "Secret", true}, {"", "v1", "Service", true}, {"batch", "v1", "Job", true}, {"extensions", "v1beta1", "DaemonSet", true}, {"extensions", "v1beta1", "Deployment", true}, {"extensions", "v1beta1", "HorizontalPodAutoscaler", true}, {"extensions", "v1beta1", "Ingress", true}, {"extensions", "v1beta1", "ReplicaSet", true}, {"apps", "v1beta1", "StatefulSet", true}, } ``` example: ``` $ kubectl apply -f /path/to/file --prune -l test=true \ -w core/v1/Pod \ -w core/v1/Service \ -w extensions/v1beta1/Deployment ``` @mikedanese |
||
---|---|---|
.. | ||
boilerplate | ||
cmd/teststale | ||
e2e-internal | ||
gen-swagger-doc | ||
jenkins | ||
lib | ||
make-rules | ||
testdata | ||
verify-flags | ||
.linted_packages | ||
OWNERS | ||
autogenerated_placeholder.txt | ||
benchmark-go.sh | ||
benchmark-integration.sh | ||
build-cross.sh | ||
build-go.sh | ||
build-ui.sh | ||
cherry_pick_pull.sh | ||
dev-build-and-push.sh | ||
dev-build-and-up.sh | ||
dev-push-hyperkube.sh | ||
e2e-node-test.sh | ||
e2e.go | ||
federated-ginkgo-e2e.sh | ||
generate-docs.sh | ||
get-build.sh | ||
ginkgo-e2e.sh | ||
godep-save.sh | ||
grab-profiles.sh | ||
install-etcd.sh | ||
list-feature-tests.sh | ||
local-up-cluster.sh | ||
lookup_pull.py | ||
run-in-gopath.sh | ||
test-cmd.sh | ||
test-go.sh | ||
test-integration.sh | ||
test-update-storage-objects.sh | ||
update-all.sh | ||
update-api-reference-docs.sh | ||
update-bazel.sh | ||
update-bindata.sh | ||
update-codecgen.sh | ||
update-codegen.sh | ||
update-federation-api-reference-docs.sh | ||
update-federation-generated-swagger-docs.sh | ||
update-federation-openapi-spec.sh | ||
update-federation-swagger-spec.sh | ||
update-generated-docs.sh | ||
update-generated-protobuf-dockerized.sh | ||
update-generated-protobuf.sh | ||
update-generated-runtime-dockerized.sh | ||
update-generated-runtime.sh | ||
update-generated-swagger-docs.sh | ||
update-godep-licenses.sh | ||
update-gofmt.sh | ||
update-munge-docs.sh | ||
update-openapi-spec.sh | ||
update-staging-client-go.sh | ||
update-swagger-spec.sh | ||
update_owners.py | ||
verify-all.sh | ||
verify-api-reference-docs.sh | ||
verify-bazel.sh | ||
verify-boilerplate.sh | ||
verify-cli-conventions.sh | ||
verify-codecgen.sh | ||
verify-codegen.sh | ||
verify-description.sh | ||
verify-flags-underscore.py | ||
verify-generated-docs.sh | ||
verify-generated-protobuf.sh | ||
verify-generated-runtime.sh | ||
verify-generated-swagger-docs.sh | ||
verify-godep-licenses.sh | ||
verify-godeps.sh | ||
verify-gofmt.sh | ||
verify-golint.sh | ||
verify-govet.sh | ||
verify-import-boss.sh | ||
verify-linkcheck.sh | ||
verify-munge-docs.sh | ||
verify-openapi-spec.sh | ||
verify-staging-client-go.sh | ||
verify-swagger-spec.sh | ||
verify-symbols.sh | ||
verify-test-images.sh | ||
verify-test-owners.sh |