garden icon indicating copy to clipboard operation
garden copied to clipboard

Disabled modules still expect to have modules variables defined

Open idoshamun opened this issue 1 year ago • 2 comments

Bug

Current Behavior

When setting disabled: true on a module level, the CLI throws an error if a module variable is not defined properly.

Expected behavior

Ignore the module altogether when it's disabled.

Reproducible example

Workaround

Set defaults for the variables

Suggested solution(s)

Additional context

Your environment

  • OS: macOS
  • How I'm running Kubernetes: docker desktop

garden version: 0.12.44

idoshamun avatar Aug 25 '22 06:08 idoshamun

Thanks for raising this @idoshamun! By the way, what do you mean by "variable not defined properly"? Do you mean a template string in the module variables that can’t be resolved? E.g., a template string that uses a variable only defined in the environment where the module is enabled.

It would be very helpful if you can share an example configuration to reproduce it.

vvagaytsev avatar Aug 25 '22 11:08 vvagaytsev

Do you mean a template string in the module variables that can’t be resolved?

Yes, exactly this.

It would be very helpful if you can share an example configuration to reproduce it.

Might be able to do it in the weekend :)

idoshamun avatar Aug 25 '22 15:08 idoshamun

This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Jan 07 '23 22:01 stale[bot]

Hi @idoshamun, i know this reply comes fairly late but still wanted to let you know that this issue has been solved in Garden >=0.13.x with the new action configuration. See here for more info on how to use actions instead of modules: https://docs.garden.io/using-garden/actions

twelvemo avatar Oct 13 '23 12:10 twelvemo

Closing as already solved in 0.13, thanks for confirming this @twelvemo!

vvagaytsev avatar Oct 27 '23 15:10 vvagaytsev