-
Notifications
You must be signed in to change notification settings - Fork 158
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 config parsing for structs and pointers to structs #345
Conversation
allSettings[updatedKey] = val | ||
} | ||
} | ||
recursivelyCapitalizeConfigKeys(allSettings, yamlTags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should fix the issue reported in #322, not being able to set authType
in kubelet.APIConfig
.
@@ -131,6 +125,19 @@ func (cfg *Config) Unmarshal(componentParser *config.Parser) error { | |||
return nil | |||
} | |||
|
|||
func recursivelyCapitalizeConfigKeys(settings map[string]interface{}, yamlTags map[string]string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a viper-centric issue I wonder if yamlTagsFromStruct
and recursivelyCapitalizeConfigKeys
should be in a parent function (or receiver method)* like respectYamlTagsInAllSettings()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmfitzpatrick - I've moved these methods to a helper and exposed RespectYamlTagsInAllSettings
which can be used by both the receiver and the extension. Let me know if you think it's better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do indeed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
fe9145f
to
a1b2966
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
* Fix config parsing for structs * Move common config utils to helper
Addresses the following -