✨ cli: write diagnostics in kubectl-workspace
to stderr
#3133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
While working on https://github.com/embik/kubectl-switch-ws I noticed that
kubectl-workspace use
will always print diagnostic information (deprecation notices and warnings about unfinished API bindings), even when using--short
for inclusion in scripts / terminal prompts. There is no good way to avoid these warnings for scripts that only expect the workspace name returned as output.I would like to propose that we start writing this supplementary information to stderr, which is specifically for diagnostic information and errors. This way, scripts can avoid the warnings by using something like
kubectl workspace use --short <workspace> 2>/dev/null
to make sure you only get back the workspace name (or an exit code that isn't zero, which signals that something bad happened).There's also an old
OWNERS
file left here which I'd propose to remove.Related issue(s)
Fixes #
Release Notes