Starting a new thread for the issue surfaced here:
Can we validate this properly? Depending on the use case, it can be quite hard to spot unresolved template strings in K8s manifests (e.g. if they're used in env vars).
Here I'd like Garden to catch that I'm referencing an output from an action that my downstream action doesn't depend on and show me an actionable validation error—or simply create the dependency implicitly.
11/02/2023, 3:41 PM
I think we should consider disallowing partial resolution in the manifests. It's definitely quite hard to spot unresolved template strings, as multiple factors can be a reason (missing dependency, wrong syntax etc).
For context, we allow partial resolution for resolving manifests
And this might be on purpose to not throw error if manifest file has a custom string that looks like a template string but is not a Garden template string.
I think we should consider introducing a flag in config to forbid partial resolution for the manifests. So there's at least a possibility to surface the errors by setting that flag.
11/02/2023, 4:59 PM
I tend to agree.
What would be the argument for supporting it in the first place?
I can't imagine a single instance were a user would want this.
11/02/2023, 5:43 PM
@big-spring-14945 probably has some context here as we were talking about it the other day and discussing why allowPartial is even set to true in first place.
11/06/2023, 9:15 AM
I agree too. There are also more issues with the template resolution in manifests:
- The action version does not change when variables referenced only from manifest files change.
- We resolve template strings in manifest files before parsing YAML, which can lead to hard to understand error messages.
I feel like it's time to address these issues; Resolving templates in manifests is such a fundamental part of Gardens functionality, it should be rock solid.