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 consul templates using task env only #6055

Merged
merged 2 commits into from
Aug 5, 2019

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Aug 1, 2019

When rendering a task consul template, ensure that only task environment
variables are used.

Currently, consul-template always falls back to host process
environment variables when key isn't a task env var[1]. Thus, we add
an empty entry for each host process env-var not found in task env-vars.

[1] https://github.com/hashicorp/consul-template/blob/bfa5d0e133688920afd1e012404f765182e3d5e0/template/funcs.go#L61-L75

When rendering a task consul template, ensure that only task environment
variables are used.

Currently, `consul-template` always falls back to host process
environment variables when key isn't a task env var[1].  Thus, we add
an empty entry for each host process env-var not found in task env-vars.

[1] https://github.com/hashicorp/consul-template/blob/bfa5d0e133688920afd1e012404f765182e3d5e0/template/funcs.go#L61-L75
@notnoop notnoop force-pushed the b-template-env-no-host-process branch from 8db90fc to a647da2 Compare August 1, 2019 11:00
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Great workaround @notnoop! Sorry I misunderstood it on a first pass.

I'd prefer this get fixed upstream in consul-template, but this is probably the route we'll need to go in the short term.

@tgross tgross merged commit b6ae5e9 into master Aug 5, 2019
tgross pushed a commit that referenced this pull request Aug 6, 2019
When rendering a task consul template, ensure that only task environment
variables are used.

Currently, `consul-template` always falls back to host process
environment variables when key isn't a task env var[1].  Thus, we add
an empty entry for each host process env-var not found in task env-vars.

[1] https://github.com/hashicorp/consul-template/blob/bfa5d0e133688920afd1e012404f765182e3d5e0/template/funcs.go#L61-L75
tgross added a commit that referenced this pull request Aug 8, 2019
@tgross tgross added this to the 0.9.5 milestone Aug 8, 2019
@tgross
Copy link
Member

tgross commented Aug 8, 2019

Added to 0.9.5 changelog in 3f21a3e

@notnoop notnoop deleted the b-template-env-no-host-process branch August 13, 2019 14:51
notnoop pushed a commit that referenced this pull request Sep 18, 2019
@github-actions
Copy link

github-actions bot commented Feb 5, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2023
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.

3 participants