Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

${environment.name} is not interpolated appropriately on deploy action #4702

Closed
KoduIsGreat opened this issue Jun 23, 2023 · 2 comments · Fixed by #4737
Closed

${environment.name} is not interpolated appropriately on deploy action #4702

KoduIsGreat opened this issue Jun 23, 2023 · 2 comments · Fixed by #4737
Assignees

Comments

@KoduIsGreat
Copy link

KoduIsGreat commented Jun 23, 2023

Bug

I have the following Deploy action that sets up some kubernetes secrets that utilizes ${environment.name} to select the correct varfile to merge into the deployment but it does not work. Note previously this worked with Modules Here is an example of the Module that worked before

kind: Module
name: secrets
type: kubernetes
manifests:
  $forEach: ${var.secrets}
  $return:
    apiVersion: v1
    kind: Secret
    metadata:
      name: ${item.key}
    type: Opaque
    stringData:
      $merge: ${item.value}
varfile: secrets.${environment.name}.yaml

Current Behavior

kind: Deploy
name: secrets
type: kubernetes
spec:
  manifests:
    $forEach: ${var.secrets}
    $return:
      apiVersion: v1
      kind: Secret
      metadata:
        name: ${item.key}
      type: Opaque
      stringData:
        $merge: ${item.value}
varfiles: 
  - ./secrets.${environment.name}.yaml

I get the following error when I run garden deploy

Error processing config for Deploy action secrets:
Could not find varfile at path './secrets.${environment.name}.yaml'

If i hard code it to the environment e.g. "local" it works.

Expected behavior

It should interpolate the environment name as part of the filepath

Reproducible example

git clone https://github.com/KoduIsGreat/garden-bug
cd to garden-bug
garden deploy -l5

Workaround

N/a

Suggested solution(s)

Additional context

Discussed this in discord with worldofgeese

Your environment

  • OS: M1 Mac OS Monteray
  • I'm using kind for kubernetes

garden version: 0.13.3

@worldofgeese worldofgeese moved this to Candidate in Core Weekly Jun 23, 2023
@worldofgeese
Copy link
Contributor

worldofgeese commented Jun 23, 2023

To the triage team: we've had two community posts on just this issue this week 👀 . Our Discord has more on this issue.

@vvagaytsev vvagaytsev moved this from Candidate to Todo in Core Weekly Jun 26, 2023
@haljac
Copy link

haljac commented Jun 26, 2023

To add some context, I experienced this issue using the following:

kind: Project
...
variables:
  baseHostName: ${command.params.env}.scalecomputing.dev

This led me to believe it was the --env flag specifically.

@vvagaytsev vvagaytsev moved this from Todo to In Progress in Core Weekly Jul 3, 2023
@shumailxyz shumailxyz moved this from In Progress to Done in Core Weekly Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants