(fix?) do not create a copy of helm index using index.Merge() #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #100
Why doesn't the current iteration support multiple upstream chart rcs?
Let's use these to example versions:
106.0.0+up5.0.0-rc.1
106.0.0+up5.0.0-rc.2
Semantically for rancher these would indicate that we want to release a chart for the 2.11 line, with the chart patches being the same (i.e.) 106.0.0, but with different upstream charts, which technically makes them different charts.
However using semver, these are actually treated as the same version, but with different build metadata :
up5.0.0-rc.1
versus :up5.0.0-rc.2
When we generate the new index file from
assets
path :we do correctly pickup both
106.0.0+up5.0.0-rc.1
106.0.0+up5.0.0-rc.2
so what happens next? When it comes time to update the index, we call :
which in turn calls (which is equivalent to the upstream helm command
helm index merge ...
):to use as the new index. BUT as we iterate and merge into the empty index, we check that there are no equivalent semver versions. So what ends up happening is
106.0.0+up5.0.0-rc.1
gets add to the update index but106.0.0+up5.0.0-rc.2
correctly does not get added to the update index because both106.0.0+up5.0.0-rc.1
,106.0.0+up5.0.0-rc.2
are semantically equivalent (as expected):--
I guess the question becomes should we even allow
106.0.0+up5.0.0-rc.1
,106.0.0+up5.0.0-rc.2
to be released at the same time?If we don't it makes it impossible to release two charts with the same base version like
106.0.0
, which could be relevant for charts likerancher-monitoring
andprometheus-federator
where we may want to release two upstream versions using the same set of patches.In the existing codebase, we can work around that problem like:
but we can get into weird versioning scenarios where if we want to update the set of patches to particular upstream charts
which I'm not against at all, but we should document. That way of doing things also becomes VERY time consuming and can be confusing as multiple set of patches from different people come in.
If this is determined a won't-fix as it likely should, I'd at least like to add some validation logic to check that all entries in
assets
path are actually inindex.yaml
to make PRs that do updates like106.0.0+up5.0.0-rc.1
->106.0.0+up5.0.0-rc.2
don't accidentally end up with a missing index.yaml entry if we don't remove106.0.0+up5.0.0-rc.1