fix: move Flux image-automation marker to a trailing comment

The $imagepolicy marker was on the line above image:, not a trailing
comment on that line. Flux's Setters strategy attaches YAML comments to
the node on their own line, so a marker on a preceding line never
associates with the field below it - the marker silently matched nothing,
which is why ImageUpdateAutomation logged "repository up-to-date" on
every reconcile regardless of what ImagePolicy resolved to, and never
once committed a tag update despite two successful image builds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4YNpuC2bgT224suQLLJ7B
This commit is contained in:
CodeGit 2026-09-04 10:59:25 +01:00
parent b3da26e337
commit cd87435d8e

View file

@ -23,13 +23,15 @@ spec:
# - name: forgejo-registry # - name: forgejo-registry
containers: containers:
- name: hello-app - name: hello-app
# Not a comment — this exact-format annotation is how Flux's # The trailing comment on the image line below (not this one) is
# image-automation "Setters" strategy (image-automation.yaml's # how Flux's image-automation "Setters" strategy finds this field
# ImageUpdateAutomation) finds this line and knows to rewrite the # and knows to rewrite the tag in place, rather than needing it
# tag below in place, rather than needing this field templated. # templated. It must be a trailing comment on the image: line
# itself - Flux's YAML parser attaches comments to the node on
# their own line, so a marker on a line above never associates
# with the field below it and silently never matches anything.
# "hello-app:hello-app" is "<namespace>:<ImagePolicy name>". # "hello-app:hello-app" is "<namespace>:<ImagePolicy name>".
# {"$imagepolicy": "hello-app:hello-app"} image: git.boglabob.com/codegit/hello-app:latest # {"$imagepolicy": "hello-app:hello-app"}
image: git.boglabob.com/codegit/hello-app:latest
ports: ports:
- containerPort: 80 - containerPort: 80
--- ---