*.sh scripts / let reconcile_sylva_units use "sylvactl watch" with "--reconcile"
We need to add --reconcile
to the sylva watch
command that is used to trigger a refresh of the sylva-units HelmRelease.
If we don't then, on an upgrade that changes the source (e.g. an upgrade where the sylva-core commit changes):
- the sylva-units HelmRelease may be reconciled before its source is refreshed
- the source should be reconciled quickly-enough by Flux (because it's spec has been updated to point to the new sylva-core commit)
- ... but then, after the source is reconciled, nothing will refresh sylva-units, and nothing will happen until the next reconciliation (subject to the reconciliation period, by default 10 minutes)
This should solve issues like in https://gitlab.com/sylva-projects/sylva-core/-/jobs/7044079523#L304:
trigger reconciliation of sylva-units HelmRelease...
helmrelease.helm.toolkit.fluxcd.io/sylva-units annotated
2024/06/07 12:33:15.307973 HelmRepository/sylva-core Static object - Ready
2024/06/07 12:33:15.307998 HelmChart/sylva-system-sylva-units ChartPackageSucceeded - packaged 'sylva-units' chart with version '0.0.0-git-3dff578f+2' and merged values files [values.yaml management.values.yaml use-oci-artifacts.values.yaml]
2024/06/07 12:33:15.308025 HelmRelease/sylva-units HelmChartNotReady - HelmChart 'sylva-system/sylva-system-sylva-units' is not ready: latest generation of object has not been reconciled
2024/06/07 12:33:16.372456 HelmRelease/sylva-units state changed: Progressing - Running 'upgrade' action with timeout of 5m0s
2024/06/07 12:33:16.372496 ╭╴Waiting for the following resources to progress:
2024/06/07 12:33:16.372501 │ HelmRelease/sylva-units Progressing - Running 'upgrade' action with timeout of 5m0s
2024/06/07 12:33:16.372506 ╰╴╴╴┄
2024/06/07 12:34:13.032832 Command timeout exceeded
Timed-out waiting for the following resources to be ready:
* HelmRelease/sylva-units: Progressing - Running 'upgrade' action with timeout of 5m0s
Because of failure https://gitlab.com/sylva-projects/sylva-core/-/jobs/7045102412#L265 on one of the pipeline of an early version of this MR, this MR also adjusts the timeout of the same sylvactl watch
, and also makes this timer configurable via environment variables.
/cc @feleouet
Edited by Thomas Morin