-
Notifications
You must be signed in to change notification settings - Fork 14
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
[DO NOT MERGE] Generate go structs from helm chart values #897
Conversation
Next steps:
|
I really appreciate that work @HomayoonAlimohammadi and this will greatly stabilize our code-base. I'm +1 for moving forward with that change. My suggestion would be to start with a PR that implements the |
So there's clearly been a lot of thought out into this, so I don't want to diminish your work @HomayoonAlimohammadi. Thanks for submitting this. One of the main issues is that it seems to implement the entire values.yaml struct for a chart, whereas our current implementation is simple in that we only define and maintain values we care about. I guess I don't see why we need this. We have a specific list of helm charts, and in our current code it's very clear which values we care about, because they're the only ones thay we define in the code, and the rest are defaulted by Helm automatically.
I think this adds a lot of complexity, specifically 15,000 lines worth, for something that only took maybe 100-200 LoC originally. Personally I went through the upgrade process of bumping a chart version and reviewing the maps we create, it was not complicated and could be done by anyone new to the codebase. EDIT: The benefit of having compile-time type safety is definitely appealing. We can even automate the process of pulling new Chart versions from Upstream and know at compile-time if our code needs to change. After meeting with @HomayoonAlimohammadi, I think this is a cool idea and I'm +1. |
I don't see this as a problem. It is still very clear which values are used and which are not.
Looks very similar to what we have today, with the extra benefits of type safety. |
1a09d3e
to
c7ce738
Compare
c7ce738
to
7a479e7
Compare
Let's close this one. Maybe we can investigate this further later. |
[DO NOT MERGE] (well obviously)
Overview
This PR adds a yaml to Go struct generator that extracts and reads the
values.yaml
files from thetgz.
feature charts, and generates a Go struct with regards to the content of thatvalues.yaml
file.This is an initial PR to spark conversations around the path forward.
Please move to the
How to review
section to prevent headaches.IMPORTANT
src/k8s/pkg/k8sd/features/loadbalancer/test/main.go
)Rationale
The generated structs can be used to pass and overwrite default helm values when applying a feature chart. E.g.:
This will prevent us to go through the daunting task of ensuring the hardcoded fields and values are compatible with what each
values.yaml
file expects.This is how we're handling it right now:
We previously had an issue with the values getting passed to the ingress controller where they did not match the expected ones in the
values.yaml
file. That issue was surfaced COMPLETELY by chance otherwise it would have been a very frustrating debugging challenge.How to review
values/
are autogenerated and will not need a review.values.yaml
files likecoredns-1.2.3.tgz_values.yaml
are also only extracted from the corresponding.tgz
files and should not be reviewed.generator.go
and theMakefile
.Usage
To further control the generation process use: