-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support exclude key on interpolation for himl #16
Comments
I can see this as a valid use case resolved right now by the flag you mentioned 'skip_interpolation_validation=True'. Can you elaborate more on your use case and why just disabling validation doesn't work? |
I see the validation as a safety net, something that must be interpolated but doesn't get interpolated due to an error should come up when running himl. On the other hand if there are some keys that you specifically don't want to interpolate (leave them as they are), here is where I would see the advantage of having an option to exclude the aforementioned key from the interpolation process. WDYT? |
Yes, validation good. |
I'm not sure what you are referring to or how hiera is tied in here. I have the following yaml file in one of the subdirectories traversed by himl slack_configs:
- channel: my-channel
text: '{{ template "__slack_text" . }}' I'm just trying to ignore the |
The issue is when using himl on a configuration that needs to be passed to a different application that is using the same format "{{"and "}}" |
Seems that what you need is to escape the key value. For example, using double quotes in |
Escaping interpolation is the keyword here, yes. Double quote vs single quote seems weak though.
|
I've only used quotes as an example on escaping values. Wanted to use something else but thought quotation would be more familiar and easy to visualize. |
Cool - makes sense |
I think we can use a similar escape sequence as in go templates:
/cc @costimuraru |
@danielcoman I tried escaping via single quotes vs double quotes. |
@ecojan Well... it's not implemented. Quotation is only used as an example.
Conclusions from this thread is that the feature needed is not a flag or a list of keys to ignore in interpolation validation, but proper escaping for values. |
Himl goes through each value and checks for "{{ interpolation.key }}".
If we want to pass the following value "{{ template custom.value }}" that can be used by an end application, interpolation will fail as
custom.value
is not found.It would be nice to have a flag or way to explicitly say a value should not be interpolated.
The only workaround for this is be setting "skip_interpolation_validation=True".
The text was updated successfully, but these errors were encountered: