metal-stack / mini-lab

a small, virtual setup to locally run the metal-stack
MIT License
57 stars 13 forks source link

Select containerlab dependening on PATH in user context. #124

Closed fhaftmann closed 1 year ago

fhaftmann commented 1 year ago

Since containerlab is invoked through sudo, any user PATH is lost. This prevents the selection of a dedicated executable e. g. of a particular version by setting PATH accordingly.

With this commit the location of containerlab as it can be found in user context is preserved.

Leaking settings from user context to privileged contexts can always be harmful, but in this particular context with a Makefile sprinkled with various sudo invocations this does not add significant security concerns. It is definitely better than invoking sudo with --preserve-env all the time.

Gerrit91 commented 1 year ago

Unfortunately, it does not work in CI. :/

I opened another PR to fix the CI, please check if this is also feasible for you: https://github.com/metal-stack/mini-lab/pull/128