* Test for ApplySet with --dry-run=client|server
* Use the real format for ApplySet ID
* Incorporate feedback
* Adjustments from rebase
Kubernetes-commit: 6a31757f45693fec5ea4723bcb405ce4437e31ca
As we apply objects when using apply/prune v2, we want to be sure they
include the label that ties them back to the applyset they are part
of.
Co-Authored-By: Katrina Verey <katrina.verey@shopify.com>
Kubernetes-commit: ab058308401b35b4865424cfa43ed75a554af2a3
Changes in kubectl apply --prune to support k8s Inclusive Naming Initiative:
* Deprecated the --prune-whitelist flag.
* Deprecated the PruneWhitelist field on ApplyFlags struct.
* Removed PruneWhitelist field (not used anywhere) from ApplyOptions struct.
* Added --prune-allowlist flag.
* Added PruneAllowlist field on ApplyFlags struct.
* Added unit tests for prune with allowlist
This commit also fixes a bug where the command would fail if you specified
the sameGVK multiple times for --allow-whitelist. Now it only attempts to
prune the unique set of allowed GVKs.
Kubernetes-commit: f7ebf4d8852d4500f24100ca9a4ca665efc1fada
Currently `kubectl apply` determines correct patch type for given
GVKs by trying to register schema and if it succeeds, it uses
strategic-merge-patch.
But OpenAPI endpoint already stores which patch types are supported
by GVKs. This PR checks OpenAPI endpoint to retrieve patch type,
if OpenAPI is enabled. If it is not enabled, patch type determination
will be done as conventional registration method.
Kubernetes-commit: cddbb0c56397448ac0489f0473a26601c1feece8
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.
This change fetches the OpenAPI schema only once.
Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
Some unit tests throw this warning.
W1013 09:06:21.581870 176998 helpers.go:567] --dry-run=true is deprecated (boolean value) and can be replaced with --dry-run=client.
This patch removes the warning by using --dry-run=client instead of --dry-run=true.
The unit tests that are affected are:
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/apply GOFLAGS=-v
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/create GOFLAGS=-v
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Kubernetes-commit: ad7cbac16354e19981e986bbc2b3fd9cfa930d45
- Remove the ServerDryRun field and delegate it entirely to the resource.Helper
- Use resource.Helper for deletions (as in `kubectl apply --force`)
instead of using the pruner's method that uses a dynamic client
- Reduce the resource.Helpers and times we check for server-side dry-run
in apply
Kubernetes-commit: f0eb68c0cfcff6d50d9d5ec278f96820e3cb3f9a
- Move TestSupportsDryRun to cli-runtime
- Move TestDryRunVerifier to cli-runtime
- Add OpenAPI schema for testdata to cli-runtime
- Use Helper.DryRun and DryRunVerifier for Apply
- Add WithOptions methods to Helper
Kubernetes-commit: 6bea0e469bcfe4967cbf2656a998d60e0b684747