fluxcd/image-reflector-controller

Success reported on ImagePolicy when ImageRepository stalled

makkes opened this issue · 0 comments

makkes commented

When an ImageRepository's .spec.image is changed to an invalid value then any refering ImagePolicy still reports success.

Steps to reproduce:

  1. flux create image repository podinfo --image ghcr.io/stefanprodan/podinfo
  2. Wait until the repository reports a positive Ready condition.
  3. k patch imagerepository -n flux-system podinfo -p '{"spec":{"image":"oci://stefanprodan/podinfo"}}' --type merge
  4. Wait until the repository reports a negative Ready condition and a Stalled condition.
  5. flux create image policy --image-ref podinfo --select-semver=5.1.4 podinfo

After the last step the ImagePolicy's .status field looks like this:

status:
  conditions:
  - lastTransitionTime: "2023-10-02T16:13:39Z"
    message: Latest image tag for 'oci://stefanprodan/podinfo' resolved to 5.1.4
    observedGeneration: 1
    reason: Succeeded
    status: "True"
    type: Ready
  latestImage: oci://stefanprodan/podinfo:5.1.4
  observedGeneration: 1

However, the status should report a negative Ready condition until the ImageRepository is ready again.