teller icon indicating copy to clipboard operation
teller copied to clipboard

Provider request - parent_process_env

Open kevbook opened this issue 2 years ago • 5 comments

New Provider Request

Instead of carry_env option, we should have a parent_process_env provider. So we can selectively load up parent process env vars as needed. It would also allow renaming the field/variable as needed.

It's very useful if we need to run a docker container:

$ docker run --rm -it --env-file <(teller env) alpine sh

// Should also will populate the following for various use-cases:
$ teller show
$ teller json
$ teller yaml
providers:
  parent_process_env:
    env:
      GIT_SHA:

Details

  • Name: parent_process_env
  • Modes: read

kevbook avatar Jul 09 '22 02:07 kevbook

Hey @kevbook, just to make sure that i understand your case, Your suggestion is allow Teller to read parent environment variable like this example:

export SECRET-KEY=<secret value>

and the .teller.yaml file config will look like:

providers:
  parent_process_env:
    env:
      telelr-secret-key: SECRET-KEY

kaplanelad avatar Jul 17 '22 08:07 kaplanelad

@kaplanelad Yes.

ps. We should also get rid of the carry_env option, seems very opinioned on how it handles $HOME, and exposes the entire set of keys from the parent.

kevbook avatar Jul 18 '22 14:07 kevbook

@kevbook We discussed on your feature internally, and it looks like a great idea. Do you want to create a pull request with the new provider? I can assist you if you need to

kaplanelad avatar Jul 26 '22 10:07 kaplanelad

Absolutely, I’ll take a stab this weekend. What do you want to call it, I’m open to whatever you suggest

kevbook avatar Jul 28 '22 15:07 kevbook

Amazing, you can take a look k in this doc, which Champlain how to add a new provider. I'm available for open questions that you have and also in slack (I'll give you the name later).

I think proccess_env/env_vars will be good.

kaplanelad avatar Jul 28 '22 17:07 kaplanelad

@kevbook the provider release in version 1.5.5. thanks for your contribution

kaplanelad avatar Sep 04 '22 08:09 kaplanelad