Closed joshmeranda closed 5 months ago
@adamkpickering I might be misunderstanding you but you are correct that if c.CRDChartOptions != nil
we won't enter that next else
branch to pull the charts. But it will enter the new nested if c.Upstream != nil
check to pull down the crds. This works as expected for rancher-logging
(no crd upstream) and rancher-monitoring
(with crd upstream after rebase)
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 crdOptions
is mutually exclusive with upstreamOptions
. Specifically templates/template/docs/packages.md
and pkg/options/additionalchart.go
.
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!
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