- 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
Currently, diff AND kubectl can return 1 errors either when diff finds
differences, or when kubectl fails something. It also prints an ugly
error when diff finds a differences, since 1 is treated as an error.
Two things this PR does:
1. If diff returns 1, then do not treat it as an error, and exit with
exit code 1. It no longer prints the ugly error.
2. Kubectl errors are +1'd so that they never return 1 which shouldn't
be considered an error.
We need to update the documentation accordingly, to mention that
`KUBECTL_EXTERNAL_DIFF` programs must also follow the convention of
using one as their exit code for changes detected.
Kubernetes-commit: f2b21f08d95291212ba8987aa9d446c02a96089a
* Extend --dry-run to support string values for dry run strategies
'client', 'server', and 'none'
* Ensure --dry-run is set and accessed via cmdutil
* Deprecate --dry-run (unset), --dry-run=true, and --dry-run=false
Kubernetes-commit: af52beda260257e81cc9e19e9e5108b682ee93d6
- 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
The tool golangci-lint gives a bunch of warnings. This PR solves the easier/less controversial ones, so the code is simpler and a little bit more optimal, since it removes some if conditions.
Kubernetes-commit: cd2adbe760641f844d84d411f9adcf17fb6982ff