garden icon indicating copy to clipboard operation
garden copied to clipboard

0.13: [Bug]: Garden throws invalid template string error for missing secrets if wrong env is specified

Open shumailxyz opened this issue 1 year ago • 0 comments

Garden Bonsai (0.13) Bug

Current Behavior

This is more of a Devex issue as it's not a bug. When using Garden cloud, specifying a wrong env name by mistake in garden command results in Invalid template string error for secrets. e.g.

$ garden validate  --env missingenv
Validate ✔️

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


Invalid template string (${secrets.FOO}): Could not find key FOO under secrets. Available keys: (none).

Looks like no secrets have been created for this project and/or environment in Garden Cloud. To create secrets, please visit <url> and navigate to the secrets section for this project.

Took me a while to realize that i am specifying the wrong environment name.

Expected behavior

Garden should rather inform me that this environment is not available or throw an error that env name is wrong.

Reproducible example

  • Use Garden Cloud
  • Define a secret for an environment (so secret is actually existing)
  • Run garden validate --env missingenv

Suggested solution(s)

Before fetching secrets, make sure that env is a valid environment.

Additional context

Your environment

  • OS:
  • How I'm running Kubernetes:

garden version garden version: 0.13.12

shumailxyz avatar Aug 30 '23 16:08 shumailxyz