Reported resourcesStatus is not always relevant

Currently operator updates resourcesStatus at the end of the reconcile loop, consequently the SylvaUnitsRelease object status does not always report accurately the resources that are produced.

I faced this issue on my dev env, reported status was:

❯ k get  sur sylva-units -o yaml | yq .status
conditions:
  - lastTransitionTime: "2025-12-17T09:41:16Z"
    message: |-
      external-secrets-operator Kustomization is not ready
      flux-system Kustomization is not ready
      sylva-units-operator Kustomization is not ready
    observedGeneration: 30
    reason: ResourceNotReady
    status: "False"
    type: Ready
  - lastTransitionTime: "2025-12-16T16:13:22Z"
    message: Reconciliation in progress
    observedGeneration: 30
    reason: Progressing
    status: Unknown
    type: HelmReleaseReady
  - lastTransitionTime: "2025-12-16T16:13:22Z"
    message: Reconciliation in progress
    observedGeneration: 30
    reason: Progressing
    status: Unknown
    type: HelmReleaseUpToDate
  - lastTransitionTime: "2025-12-16T16:13:22Z"
    message: Reconciliation in progress
    observedGeneration: 30
    reason: Progressing
    status: "False"
    type: PreUpgradeUnitsUpToDate
observedGeneration: 4
resourcesStatus:
  - kind: GitRepository
    name: sylva-units-5a348ccb
    status: Resource is Ready
  - kind: GitRepository
    name: sylva-units-5a348ccb
    status: Resource is Ready
  - kind: Secret
    name: sylva-units-file-01cdd13a
    status: Resource is Ready
  - kind: HelmRelease
    name: sylva-units
    status: InProgress - HelmRelease generation is 31, but latest observed generation is 30

The kustomizations were not ready as they were waiting for another source to reconcile:

❯ k get ks flux-system -o yaml | yq .spec.sourceRef
kind: GitRepository
name: sylva-units-e81b9527
namespace: sylva-system

❯ k get gitrepositories.source.toolkit.fluxcd.io sylva-units-e81b9527
NAME                   URL                                                AGE   READY   STATUS
sylva-units-e81b9527   https://gitlab.com/sylva-projects/sylva-core.git   17h   False   failed to checkout and determine revision: unable to resolve commit object for '0d3dba7ad4be5b20d2dec4bbf58ed43cacfac7f6': object not found

sylva-units-e81b9527 repo was produced by the operator, but since the reconcile loop had not reached the end of the reconciliation loop, this object and its status were not reported.

Assignee Loading
Time tracking Loading