Skip to content

Fix crd patches#143

Open
joshmeranda wants to merge 4 commits intorancher:masterfrom
joshmeranda:fix-crd-patches
Open

Fix crd patches#143
joshmeranda wants to merge 4 commits intorancher:masterfrom
joshmeranda:fix-crd-patches

Conversation

@joshmeranda
Copy link
Copy Markdown
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
Copy Markdown
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