plain-pizza-51556
10/07/2024, 7:40 PMproject.garden.yml
I have :
Yaml
variables:
source-branch: ${lower(slice(camelCase(git.branch), 0, 32))}
environments:
- name: preview
defaultNamespace: pr-${var.source-branch}
When I run the command garden deploy --env preview --var source-branch=2215
the namespace name uses the default variable, not the one defined in the command.
What am I doing wrong?
Thanks for your helpchilly-gigabyte-83853
10/08/2024, 1:21 PMgarden get config
you'll see, under the variable
the correct value (passed via the CLI) but the defaultNamespace
somehows seems to get the default one.chilly-gigabyte-83853
10/08/2024, 1:21 PMchilly-gigabyte-83853
10/08/2024, 1:26 PMvariables:
source-branch: ${local.env.SOURCE_BRANCH_OVERRIDE || lower(slice(camelCase(git.branch), 0, 32))}
environments:
- name: preview
defaultNamespace: pr-${var.source-branch}
And you could run something like:
SOURCE_BRANCH_OVERRIDE=2215 garden deploy --env preview
instead.chilly-gigabyte-83853
10/08/2024, 1:28 PMplain-pizza-51556
10/09/2024, 8:38 AMplain-pizza-51556
10/09/2024, 8:58 AM