-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Description
See https://github.com/ro0NL/sf-env (6.1)
An issue occurs when using %env(resolve:ENV)%
, when ENV
contains a nested %env(INNER)%
. The nested env is loaded from parameters, not real envs.
So given
TEST_ENV_INNER='im defined in .env'
TEST_ENV="pre [%env(TEST_ENV_INNER)%] post"
parameters:
env(TEST_ENV_INNER): 'im defined in services.yaml'
services:
_defaults:
bind:
'string $testEnvValue': '%env(resolve:TEST_ENV)%'
Then running
$ bin/console test
^ "pre [im defined in services.yaml] post"
Expected is pre [im defined in .env] post
Now running TEST_ENV_INNER=real bin/console test
produces the same output, whereas pre [real] post
is expected
We found a hackish workaround using env(INNER): '%env(INNER)%'
, but this should probably happen out-of-the-box ... as this is a circular reference IMHO.
Example
No response