k-kinzal/aliases

feat: Conditional automount at execution

k-kinzal opened this issue · 6 comments

I had a problem.

/usr/local/bin/kubectl:
  image: chatwork/kubectl
  tag: 1.11.2
  env:
    KUBECONFIG: $KUBECONFIG
  volume:
  - $HOME/.kube:/root/.kube
  - $PWD:/kube
  workdir: /kube
$ KUBECONFIG=$HOME/Downloads/kube-config.cfg kubectl config view --flatten

it does not work because it is not mounted $HOME/Downloads/kube-config.cfg.

it possible to solve this problem if it can be automatically mounted under conditions at execution.

There is a problem with conditional automount at execution.

The first problem is that multiple things are injected at execution.
Can we solve the injection of Environment Variable, command arguments, configuration file of command?
Should we support what changes with commands?

The second problem is that scripts that use are complicated.
In order to make debugging easier, I want to prevent complication of scripts.

The third problem seems to be a problem with resolution of dependency.
If there is command dependence, the execution environment will be on docker.
In this case, we can not mount because the host path is unknown.

Hope for a solution in the future

Usecases

  • Symbolic link in mount dir
  • Environment variable of FOO=bar cmd
  • Arguments of curl ... -o /path/to

We will present a provisional solution to this problem in README.md.

It closed because it derived from another issue.