Update path interpolate function to allow root#118
Merged
Conversation
yakatz
requested changes
Feb 9, 2026
yakatz
left a comment
Member
There was a problem hiding this comment.
This looks good - please fix the rubocop warnings.
7e2236a to
40ac5ca
Compare
yakatz
approved these changes
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request (PR) description
The issue with the current
interpolatefunction: it silently drops the root path (/). This happens becausesplit('/')on/returns an empty array ([]), which is then skipped due to theunless segments.empty?condition.For our use case, the root path (
/) is a valid and meaningful entry. It allows us to use explicit lookups in hieradata, which brings several benefits:For example, with a path list like:
/nodes/%{facts.networking.fqdn}environments/%{trusted.extensions.pp_role}commonWe can resolve secrets like this in
common.yaml:This would map to the vault path
/provider/s3/access-keys/fancy-prd.key.We’re migrating all our secrets to explicit lookups, and this path list allows us to do it gradually, rather than in a big-bang migration. However, the current implementation makes this difficult.