You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I've encountered a problem (which has a workaround - just install kubectl globally on the system), with which I'm asking for a bit of help.
Direnv - is a tool for specifying environment (variables) for a directory and automatically setting them up when visiting / working in the directory.
With Nix it's possible to have specific binary dependencies loaded to PATH only when working with specific directory, so for example "kubectl" can have a specific pinned version and only active when I'm working with "~/Documents/work/project-a"
When I try to call (kubel) from buffer that has envrc environment setup to include "kubectl" on it's path I get buffer with error /bin/bash: kubectl: command not found
If I check buffer with commands that kubel trying to execute with $, I can see for example command: kubectl --context gke_develop -n pre-staging get services
and if I copy that command and execute with M-& in the *kubel (pre-staging)* buffer, I get output from kubectl - so async-shell-command has access to the correct environment when executed from kubel buffer
I've checked Troubleshooting section of "envrc" and it says:
If you find that a particular Emacs command isn't picking up the environment of your current buffer, and you're sure that envrc-mode is active in that buffer, then it's possible you've found code that runs a process in a temp buffer and neglects to propagate your environment to that buffer before doing so.
The inheritenv package was designed to handle this case in general.
Checking inheritenv command/marcos documentation - it's there to be used as a wrapper around sexp to make sure that it sees same environment as buffer that evaluates it, and also propagating environment to temporary buffers that could be created by the code.
I've tried to eval expression (inheritenv (kubel)) from the buffer where "kubectl" should be present and kubel seems to work - initial screen loads correctly.
Only if I try to change namespace or access logs, I get same error again "kubectl: command not found".
I suppose one way to try and solve this on user side is to wrap / advice whatever possible in inheritenv, maybe that would make things work.
And maybe someone would understand inner workings better and give me advice on how to maybe prepare an MR that would allow direnv integration?
Kubernetes-el doesn't work for me for magit-section problems with Doom Emacs, but it seems to pick up "kubectl" from direnv environment, so maybe it's not something that's hard to do for those who know where to look
The text was updated successfully, but these errors were encountered:
efim
pushed a commit
to efim/dotfiles
that referenced
this issue
Jun 25, 2022
Hello!
I've encountered a problem (which has a workaround - just install kubectl globally on the system), with which I'm asking for a bit of help.
Direnv - is a tool for specifying environment (variables) for a directory and automatically setting them up when visiting / working in the directory.
With Nix it's possible to have specific binary dependencies loaded to PATH only when working with specific directory, so for example "kubectl" can have a specific pinned version and only active when I'm working with "~/Documents/work/project-a"
There's emacs integration packages "envrc.el" and "direnv.el"
When I try to call
(kubel)
from buffer that has envrc environment setup to include "kubectl" on it's path I get buffer with error/bin/bash: kubectl: command not found
If I check buffer with commands that
kubel
trying to execute with$
, I can see for examplecommand: kubectl --context gke_develop -n pre-staging get services
and if I copy that command and execute with
M-&
in the*kubel (pre-staging)*
buffer, I get output from kubectl - soasync-shell-command
has access to the correct environment when executed from kubel bufferI've checked Troubleshooting section of "envrc" and it says:
Checking
inheritenv
command/marcos documentation - it's there to be used as a wrapper around sexp to make sure that it sees same environment as buffer that evaluates it, and also propagating environment to temporary buffers that could be created by the code.I've tried to eval expression
(inheritenv (kubel))
from the buffer where "kubectl" should be present andkubel
seems to work - initial screen loads correctly.Only if I try to change namespace or access logs, I get same error again "kubectl: command not found".
I suppose one way to try and solve this on user side is to wrap / advice whatever possible in
inheritenv
, maybe that would make things work.And maybe someone would understand inner workings better and give me advice on how to maybe prepare an MR that would allow direnv integration?
Kubernetes-el doesn't work for me for
magit-section
problems with Doom Emacs, but it seems to pick up "kubectl" from direnv environment, so maybe it's not something that's hard to do for those who know where to lookThe text was updated successfully, but these errors were encountered: