T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.
Kubernetes-commit: 2181eea48435310d1b6e366ea8db2968c4941b93
Matches same behavior as for kubectl apply
Signed-off-by: Daniel Lenar <dlenar@vailsys.com>
Kubernetes-commit: d53af227870a8e4434a0bf2f58770ec4dbec241f
Changes kubectl diff to exclude managedFields by default.
Adds a new --show-managed-fields flag that allows you to
include managed fields in the diff.
Kubernetes-commit: e88470c31f74cbb1ed685ef1bc2ba91e74fc1c5e
Validate function is used to validate command options and should not get
any additional parameter. To preserve compatibility across all
kubectl commands, this PR removes all parameters in validate functions.
Kubernetes-commit: 8fb423bfabe0d53934cc94c154c7da2dc3ce1332
This PR removes `DiscoveryClient` field in diff command. Because
it is not used anywhere in diff command.
Kubernetes-commit: 5fdf97ad8e3a9b7a16479a5ec4ebff3d38c55a18
This PR does some refactors for diff/prune;
- GetRESTMappings takes value array instead reference
- Move getObjectName into diff instead prune
- License, etc. changes
Kubernetes-commit: 6c449dd272c95f2aeb3bb77e67d312d8df21bd62
This PR introduces new prune and it's dependent parameters to simulate
`kubectl apply --prune` command.
Kubernetes-commit: 56c19f1056ad6d4a4bb926fe90e37f56a31c4e2f
This PR adds flagerror handler function to detect when flags are invalid.
Default flag handler returns status code 1. However, diff command embraces
this status code as changes are found. By overriding flag errors,
this PR shows same message with default case and returns status code 2.
Kubernetes-commit: 4f0848520d4cdd679c76479949546002c5935e3c
This is a result in Japanese language.
$ make test WHAT=./staging/src/k8s.io/kubectl/pkg/cmd/diff
[0402 07:24:05] Running tests without code coverage
FAIL: TestDiffProgram (0.00s)
diff_test.go:73: stdout = "ファイル /dev/zero と /dev/zero は同一です\n", expected = Files /dev/zero and /dev/zero are identical
"
FAIL
FAIL k8s.io/kubernetes/staging/src/k8s.io/kubectl/pkg/cmd/diff 0.045s
FAIL
make: *** [Makefile:184: test] エラー 1
Kubernetes-commit: 6b9ff98dd72503e0cad5c626f67c716d465d18b2
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.
This change fetches the OpenAPI schema only once.
Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
When using GNU diffutils, some commands (e.g. --color[=WHEN])
requires an equal sign.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Kubernetes-commit: 722751accf7607f4d0573778e85027c63e1802ce
Currently, if users try to use external diff command with arguments
will fail because the entire command won't be available through $PATH.
This patch allow users to use external diff tools with args (or not)
via KUBECTL_EXTERNAL_DIFF env.
Reference: https://github.com/kubernetes/kubectl/issues/937
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Kubernetes-commit: a6158c01b9add5b580059d24cb66e54c37ea2531
- 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
- 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
Running `diff -u` produces a unified diff. It isn't related to Unicode.
Also, `diff -N` treats _absent_ files as empty, not new files.
Kubernetes-commit: 0af2dedd96e973f4ed59af0cc325a70ca0b9100a