sylva-units: introduce _internal.state.is_upgrade, alternative to .Release.IsUpgrade

Closes #1434 (closed)

To address the issues/limitations described in #1434 (closed), this MR introduces a _internal.state.is_upgrade that is then used in places where we were using .Release.IsUpgrade. Using this new flag will allow to have behavior specific to an update of sylva-units after a full deployment (today, we use .Release.IsUpgrade which is true when upgrading from a full deployment OR when updating the Helm release after a failed partial installation, e.g. a re-run of bootstrap.sh or on the second reconciliation of the HelmRelease in the mgmt cluster after pivot).

To determine whether or not the sylva-units Helm release is being upgraded from an full deployment the new code checks the presence of the sylva-units-status ConfigMap (which is generated only at the end of a full deployment when all Kustomizations have reconciled).

To achieve this:

  • the new flag is introduced
  • the immutable value check is adapted to test when the new flag is set
  • to make it easy to use this flag in _internal.xxx values, the interpretation code is adapted to ensure that this flag is interpreted first
Edited by Thomas Morin

Merge request reports

Loading