wide-flag-41451
06/21/2023, 4:26 PMyaml
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'
I have just recently updated to the latest release of garden and this previously worked with Modules.
My file structure looks like the following:
secrets/
  garden.yaml <-- file where module / action was defined
  secrets.local.yaml
I notice when i run garden deploy it says the following :
ℹ garden               → Running in Garden environment local.aashelt
which is because I think i have this setup in my environment configuration in my project.yaml
yaml
  - name: local
    defaultNamespace: ${local.username}
    variables:
      defaultHostname: ${project.name}.${local.username}.local.app.garden
      replicas: 1
      cpu: 100m
      mem: 1Gi
      volumeSize: 5Gi
      storageClass: ""
      cluster: ""
      timestamp: ""
so should the environment name resolve to "local"? or "local.aashelt" ? I ended up changing my file to match that and i received the same error, its like its not interpolating the template.
Heres the old Module that worked before:
yaml
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
Not sure what other information to provide but if theres anything else i need to provide let me know.wide-flag-41451
06/21/2023, 5:46 PMquaint-dress-831
06/22/2023, 8:51 AM${environment.name} should be just the bare environment name declared in your project.garden.yml, in this case local. can you try for testing purposes replace ${environment.name} with the current path to the secret file you're trying to deploy? So secrets.local.yaml?wide-flag-41451
06/22/2023, 2:14 PMquaint-dress-831
06/22/2023, 2:30 PMwide-flag-41451
06/22/2023, 2:34 PMquaint-dress-831
06/22/2023, 2:35 PM$forEach:?wide-flag-41451
06/22/2023, 2:36 PMwide-flag-41451
06/22/2023, 2:36 PMwide-flag-41451
06/22/2023, 2:37 PMwide-flag-41451
06/22/2023, 2:37 PMwide-flag-41451
06/22/2023, 2:37 PMquaint-dress-831
06/22/2023, 2:43 PMdeploy again with the log level turned up?quaint-dress-831
06/22/2023, 2:43 PMgarden deploy -l5quaint-dress-831
06/22/2023, 2:45 PMsecrets.["${environment.name}"].yaml pleasewide-flag-41451
06/22/2023, 2:56 PMwide-flag-41451
06/22/2023, 3:03 PMwide-flag-41451
06/22/2023, 3:05 PMwide-flag-41451
06/22/2023, 3:05 PMwide-flag-41451
06/22/2023, 3:05 PMquaint-dress-831
06/22/2023, 3:06 PMwide-flag-41451
06/22/2023, 3:09 PM[2023-06-22T15:02:15.350Z] TreeCache: Setting value for key ["source","/Users/aashelt/repos/test99/frontend","exclude","dba27c31aa"]
[2023-06-22T15:02:15.368Z] Tracking Command Result event.
Payload:
  {"anonymousId":"1bc2b1d8-3fbc-40c5-a878-412a9b01dfcb","event":"Command Result","properties":{"projectId":"9a09885ca050300e637b0723f13ac5beaf831346d291731db1ec09a74b17139148e5f772a38ccafd98fb06c08e1422ad4c05dcc1c2edf0cddbc9dd0d32fdfaa3","projectIdV2":"torpid-infamous-member_9a09885ca050300e637b0723f13ac5be","projectName":"46fc4af214c25f3189a4553634781b089aef502e813d69d7b15b86878dd6170123525459b40b34c1feb7ad5073a4feef74ca8d9b285d8cec1bb9fe6ee69b86f3","projectNameV2":"quizzical-meek-phase_46fc4af214c25f3189a4553634781b08","enterpriseDomain":"2769c2abae62151b2ebb8658628f7c5f5d0dc0c29fdefdd19a23dec9cb0a7b96d74d82512d1f6906bef65b24a29d84685dfd2fd66964a56fbdaff39fabd69206","enterpriseDomainV2":"ratty-willing-science_2769c2abae62151b2ebb8658628f7c5f","isLoggedIn":false,"ciName":null,"system":{"platform":"darwin","platformVersion":"22.4.0","gardenVersion":"0.13.3"},"isCI":false,"sessionId":"8526d113-07c6-48e1-9b62-d3a9ba330f36","parentSessionId":"8526d113-07c6-48e1-9b62-d3a9ba330f36","projectMetadata":{"modulesCount":0,"moduleTypes":[],"tasksCount":0,"servicesCount":0,"testsCount":0,"actionsCount":13,"buildActionCount":3,"testActionCount":0,"deployActionCount":10,"runActionCount":0},"firstRunAt":"2023-03-21T19:43:33.000Z","latestRunAt":"2023-06-22T15:02:12.911Z","isRecurringUser":true,"name":"deploy","durationMsec":1547,"result":"failure","errors":["configuration"],"exitCode":1}}
[2023-06-22T15:02:15.394Z] 
Error processing config for Deploy action secrets:
Could not find varfile at path 'secrets.["${environment.name}"].yaml'
[2023-06-22T15:02:15.400Z] Error: 
Error processing config for Deploy action secrets:
Could not find varfile at path 'secrets.["${environment.name}"].yaml'
    at /snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/graph/actions.ts:163:13
Error Details:
config:
  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}"].yamlquaint-dress-831
06/22/2023, 3:10 PMwide-flag-41451
06/22/2023, 3:10 PMwide-flag-41451
06/22/2023, 3:10 PMquaint-dress-831
06/22/2023, 3:11 PMwide-flag-41451
06/22/2023, 3:11 PMquaint-dress-831
06/22/2023, 3:12 PMvarfile: "secrets.\$\{environment.name\}.yamlwide-flag-41451
06/22/2023, 3:12 PMquaint-dress-831
06/22/2023, 3:12 PMquaint-dress-831
06/22/2023, 3:12 PMwide-flag-41451
06/22/2023, 3:13 PMquaint-dress-831
06/22/2023, 3:13 PMwide-flag-41451
06/22/2023, 3:13 PMquaint-dress-831
06/23/2023, 4:14 PMquaint-dress-831
06/23/2023, 4:15 PMwide-flag-41451
06/23/2023, 4:19 PMwide-flag-41451
06/23/2023, 4:20 PMquaint-dress-831
06/23/2023, 4:30 PMwide-flag-41451
06/23/2023, 4:30 PMwide-flag-41451
06/23/2023, 4:30 PMwide-flag-41451
06/23/2023, 4:32 PMwide-flag-41451
06/23/2023, 4:32 PMquaint-dress-831
06/23/2023, 4:33 PMwide-flag-41451
06/23/2023, 4:33 PMquaint-dress-831
06/23/2023, 4:33 PMquaint-dress-831
06/23/2023, 4:33 PMmy-pulumi-action is one I usewide-flag-41451
06/23/2023, 4:33 PMwide-flag-41451
06/23/2023, 4:34 PMwide-flag-41451
06/23/2023, 4:34 PMwide-flag-41451
06/23/2023, 4:35 PMwide-flag-41451
06/23/2023, 4:35 PMquaint-dress-831
07/03/2023, 3:24 PM