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

Eliminate viper and mapstructure from rpk #4531

Closed
3 tasks
twmb opened this issue May 3, 2022 · 0 comments · Fixed by #5061
Closed
3 tasks

Eliminate viper and mapstructure from rpk #4531

twmb opened this issue May 3, 2022 · 0 comments · Fixed by #5061
Assignees
Labels

Comments

@twmb
Copy link
Contributor

twmb commented May 3, 2022

Viper + mapstructure automagically converts between types for us, but also silently accepts invalid types and encodes them to redpanda.yaml. We should remove viper and make all of this behavior explicit.

This is a challenging task because nothing in the code indicates what magic is being done automatically. We need to refer to the mapstructure docs to determine what WeaklyTypedInput is doing for us.

I think this should be done in a few parts, the first part requiring the most work.

  • Exactly codify the magic. At the end of this, we can add a beacon to notify us what specific magic is currently being relied on (do people just have weakly typed yaml one_or_many things, or is there something more complex?), and we can add logs to users telling them that the weak types are being deprecated. We can also now reject outright invalid input.
  • After 6mo (two releases), reject weak types when writing unless a specific hidden --backwards-compatible flag is given.
  • After 6mo more, reject weak types on read & write.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants