| Puppet Version: 7.20 Puppet Server Version: OS Name/Version: The function ModuleDataProvider::validate_data_hash is supposed to prune all hiera keys that are not prefixed with the configured module_name. It does not. Instead it returns the hash that it was called with unchanged. All pruning is done on a cloned version of the supplied hash that’s discarded. https://github.com/puppetlabs/puppet/blob/main/lib/puppet/pops/lookup/module_data_provider.rb#L46 Desired Behavior:
- It should prune all hiera keys that are not prefixed with the configured module name.
- It should include the name of any offending key(s) in the warning message that it prints. The warning message as currently implemented doesn't provide the developer with any meaningful actionable information.
https://github.com/puppetlabs/puppet/blob/main/lib/puppet/pops/lookup/module_data_provider.rb#L54 should be modified to be something like: Puppet.warning("Module '#{module_name}': #{msg}, key=#{k}") to help identify the offending key(s). Actual Behavior: Hiera keys not prefixed with the module name are not pruned from the supplied hash. No warning advising on the offending key(s) is printed. Fix: Delete this line and the pruned hash is returned: https://github.com/puppetlabs/puppet/blob/main/lib/puppet/pops/lookup/module_data_provider.rb#L57 |