secrets-manager icon indicating copy to clipboard operation
secrets-manager copied to clipboard

shell built-in command & ksm: No such file or directory: 'source'

Open bzitzow-osh opened this issue 2 years ago • 4 comments

ksm exec -- source .my.secrests.file

Error: Cannot execute command: [Errno 2] No such file or directory: 'source'

However, when I run it directly, it does as I expect and does not throw an error.

bzitzow-osh avatar Nov 08 '23 00:11 bzitzow-osh

Hi @bzitzow-osh for reporting this issue. the source command is a built-in shell command. We are looking into the solution for this.

maksimu avatar Nov 08 '23 00:11 maksimu

in the mean time would you tell us your exact use case. What are you trying to achieve in your situation?

maksimu avatar Nov 08 '23 00:11 maksimu

If you are trying to get secrets and place them into environment variables, you could just export LOGIN=$(ksm secret get --field login XXXXXXXX)

jwalstra-keeper avatar Nov 08 '23 00:11 jwalstra-keeper

I'd like to have a file of secrets:

secrets.env

whose content is:

MY_SECRET_TOKEN=keeper://...
... etc

and I'd like to load them all into the environment:

set -a
ksm exec -- source secrets.env
set +a

bzitzow-osh avatar Nov 08 '23 00:11 bzitzow-osh