Matches same behavior as for kubectl apply
Signed-off-by: Daniel Lenar <dlenar@vailsys.com>
Kubernetes-commit: d53af227870a8e4434a0bf2f58770ec4dbec241f
* Wire generic context to better handle timeout
* Add integration test for wait timeout
* kubectl wait: Fix integration test always passing issue
Currently, `kubectl wait` integration test always passes even if
it gets an error. Problem is object check is done after errexit is
turned off.
This PR redirects error to output and correctly assures that
object is expected status and if it is not, test should fail.
Kubernetes-commit: 369534c6ec625ed9b251b453215c9578cdeb59bc
`rollout restart` command calculates patches according to the
`kubectl.kubernetes.io/restartedAt` annotation whose time format is
RFC3339. That is sufficient for users. However, if automated scripts
execute `rollout restart` in multiple times within second, commands fails
by returning an error "empty patch".
This PR changes error message to more descriptive format to warn users
that rollout restart does not work subsequent execution within second.
Kubernetes-commit: fb3d9e3ac9d244047efa411e9e6ae162692ad79e
Currently, if user executes `kubectl scale --dry-run`, output has no
indicator showing that this is not applied in reality.
This PR adds dry run suffix to the output as well as more integration
tests to verify it.
Kubernetes-commit: 76ee3788ccbac9003e3f24de9000ebd91c27611f
`kubectl scale` calls visitor two times. Second call fails when
the piped input is passed by returning an
`error: no objects passed to scale` error.
This PR uses the result of first visitor and fixes that piped
input problem. In addition to that, this PR also adds new
scale test to verify.
Kubernetes-commit: 13be899b422a1f68c38e3a9c9d88831db709a32d
`kubectl exec` command supports getting files as inputs. However,
if the file contains multiple resources, it returns unclear error message;
`cannot attach to *v1.List: selector for *v1.List not implemented`.
Since `exec` command does not support multi resources, this PR
handles that and returns descriptive error message earlier.
Kubernetes-commit: 832644f0b38d536be7a5adce9bc62b0902710091
Change i18n.T() to load translations if they have not yet been loaded.
Added new integration tests to test help output translation.
Kubernetes-commit: c0dea5e31af856ed96b8257b5caa952161c8a05b
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
* Add RedactSecrets function
* Move RedactSecrets method to existing RawBytesData case
* Update TestRedactSecrets to use new pattern of os.CreateTemp()
Kubernetes-commit: e721272d10dd6c4d85ff613182ba0eaddcec9272
Cobra provides support for completion descriptions for bash.
It was turned off because of a bug with certain bash menu options which
have been fixed by Cobra 1.3.0.
Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
Kubernetes-commit: d72926d4915133550e41de1252fe2a4aa0aa3745
The --cascade flag, has no practical effect when used, so it is being deprecated.
The following flags, which are unused and ignored by kubectl run,
have been deprecated:
--filename
--force
--grace-period
--kustomize
--recursive
--timeout
--wait
Kubernetes-commit: 09804a198c64f0a738ede28e0b2cb045d16980fc