Partial resolution for manifests
# 💻|contributing
b
Starting a new thread for the issue surfaced here: https://discord.com/channels/817392104711651328/1169365561302597813/1169389901800816761 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.
a
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 https://github.com/garden-io/garden/blob/main/core/src/plugins/kubernetes/kubernetes-type/common.ts#L428 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. WDYT?
b
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.
a
@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.
b
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.