Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/template: don't error when rendering fails in Exists #2386

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Jun 17, 2015

The Exists function can run in a context where the contents of the
template have changed, but it uses the old set of variables from the
state. This means that when the set of variables changes, rendering will
fail in Exists. This was returning an error, but really it just needs to
be treated as a scenario where the template needs re-rendering.

fixes #2344 and possibly a few other template issues floating around

@phinze phinze force-pushed the b-template-variable-change-failure branch from f4e2f32 to 62a6cca Compare June 17, 2015 20:25
@@ -87,6 +94,8 @@ func Read(d *schema.ResourceData, meta interface{}) error {
return nil
}

type TemplateRenderError error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this needs to be exported, since we only return it from a private function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I was just so excited that this was my first time using error types in Go that I wanted the whole world to see my error type! 😁

@mitchellh
Copy link
Contributor

Nitpick, but LGTM

The Exists function can run in a context where the contents of the
template have changed, but it uses the old set of variables from the
state. This means that when the set of variables changes, rendering will
fail in Exists. This was returning an error, but really it just needs to
be treated as a scenario where the template needs re-rendering.

fixes #2344 and possibly a few other template issues floating around
@phinze phinze force-pushed the b-template-variable-change-failure branch from 62a6cca to 385b17d Compare June 17, 2015 20:33
phinze added a commit that referenced this pull request Jun 17, 2015
…ilure

provider/template: don't error when rendering fails in Exists
@phinze phinze merged commit 5e86e70 into master Jun 17, 2015
@phinze phinze deleted the b-template-variable-change-failure branch June 17, 2015 20:36
@ghost
Copy link

ghost commented May 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't change template_file vars with remote state
2 participants