prevent having both 'repo' and 'helmrelease_spec.chart.spec.version' set for a unit

Closes #1671 (closed)

💡 This MR will be easier to review commit by commit.

This MR ensures that we'll avoid regressions on the issue described in #1671 (closed): we can't allow helmrelease_spec.chart.spec.version to be specified for a unit depending on a Gitrepository resource or else we have two places, possibly conflicting, where the chart version to use is specified (and incidentally, only one of those is being looked at by renovate).

This MR reintroduces !2970 (merged), which had to be reverted but done differently.

Instead of preventing the bad combination via the schema, this is done via Helm templating code:

  • it avoids the breakage that we had with !2970 (merged) (where OCI deployments violated the schema because they had both repo and helmrelease_spec.chart.spec.version after adding the post-processed use-oci-artifacts.values.yaml file)
  • it allows to have a nice error message (the one in !2970 (merged) was obscure)

This MR also adds testing of the use-oci-artifacts.values.yaml values, so as to avoid the breakage that !2970 (merged) hadn't avoided. For this purpose test-values are added, but this isn't sufficient: we also need to compute the final content of use-oci-artifacts.values.yaml file with the tools/oci/build-sylva-units-artifact.py tool. Some commits of this MR are dedicated to that.

For reference, related MR where discrepancies had been fixed:

Edited by Thomas Morin

Merge request reports

Loading