Improve templating diagnostics
Summary
Users often struggle to diagnoes templating problems. Helping them is time consuming. Everybody looses.
Instead, we log more diagnostics whenever resolution fails:
https://github.com/argoproj/argo-workflows/blob/9c901456a44501f11afc2bb1e856f0d0828fd13f/util/template/simple_template.go#L26
Several times here:
https://github.com/argoproj/argo-workflows/blob/9c901456a44501f11afc2bb1e856f0d0828fd13f/util/template/expression_template.go#L34
Use Cases
When would you use this?
Message from the maintainers:
Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.
@lambertsbennett will be working on this.
This is not being worked on.
Anyone can please guide me here, what exactly needs to be done on this?
Add some logging debug statements to that file so when the controller is started with debug logging, then the reason is shown. For example:
Change:
if err != nil && allowUnresolved {
return w.Write([]byte(fmt.Sprintf("{{%s%s}}", kindExpression, expression)))
}
To:
if err != nil && allowUnresolved {
log.WithError(err).Debug("unresolved is allowed ")
return w.Write([]byte(fmt.Sprintf("{{%s%s}}", kindExpression, expression)))
}
@alexec , I have created PR: https://github.com/argoproj/argo-workflows/pull/9533. Please take a look and suggest changes if required.
is this issue still exist or it is solved?