# ImageUpdateAutomation: when an ImagePolicy selects a new tag, this object # instructs Flux to open a commit on the api-company repo updating the # image reference in the relevant HelmRelease values. # # The GitRepository used here is the api-company source (flux-system/api-company). # Flux needs write access; create the token secret first: # kubectl create secret generic gitea-image-automation-token \ # -n flux-system \ # --from-literal=username=leeworks-agents \ # --from-literal=password= # Then patch the api-company GitRepository to reference it (or reuse # gitea-leeworks-agents-token if that token also has write:repository scope). apiVersion: image.toolkit.fluxcd.io/v1beta2 kind: ImageUpdateAutomation metadata: name: api-company namespace: flux-system spec: interval: 10m sourceRef: kind: GitRepository name: api-company git: checkout: ref: branch: main commit: author: email: agent@leeworks.dev name: Flux Image Automation messageTemplate: | chore(image): update {{range .Updated.Images}}{{.Repository}}:{{.NewTag}} {{end}} push: branch: main secretRef: name: gitea-image-automation-token # must pre-exist in flux-system ns — see docs/secrets-checklist.md item 9 update: path: ./flux strategy: Setters