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

[ImageUpdater]forceUpdate: true clears Helm parameters when there is no tag in registry, causing invalid image reference

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • 5
    • False
    • Hide

      None

      Show
      None
    • False
    • GitOps Tangerine Sprint 25

      Description of Problem

      Describe the bug

      When forceUpdate: true is set in the ImageUpdater CRD, argocd-image-updater sets Helm parameter (global.image.tag) to empty when there is no image tag specified in the Artifact Registry's imageName field. This causes a syntax error because the resulting image reference becomes invalid (e.g., registry/image: with an empty tag). Additionally, argocd-image-updater removes the global.image.tag Helm parameter that was explicitly set in the ArgoCD Application manifest.

      Previously, the image updater would preserve the existing global.image.tag value even when there was no specified image tag in Artifact Registry.

      To Reproduce

      1. Create an ArgoCD Application manifest with global.image.tag set as a Helm parameter:
        apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: example-appspec: project: previewsource: repoURL: https://github.com/org/repo.gitpath: infrastructure/helm/frontendtargetRevision: testhelm: valueFiles:
      • ../envs/frontend-partners/values-preview.yamlparameters:
      • name: global.image.tagvalue: "mq@sha256:123456"forceString: true
         
      1. Create an ImageUpdater CRD with forceUpdate: true and an imageName that doesn't include a tag:
        apiVersion: argocd-image-updater.argoproj.io/v1alpha1kind: ImageUpdatermetadata: name: example-image-updaterspec: namespace: argocdcommonUpdateSettings: forceUpdate: trueupdateStrategy: "digest"writeBackConfig: method: "argocd"applicationRefs:
      • namePattern: "example-app"images:
      • alias: frontend-partnersimageName: "example-registry/docker/frontend-partners"manifestTargets: helm: name: "global.image.name"tag: "global.image.tag"
         
      1. Apply both resources to the cluster
      1. Observe that argocd-image-updater removes the global.image.tag parameter from the Application manifest
      1. Observe the error when ArgoCD tries to deploy the application

      Expected behavior

      The image updater should preserve the existing global.image.tag value when:

      • forceUpdate: true is set
      • The global.image.tag is explicitly set in the Application manifest as a Helm parameter

      The image updater should not remove Helm parameters from the Application manifest, and should not set global.image.tag to empty, which results in invalid image references.

      Additional context

      • This issue only occurs when forceUpdate: true is set
      • When forceUpdate: false (or omitted), the image updater works correctly and preserves the tag value
      • This appears to be a regression from previous behavior where the tag value was preserved
      • Related to the fix for issue Cannot use digest update strategy with forceUpdate: true without version constraint #1344
      • The error occurs because Kubernetes/Docker cannot parse image references with empty tags (e.g., registry/image:)

      Version

      1.0.1

      Logs
       Failed to apply default image tag "example-registry/docker/frontend-partners:": couldn't parse image name "example-registry/docker/frontend-partners:": invalid reference format
       
       
       
       
       

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

                Created:
                Updated: