- 
                Notifications
    You must be signed in to change notification settings 
- Fork 313
Description
Describe the bug
When updating an image in a Helm chart deployed via multi-source application (see below) using the helmvalues write-back-target, the image updater overrides the specified values file with an empty file (or creates an empty file if it doesn't exist) instead of writing image names/tags.
To Reproduce
Create an application that deploys both a Helm chart and extra resources via kustomize. Have the image updater update an image used in the helm chart using the Git write-back-method and a Helm values write-back-target.
In my minimal reproduction case, I'm using the Codecentric Keycloakx chart with an init container for the image to update. The directory structure in the GitOps repo is this:
apps/keycloak-playground/overlays/dev
 |- config.yaml
 |- kustomization.yaml
 |- cm.yaml
 |- values.yaml
The application manifest is generated from the config.yaml file using an application set (resulting manifest below).
Application manifest
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    argocd-image-updater.argoproj.io/git-repository: https://redacted.example.com/gitops.git
    argocd-image-updater.argoproj.io/image-list: theme=docker.io/hello-world:latest
    argocd-image-updater.argoproj.io/theme.helm.image-name: theme-image.name
    argocd-image-updater.argoproj.io/theme.helm.image-tag: theme-image.tag
    argocd-image-updater.argoproj.io/theme.update-strategy: digest
    argocd-image-updater.argoproj.io/write-back-method: git
    argocd-image-updater.argoproj.io/write-back-target: helmvalues:/apps/keycloak-playground/overlays/dev/theme-version.yaml
  name: keycloak-playground-dev
  namespace: argocd
spec:
  destination:
    namespace: dev
    server: https://kubernetes.default.svc
  project: dev
  sources:
    - path: apps/keycloak-playground/overlays/dev
      repoURL: https://redacted.example.com/gitops.git
      targetRevision: master
    - ref: appGitops
      repoURL: https://redacted.example.com/gitops.git
      targetRevision: master
    - chart: keycloakx
      helm:
        valueFiles:
          - $appGitops/apps/keycloak-playground/overlays/dev/values.yaml
      repoURL: ghcr.io/codecentric/helm-charts
      targetRevision: 7.1.4kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - cm.yamlcm.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: keycloak-test-config
data:
  key: valvalues.yaml
extraInitContainers: |
  - name: theme
    image: docker.io/hello-world
  
args:
  - start-devExpected behavior
I expect the image updater to create/update the theme-version.yaml file with an image name and tag.
Additional context
Add any other context about the problem here.
Version
Image Updater: 0.17.0 (chart version 0.13.0)
Argo CD: 3.0.12
Logs
This happens on every update cycle:
time="2025-10-22T12:47:49Z" level=info msg="Starting configmap/secret informers"
time="2025-10-22T12:47:49Z" level=info msg="Configmap/secret informer synced"
time="2025-10-22T12:49:54Z" level=info msg="Initializing https://redacted.example.com/gitops.git to /tmp/git-keycloak-playground-dev3539967519"
time="2025-10-22T12:49:54Z" level=info msg="secrets informer cancelled"
time="2025-10-22T12:49:54Z" level=info msg="configmap informer cancelled"
time="2025-10-22T12:49:54Z" level=info msg="git fetch origin master --force --prune --depth 1" dir=/tmp/git-keycloak-playground-dev3539967519 execID=275c3
time="2025-10-22T12:49:54Z" level=info msg=Trace args="[git fetch origin master --force --prune --depth 1]" dir=/tmp/git-keycloak-playground-dev3539967519 operation_name="exec git" time_ms=578.967579
time="2025-10-22T12:49:54Z" level=info msg="git checkout --force master" dir=/tmp/git-keycloak-playground-dev3539967519 execID=0ecd9
time="2025-10-22T12:49:54Z" level=info msg=Trace args="[git checkout --force master]" dir=/tmp/git-keycloak-playground-dev3539967519 operation_name="exec git" time_ms=8.943865
time="2025-10-22T12:49:54Z" level=info msg="git clean -ffdx" dir=/tmp/git-keycloak-playground-dev3539967519 execID=391ef
time="2025-10-22T12:49:54Z" level=info msg=Trace args="[git clean -ffdx]" dir=/tmp/git-keycloak-playground-dev3539967519 operation_name="exec git" time_ms=1.4543100000000002
time="2025-10-22T12:49:54Z" level=info msg="Successfully updated the live application spec" application=keycloak-playground-dev
No errors/warnings.