-
Notifications
You must be signed in to change notification settings - Fork 38
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
Template merge functionality #493
Comments
If you aren't merging child elements of the dict keys then if you want to add one extra counter into your custom template you'd have to copy the whole contents of the counters dict again which is essentially back to the same issue of redefining the entire template, unless I'm reading it wrong? For example above the post merge Lun.yaml loses important value mappings from the plugins dict being overwritten, if it's the default you'd want that merged with the custom template instead. |
Intention of not merging child element is to avoid confusion where one would have to think about final merged template. If we go with child merging as well, we can build a cli to show the final merged template for debugging purpose. |
It would be definitely easier without child merging to avoid confusion but need to figure out the templating use case where you want the majority of the default template but want to add an extra counter and export a new label for example, without merging that requires copying most of the existing template, which then creates issues if the default template gets upgraded and we are back to square one. |
thanks for clarifying @hashi825 - rahul and I discussed yesterday and agree that we need better support for the use-cases you mentioned above: adding counter, export new label, etc. He's working a PR that satisfies those cases as well as supporting the overwriting use-cases. stay tuned |
|
* feat: Template docs Fixes #493 Co-authored-by: Chris Grindstaff <[email protected]>
Verified, commit:
|
For this discussion purpose
default template
is lun.yaml andcustom template
is custom_lun.yamlCurrent behaviour of custom template creation is documented at https://github.com/NetApp/harvest/blob/main/cmd/collectors/zapiperf/README.md#creatingediting-subtemplates
This approach requires copying all contents from default and then modify the custom template. This only supports complete overwrite of default templates. There are problems with this approach.
Proposed Change in Functionality:
Proposed solution intend to only change when object key defined in default.yaml and custom.yaml are same.
Solution is to overwrite top level parameters defined in custom template. All other params should be taken from default template.
Definition of top level parameters:
name,query,object,counters,plugins,export_options are the top level elements in below example.
lun.yaml
custom_lun.yaml
Post merge lun.yaml
From above example plugins (top level param) got overwritten.
Advantages of this approach:
The text was updated successfully, but these errors were encountered: