Skip to content

Commit

Permalink
avoid showing errors when vault token is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
manveru committed Jul 29, 2021
1 parent 9d0e821 commit 388bc9a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .envrc
Expand Up @@ -3,5 +3,9 @@ watch_file flake.lock
mkdir -p "$(direnv_layout_dir)"
eval "$(nix print-dev-env --profile "$(direnv_layout_dir)/flake-profile")"

export NOMAD_TOKEN="$(vault read -field secret_id nomad/creds/developer)"
export CONSUL_HTTP_TOKEN="$(vault read -field token consul/creds/developer)"
if vault lookup token &> /dev/null; then
NOMAD_TOKEN="$(vault read -field secret_id nomad/creds/developer)"
CONSUL_HTTP_TOKEN="$(vault read -field token consul/creds/developer)"
export NOMAD_TOKEN
export CONSUL_HTTP_TOKEN
fi

0 comments on commit 388bc9a

Please sign in to comment.