Skip to content

Add support for other values for ImageUpdateAutomation spec.sourceRef field #788

Open
@applike-ss

Description

I would love to see other reference options for the ImageUpdateAutomation spec.sourceRef field.

I do see use for a ConfigMap reference that holds image values.

Imagine these resources to be valid:

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-configmap # This resource would not be managed by flux, as flux iua would update it and a kustomization would revert that.
  namespace: default
  annotations:
    image.toolkit.fluxcd.io/image=imageField
    image.toolkit.fluxcd.io/image-tag=imageTag
    image.toolkit.fluxcd.io/image-repository=imageRepository
data:
  imageField: xyz
  imageTag: v0
  imageRepository: index.docker.io
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
  name: podinfo
  namespace: default
spec:
  image: ghcr.io/stefanprodan/podinfo
  interval: 5h
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
  name: podinfo-policy
  namespace: default
spec:
  imageRepositoryRef:
    name: podinfo
  policy:
    semver:
      range: 5.0.x
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageUpdateAutomation
metadata:
  name: podinfo-update
  namespace: default
spec:
  interval: 30m
  sourceRef:
    kind: ConfigMap
    name: podinfo

In this scenario we are creating a non-managed configmap and a set of flux resources updating it.

I could also imagine enhancing the reconcile annotation to support a case to define action that are disabled, e.g.:

kustomize.toolkit.fluxcd.io/reconcile: disabled=patch

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions