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.
Overview
This pull request:
Summary
Kubectl does not support "shell scripting"; simple prepending
cd
before the command to be executed won´t work. Kubectl also does not provide an option to set the working dir (like docker).This PR wraps the command to be executed in a subshell while delaying the prepending of the
cd
to the very last (moved to::wrap()
).To prevent wrapping all calls in a subshell/cd this PR also introduces a new option kubectl.cd_root. When set to false, and the requested cd matches the site alias root, the command is not wrapped in the subshell and no
cd
call is added.Description
Any additional information.