bright-policeman-43626
05/21/2024, 5:18 AMkind: Project
name: project
defaultEnvironment: local
dotIgnoreFile: .gitignore
variables:
user-namespace: local-env
base-hostname: local.app.garden
# Globally usable
RABBIT_URL: amqp://rabbitmq:5672
REDIS_URL: redis://redis:6379
And then I was able to reference it from any kind of resource; tasks, helm deployment, etc.
Example:
tasks:
- name: migrations
command: [/bin/sh, -c]
args: ["npm run migrations:up"]
env:
RABBIT_URL: ${var.RABBIT_URL}
REDIS_URL: ${var.REDIS_URL}
Now Garden detects them as circular references when I use it in Run actions for example.
kind: Run
name: migrations
type: container
spec:
image: ${actions.build.api-image.outputs.deploymentImageId}
command: [npm, run, migrations:up]
variables:
RABBIT_URL: ${var.RABBIT_URL} # This gets detected as as circular dependency
REDIS_URL: ${var.REDIS_URL}
Error:
Invalid template string (${var.RABBIT_URL}) at path RABBIT_URL: Invalid template string (${var.RABBIT_URL}): Circular reference detected when resolving key var.RABBIT_URL (var.RABBIT_URL)
This is definitely a bad experience because now I need to basically repeat the values in multiple spots or name the variables differently, which makes it incompatible with my 0.12 modules that I get as remote sources...bright-policeman-43626
05/21/2024, 5:19 AMbright-policeman-43626
05/21/2024, 5:23 AMbright-policeman-43626
05/21/2024, 7:13 AMFailed resolving one or more modules:
api-image: Invalid template string (${var.RABBIT_URL}) at path spec.tasks.0.env.RABBIT_URL: Could not find key RABBIT_URL u