improve apply scripts on validation and triggering reconciliation of the HelmRelease

This MR improves two things on the apply scripts (apply.sh,boostrap.sh,apply-workload-clusters.sh,preview.sh).

(discussed and cooked jointly with @feleouet along with many corresponding sylvactl improvements)

Fix reconciliation/wait race

Closes #1284 (closed)

Before this MR, we have the following race, for example with apply.sh, but relevant for other apply scripts, resulting in sylvactl --watch being started before the new HelmRelease is updated, and sometimes claiming "All Done!" prematurely.

Current behavior:

  • apply.sh annotates the sylva-units HelmRelease for reconciliation
    • does not use the "forced" reconciliation mechanism that has been added to Flux -> in the case where only valuesFrom configmaps/secrets were changed, nothing will happen
  • wait for the Flux Helm controller to have processed the annotation
    • it seems that it is not sufficient to ensure that all Kustomizations were produced/updated for the new Helm release, and if not then the sylvactl --watch that will follow will either conclude success too early, or work based on partially old state
  • nothing is done to ensure that the HelmRelease source is reconciled first

With this MR:

  • we use the "forced" reconciliation mechanism that has been added to Flux
  • we'll ensure that we'll reconcile the source (relying on sylvactl ability to wait for dependencies)
  • we wait for the HelmRelease to be ready, which ensures that all Kustomizations have been updated

Simplify validation step

Closes #1249 (closed)

Now that sylvactl has the ability to exit quickly on a schema validation error or Helm rendering error, most of our valiation steps (all but the one in bootstrap.sh) can be skipped, because the application of the manifest will offer the same validation.

This is explained in more details in #1249 (closed)

Edited by Thomas Morin

Merge request reports

Loading