Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-8552

Implement: ImageUpdater CR with Legacy Annotation Reading

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • 1.20.0
    • None
    • None
    • GitOps Tangerine Sprint 27

      The text below was created with the help of AI

          1. Example

      *ApplicationSet templates Applications with EXISTING legacy annotations:*

      ```yaml
      apiVersion: argoproj.io/v1alpha1
      kind: Application
      metadata:
      name: us-east-app-1
      labels:
      image-updater: my-image-updater # For CR to select
      annotations:

      1. EXISTING legacy annotations - no changes needed!
        argocd-image-updater.argoproj.io/image-list: 'app=nexus.company.domain/myapp:develop'
        argocd-image-updater.argoproj.io/app.update-strategy: digest
        argocd-image-updater.argoproj.io/app.helm.image-tag: mychart.image.tag
        spec: ...

        apiVersion: argoproj.io/v1alpha1
        kind: Application
        metadata:
        name: eu-west-app-1
        labels:
        image-updater: my-image-updater
        annotations:
      2. Different tag for this app!
        argocd-image-updater.argoproj.io/image-list: 'app=nexus.company.domain/myapp:main'
        argocd-image-updater.argoproj.io/app.update-strategy: digest
        argocd-image-updater.argoproj.io/app.helm.image-tag: mychart.image.tag
        spec: ...
        ```

      *One ImageUpdater CR for the entire ApplicationSet:*

      ```yaml
      apiVersion: argocd-image-updater.argoproj.io/v1alpha1
      kind: ImageUpdater
      metadata:
      name: my-image-updater
      spec:
      namespace: argocd
      applicationRefs:

      • namePattern: "*" # Wildcard - rely on labelSelectors
        labelSelectors:
        matchLabels:
        image-updater: my-image-updater
        readFromApplicationAnnotations: true # NEW FIELD - read legacy annotations!
        ```
          1. CRD Change Required

      *Add ONE new field to `ApplicationRef`:*

      ```go
      type ApplicationRef struct

      { NamePattern string `json:"namePattern"` LabelSelectors *metav1.LabelSelector `json:"labelSelectors,omitempty"` // NEW: When true, read image configuration from Application's // argocd-image-updater.argoproj.io/* annotations instead of // requiring explicit Images[] configuration in this CR. // +optional ReadFromApplicationAnnotations *bool `json:"readFromApplicationAnnotations,omitempty"` // Existing fields - used when ReadFromApplicationAnnotations is false/nil *CommonUpdateSettings `json:"commonUpdateSettings,omitempty"` *WriteBackConfig `json:"writeBackConfig,omitempty"` Images []ImageConfig `json:"images,omitempty"` // Now optional! }

      ```

              dkarpele@redhat.com Denis Karpelevich
              dkarpele@redhat.com Denis Karpelevich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: