bitnami/charts-syncer

Thrown error if charts to relocate can not be calculated

Opened this issue · 1 comments

Currently, for OCI-based Helm repositories we have two ways to calculate the helm Charts that the tool should sync, a) via an index artifact instructed to be used via useChartsIndex: true and by b) charts: [foobar] slice.

Currently, if the index is not used (or not found) and the charts array is not set, the tool does not fail but just returns a "no charts to index" message. This behavior should be changed since the tool actually requires one of the two mechanisms to work and hence a miss-configuration error should be shown to the user.

There are two scenarios in which the tool should clearly state a miss-configuration

1 - useChartsIndex == false && len(charts) == 0

This was the original behavior (when the index implementation didn't exist), in this case the tool should fail saying that either an index or a manual list of charts should be provided

2 - useChartsIndex == true && foundAndValidIndex == false && len(charts) == 0

Similarly, if the user instructed the tool to use an index but this one does not exist or it's not a valid one. charts syncer should fail if the charts array fallback is not set.

thoughts @jotadrilo @tompizmor

It makes sense to me.