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

render initial file even when template is empty #1397

Merged
merged 1 commit into from
Jul 24, 2020
Merged

Conversation

eikenb
Copy link
Contributor

@eikenb eikenb commented Jul 23, 2020

When first rendering a template to a file if the file doesn't exist and
the evaluated template is empty, it wouldn't write the file to disk. It
should always render the file to disk on successful template evaluation.

Fixes: #1393

When first rendering a template to a file if the file doesn't exist and
the evaluated template is empty, it wouldn't write the file to disk. It
should always render the file to disk on successful template evaluation.
@eikenb eikenb added the bug label Jul 23, 2020
@eikenb eikenb added this to the 0.25.1 milestone Jul 23, 2020
@eikenb eikenb requested a review from a team July 23, 2020 21:43
@eikenb
Copy link
Contributor Author

eikenb commented Jul 23, 2020

Ported this from hashicat where I had already fixed it.

Copy link
Contributor

@findkim findkim left a comment

Choose a reason for hiding this comment

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

Issue #1393 has great context to understand why this is an unexpected behavior. The changes are good and the added tests capture the cases well.

@eikenb eikenb merged commit d1f1b0d into master Jul 24, 2020
@eikenb eikenb deleted the issue-1393-empty-file branch July 24, 2020 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consul-template does not render an empty file
2 participants