hashicorp / hcat

Hashicorp Configuration and Templating library (hcat, pronounced hashicat)
Mozilla Public License 2.0
96 stars 12 forks source link

What should resolver.Run return when buffering.. error or content? #62

Open eikenb opened 3 years ago

eikenb commented 3 years ago

The ResolveEvent that is returned during buffering doesn't have the content which would otherwise always be available with the caching template (PR #59) and the error is nil. This breaks with the other return semantics where it either returns a meaningful ResolveEvent with content OR returns a empty/default ResolveEvent and an error.

This can be addressed in either direction. 1) add a method to the template to let the resolver grab the cached content and return a meaningful ResolveEvent (w/ content and NoChange=true). 2) have it return an error when buffering with the empty/default ResolveEvent (like other errors)

I'm leaning towards option 2 but am not 100% yet.