argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.33k stars 4.93k forks source link

When deploying multiple versions of a Helm Chart through Kustomize only the first defined version is used. #18087

Open unknownbanana opened 1 week ago

unknownbanana commented 1 week ago

Checklist:

Describe the bug

When using Kustomize and defining multiple version of the same chart in a single kustomization.yml file Argo will always use the first defined version it finds in the list of Helm Chart definitions.

Due to Argo using the first version it finds in the list of charts/releases a syncing issue occurs. The syncing issue is caused by the older versions of the chart not defining the new required values.

To Reproduce

Context:

In short, I cannot provide a true reproduction since the charts are not public and, I do not have access to public charts. I can however provide an example to illustrate the issue.

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - ../a-bunch/of/resources.yaml

helmCharts:
  - name: helm-chart-name
    repo: oci://private.registry.example.org/project-name
    version: 1.0
    releaseName: release-name-0
    valuesInline:
      a_bunch:
        of: values
        that: "do not exist in the older version"
        which:
          causes: a
          lot: of problems

  - name: helm-chart-name
    repo: oci://private.registry.example.org/project-name
    version: 0.3
    releaseName: release-name-1
    valuesInline:
      a_bunch:
        of: values

  - name: helm-chart-name
    repo: oci://private.registry.example.org/project-name
    version: 0.3
    releaseName: release-name-2
    valuesInline:
      a_bunch:
        of: values

  - name: helm-chart-name
    repo: oci://private.registry.example.org/project-name
    version: 0.3
    releaseName: release-name-3
    valuesInline:
      a_bunch:
        of: values

  - name: helm-chart-name
    repo: oci://private.registry.example.org/project-name
    version: 0.3
    releaseName: release-name-4
    valuesInline:
      a_bunch:
        of: values

Expected behavior

The expected behavior is as follows, ArgoCD:

Screenshots

Version

2.10.3

Logs

one or more objects failed to apply, reason: error when patching "/dev/shm/3511515270": admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot create patch for round tripped newBytes: cannot marshal interface: json: error calling MarshalJSON for type v1beta1.ParamValue: impossible ParamValues.Type: "". Retrying attempt #1 at 7:58AM.