https://garden.io logo
#🌱|help-and-getting-started
`--env` global option is not working in many commands
# 🌱|help-and-getting-started
f

fresh-yak-35965

06/21/2023, 3:51 PM
Copy code
Failed to resolve project configuration.
────────────────────────────────────────────────────────────────────────────────────────────────────
Unable to load Garden project found at /Users/jackhall/code/nucleus: Error: Invalid template string (${command.params.env}.scalecomputi…): Could not find key env under command.params. Available keys: (none).
Several commands including
deploy --sync
are failing due to this usage of template syntax wherein the --env option is not recognized.
https://docs.garden.io/reference/template-strings/action-all-fields#usd-environment.name This also no longer appears to be a valid key. The documentation here https://docs.garden.io/guides/namespaces suggests it can still be used but I get the following error:
Copy code
shell

garden deploy --sync --env jack.preview
Deploy πŸš€

Failed to resolve project configuration.
────────────────────────────────────────────────────────────────────────────────────────────────────


Invalid template string (${environment.name}.scalecomputing…): Could not find key environment. Available keys: command, datetime, git, local, project and secrets.
b

bright-policeman-43626

06/21/2023, 4:27 PM
I think the problem is the β€œ.” Between jack and preview, could you change it for a hyphen?
k

kind-france-89777

06/21/2023, 5:02 PM
I think that should work, though. Previously you could use β€”env to specify namespace.env. I think in bonsai it’s maybe reversed though, to env.namespace?
f

fresh-yak-35965

06/23/2023, 2:06 PM
Yeah I'm not sure that changing to hyphen will work because, as Jake points out, we rely on the . to distinguish between namespace and provider which is how we set up the domains. If this got reversed in Bonsai, then we're going to have to make a lot of changes to our manifests... But that's not really what I'm seeing here... right? It just seems like it's not picking up the key at all. In some other commands such as
config get
the --env is recognized no problem with the same
jack.preview
format.
k

kind-france-89777

06/23/2023, 3:31 PM
what config section are you trying to use ${environment.name} in?
I read the docs the same way you did, that it should still be valid in actions the same as it was in modules
b

bright-policeman-43626

06/23/2023, 4:12 PM
Oh no, it seems like it's not a problem with the --env option but rather the ${environment.name} this relates to this problem: https://discord.com/channels/817392104711651328/1121114007571546152
q

quaint-dress-831

06/23/2023, 4:31 PM
Yep, and we now have an issue up thanks to Kudu https://github.com/garden-io/garden/issues/4702
We'll try and take a look at this next week @fresh-yak-35965
@fresh-yak-35965 this is now fixed but not yet released. Hopefully we can get this out in a formal release in the next few days https://github.com/garden-io/garden/pull/4737