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

Fix validate command for config files in consul 1.0.0 #377

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

Faffnir
Copy link

@Faffnir Faffnir commented Oct 27, 2017

The consul validate command has a problem with using files which do not end in .json or .hcl which is the fact when using validate_cmd which uses a temporary file and puppet adds a tmp-specific string. This solution is kind of an ugly workaround which produces a tmp link file with the correct name and leaves it in /tmp. After the check this link will become invalid and there are no security issues.

The consul maintainers are discussing about a better solution here hashicorp/consul#3620 but we need a solution right now and that fixed it for us. This could maybe be removed after consul adds a fix for this issue.

The consul validate command has a problem with using files which do not end in .json or .hcl which is the fact when using validate_cmd which uses a temporary file and puppet adds a tmp-specific string. This solution is kind of an ugly workaround which produces a tmp link file with the correct name and leaves it in /tmp. After the check this link will become invalid and there are no security issues.
@Faffnir
Copy link
Author

Faffnir commented Oct 27, 2017

This would fix Issue 376

@solarkennedy solarkennedy merged commit 2e17c06 into voxpupuli:master Oct 27, 2017
@solarkennedy
Copy link
Contributor

I would also be OK if we gave up trying to do client-side validation like this.

@Faffnir
Copy link
Author

Faffnir commented Nov 13, 2017

And you are actually right in suggesting this because I just found out that I introduced a nasty bug as it is now not possible to update the consul config without getting an error in puppet.
Should I just create a new PR with excluding the check totally @solarkennedy ?

@solarkennedy
Copy link
Contributor

Yea. I think it was a good thought, but a tad expensive and error prone.

spuder pushed a commit to spuder/puppet-consul that referenced this pull request Feb 25, 2020
Fix validate command for config files in consul 1.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants