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

Fix parsing configs with dots in mapping keys #409

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

DrJosh9000
Copy link
Contributor

What

Change viper's key delimiter to something other than ..

Why

Viper unmarshals keys with .s as a series of nested maps, instead of as a single string key. Which is frustrating when the Kubernetes convention is to use domain names within keys.

@DrJosh9000 DrJosh9000 force-pushed the fix-values-yaml-parsing branch 2 times, most recently from d004f97 to 81248c7 Compare October 31, 2024 00:27
@wolfeidau
Copy link
Contributor

@DrJosh9000 did you consider viper.KeyDelimiter("::") as per their docs? https://pkg.go.dev/github.com/spf13/viper#readme-unmarshaling

@DrJosh9000
Copy link
Contributor Author

I suppose :: is unlikely to occur, and it is easier to type than ·.

Copy link
Contributor

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 🐍 🚀

@DrJosh9000 DrJosh9000 merged commit 00a778d into main Oct 31, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the fix-values-yaml-parsing branch October 31, 2024 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants