I created a function with a tokes argument defined as an array of *dagger.Secret. I can call the function like dagger call foo --tokens=env://TOKEN1 --tokens=env://TOKEN2 but I want to set the default value for tokens in a .env and can't seem to get it to work. Should this be possible? If so can you give a simple example of how the argument looks in the .env file?
#How to set array of dagger.Secret in .env
1 messages · Page 1 of 1 (latest)
I don't think that's supported for .env files but should be straightforward to implement if we agree on the format.
the biggest part if changing this file https://github.com/dagger/dagger/blob/295d37563182250ae9ebe470c7eeadd5f4d624c7/core/dotenv/dotenv.go?plain=1#L231 so it returns a slice of key values instead of map
I think I personally also like being able to do something like:
FOO_ARG=bar
FOO_ARG=baz
FOO_ARG=bar,baz should also work since that works via arguments also
Are you describing a Dagger enhancement or a workaround that I could implement?
a Dagger change. Unfortunately there's no workaround for the .env file currently
no worries. I appreciate getting a timely answer.
working on this today