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

"hashes.join is not a function" when using a variable in an include field #2853

Closed
eysi09 opened this issue Mar 17, 2022 · 1 comment
Closed
Labels

Comments

@eysi09
Copy link
Collaborator

eysi09 commented Mar 17, 2022

Bug

Current Behavior

I have the following config:

kind: Module
type: exec
name: variables
variables:
  includes: ["foo", "bar"]
# ...

---

kind: Module
type: container
name: image
include: ${modules.variables.var.includes} 
# ...
---

kind: Module
type: kubernetes
name: service
build:
  dependencies: [image]
# ...  

When I run garden build image I get the following error:

Failed resolving one or more modules:

service: hashes.join is not a function

So resolving the service module fails when attempting to build the image module.

Looks like this is the offending piece of code: https://github.com/garden-io/garden/blob/master/core/src/vcs/vcs.ts#L322

When logging the output I see that the value we're attempting to join is the following string:

"${modules.variables.var.includes}"

...as opposed to an array.

So clearly the value hasn't been resolved yet and is causing issues when resolving a down stream dependency.

Reproducible example

See above.

Workaround

Do not use variables in include and instead hard code (or use project level variables, haven't tried).

@eysi09 eysi09 added the bug label Mar 17, 2022
@vvagaytsev
Copy link
Collaborator

@eysi09 it looks like this was fixed in 0.12.41. I reproduced it with 0.12.40, but 0.12.41 worked fine. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants