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

Fix crd patches #143

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

joshmeranda
Copy link
Contributor

Problem

When generating patches for a chart with crds we currently copy the crds pulled from upstream back into the main chart which are then included in the main chart patch.

Solution

We can't simply check for c.Upstream == nil before copying since we will not be able to generate validate-install-crd.yaml when c.CRDOptions.UseTarArchive is true since there won't be any crds to generate the validation on. To fix this, we always generate the validation file based on the crds in the generated chart and only copy those crds to the main chart if there is no upstream.

Unfortunately we have to unarchive the CRDs whenever we need to generate the validation file, but in my testing this does not affect the runtime much. I think the better separation between the Prepare, ApplyMainChanges, and RevertMainChanges makes up for it in terms of readbility. (of course open to disagreement on this point)

Issue: #142

@joshmeranda
Copy link
Contributor Author

@rancher/release-team can I get a review on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant