When calling kubel-set-context from the main kubel buffer, killing the kubel
buffer prior to asking for the new context results in the default-directory of
the prompt being the default-directory of whichever buffer takes the place of
the kubel buffer. This can cause issues if the new buffer is remote via tramp,
which can often be the case with kubel. An example workflow where this is an
issue:
Execute an action on a pod, for example opening a shell to a container
After establishing the TRAMP connection to the container, switch back to the
main kubel buffer in the same window
Invoke kubel-set-context
With the current implementation, the kubel buffer will be killed, putting the
container shell at the foreground of the window. The kubel--exec-to-string is
invoked through the TRAMP connection, and none of the existing contexts are
available for selection.
With this change, the kubel--exec-to-string is executed with the
default-directory of the existing kubel buffer, and the correct contexts will
be available.
When calling kubel-set-context from the main kubel buffer, killing the kubel buffer prior to asking for the new context results in the default-directory of the prompt being the default-directory of whichever buffer takes the place of the kubel buffer. This can cause issues if the new buffer is remote via tramp, which can often be the case with kubel. An example workflow where this is an issue:
With the current implementation, the kubel buffer will be killed, putting the container shell at the foreground of the window. The kubel--exec-to-string is invoked through the TRAMP connection, and none of the existing contexts are available for selection.
With this change, the kubel--exec-to-string is executed with the default-directory of the existing kubel buffer, and the correct contexts will be available.