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

No custom lookup function allowed #162

Closed
tuxmea opened this issue Jun 16, 2023 · 2 comments · Fixed by #165
Closed

No custom lookup function allowed #162

tuxmea opened this issue Jun 16, 2023 · 2 comments · Fixed by #165
Labels
bug Something isn't working

Comments

@tuxmea
Copy link
Member

tuxmea commented Jun 16, 2023

We have a customer who has a self written puppet lookup function: puppet_function_lookup_key
HDM does show error 500 when we select a node.

I already found app/models/hiera_data/hierarchy.rb has a mapping of functions and return yaml, json or eyaml. In this case we should use eyaml.

Is this possible to achieve?

@tuxmea tuxmea added the bug Something isn't working label Jun 16, 2023
@oneiros
Copy link
Collaborator

oneiros commented Jun 20, 2023

I am not sure how and if hdm can solve this. From what I gather, I custom lookup functions means that someone is using a fully custom backend, which (from hdm's point of view) could be anything.

And of course hardcoding this one instance to mean eyaml makes no sense, as it might mean something completely different for another user (especially since the name is very generic).

The only thing I can imagine right now, is that we add a configuration option in config/hdm.yaml where one can map custom lookup functions to existing backends. Something like:

custom_lookup_function_mapping:
   puppet_function_lookup_key: eyaml

@tuxmea
Copy link
Member Author

tuxmea commented Jul 5, 2023

Please implement using the solution you described.

oneiros added a commit that referenced this issue Jul 5, 2023
We do not (and cannot support) custom lookup functions per se,
but in case they map cleanly to an existing backing, e.g. eyaml,
this allows to specify this mapping, so everything should then
work as expected.
tuxmea added a commit that referenced this issue Aug 10, 2023
* Upgrade dependencies.

Latest security fixes for rails plus a bunch of
minor updates.

* Allow custom lookup functions #162

We do not (and cannot support) custom lookup functions per se,
but in case they map cleanly to an existing backing, e.g. eyaml,
this allows to specify this mapping, so everything should then
work as expected.

---------

Co-authored-by: Martin Alfke <tuxmea@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants