-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support pulling crds from an upstream #129
Conversation
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 think that allowing both crdOptions
and upstreamOptions
can work.
But, I don't think these changes are going to work like you want. Take a closer read through AdditionalChart.Prepare()
: on line 114 there is a check for c.CRDChartOptions != nil
. If it is not nil
, then the following else
clause, which pulls code using the object that results from upstreamOptions
, does not run. So I think that using this code as you intend will result in an error because there is no crds/
directory.
Another thing: if you have time, it would be great if you could write some unit tests for your change. charts-build-scripts
has none at the moment, and that makes it hard to change.
@adamkpickering I might be misunderstanding you but you are correct that if |
Ah you're right, I'm not sure how I missed that. Moving too fast I guess. The code looks good to me then. We do need to update the documentation and comments though - there are places that say that There is duplication of this documentation in rancher/charts due to the templating. Don't worry about this - I will bring this up internal to the MAPPS team, and we'll have to open another PR or make other changes to address this problem. |
Ope I forgot about the code docs. I'll go through and update what I can in the code. Thanks! |
…ger mutually exclusive
Problem
While updating the upstream for
rancher-monitoring
chart, I found that the crd generation code is unable to work with the structure ofkube-prometheus-stack
. Thecharts-build-scripts
expect crds to be stored in acrds
directory at the chart root directory; however,kube-prometheus-stack
has moved its crds into a subchart. This causes several problems for crd generation:charts
directory when loading dependencies, the upstream crd subchart is removed before the crd is generated, so we cannot simply support a user specified location to look for crds over the defaultcrds
.0.0.0
and does not match the real upstream version57.0.3
, so we cannot simply manage arancher-monitoring-crd
since therancher-monitoring
andrancher-monitoring-crd
charts will not have matching versions.additionalCharts
configuration validation code does not allow for specifying bothupstreamOptions
andcrdOptions
so we cannot pull from an upstream and then use the crd template.Solution
Allow for specifying both
upstreamOptions
to pull the crds directory, andcrdOptions
to use the crd template.fixes #13
unblocks #44614