config/types/etcd: add support for v3.4 and v3.5 options#16
Conversation
The structs were generated by parsing `etcd --help` output and processing using a go program that I wrote. The program is available here: https://gist.github.com/jepio/11f447c4f6270e2a23f66d7fa414f3a6. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
| type Etcd3_4 struct { | ||
| Name *string `yaml:"name" cli:"name"` | ||
| DataDir *string `yaml:"data_dir" cli:"data-dir"` |
There was a problem hiding this comment.
Maybe types could be embedded to deduplicate most of the fields?
There was a problem hiding this comment.
No I don't think that makes sense. I've compared 3.3 to 3.4 and 3.5, every version adds and removes options, and trying to separate that into something that can be embedded will require more maintenance than parsing the options for a specific release and generating a struct from that.
There was a problem hiding this comment.
Sure, sounds good 👍 I wonder if we could have the code you wrote for generation in go:generate or something.
There was a problem hiding this comment.
I'll look at that next time we need to update, right now it would be cumbersome to do so as it requires pulling all etcd binaries.
|
thanks for your PR ! While we're here, I'm wondering if we should set the default version to the one Flatcar ships (3.5.0): |
Yeah, I was worried about doing that but I realize now that the default is already defined by the image and the default here only affects yaml parsing and option lookup. |
...to match default version deployed by current Flatcar releases. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
tormath1
left a comment
There was a problem hiding this comment.
LGTM ! Thanks for addressing this issue. One follow-up step would be to upgrade Mantle dependency consequently to remove warnings in the CI too then.
add support for etcd v3.4 and v3.5 options
The structs were generated by parsing
etcd --helpoutput andprocessing using a go program that I wrote. The program is available
here: https://gist.github.com/jepio/11f447c4f6270e2a23f66d7fa414f3a6.
Related flatcar/Flatcar#398
How to use
makeTesting done
No warnings when deploying newer versions, and supports new options: