fluxcd/image-reflector-controller

Deleted ImagePolicies and ImageRepositories gotk_reconcile_condition values are incoherent

sa-spag opened this issue ยท 1 comments

๐Ÿ‘‹

I have noticed that deleted ImagePolicies and ImageRepositories conditions metrics are misreported by the controller.

Steps to reproduce

  1. Create a valid ImageRepository and an associated ImagePolicy, e.g. with:
flux create image repository podinfo \
    --image ghcr.io/stefanprodan/podinfo \
&& \
flux create image policy podinfo \
    --image-ref=podinfo \
    --select-semver="6.x"
  1. Delete the 2 previously created resources with kubectl delete imagerepository podinfo && kubectl delete imagepolicy podinfo (order does not matter much, although it slightly impacts the experienced behavior)

Expected behavior

  • gotk_reconcile_condition{kind="imagerepository" name="podinfo", type="Ready", status="Deleted"} and gotk_reconcile_condition{kind="imagepolicy" name="podinfo", type="Ready", status="Deleted"} equal 1 for, metrics for other status values equal 0

Experienced behavior

  • gotk_reconcile_condition{kind="imagerepository" name="podinfo", type="Ready", status="True"} equals 1, gotk_reconcile_condition{kind="imagepolicy" name="podinfo", type="Ready", status="False"} equals 1 too (as the referenced ImageRepository was deleted before the ImagePolicy itself I guess),
    metrics for other status values equal 0

Can confirm, also affected by this. Current, not elegant solution is to restart controller pod.