Checklist:
Describe the bug
When using a named custom kustomize version in argocd-cm (e.g. kustomize.path.with-helm + kustomize.buildOptions.with-helm), the per-version build options are correctly parsed and stored internally but are never appended to the actual kustomize build command. Only the global kustomize.buildOptions (no version suffix) reaches the build invocation. The result is that kustomize.buildOptions.<version> is silently ignored even though kustomize.path.<version> works correctly.
To Reproduce
- Add to
argocd-cm:
data:
kustomize.path.with-helm: /usr/local/bin/kustomize
kustomize.buildOptions.with-helm: --enable-helm
- Create an Application referencing the named version:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: test-kustomize-with-helm
spec:
source:
repoURL: https://example.com/repo.git
targetRevision: HEAD
path: my-kustomize-app
kustomize:
version: with-helm
- Use a
kustomization.yaml with helmCharts:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: podinfo
repo: oci://ghcr.io/stefanprodan/charts
version: 6.7.1
releaseName: podinfo-test
namespace: test-podinfo
-
Restart argocd-repo-server and argocd-applicationset-controller.
-
Trigger a sync: the application fails with must specify --enable-helm.
Expected behavior
ArgoCD invokes:
/usr/local/bin/kustomize build <path> --enable-helm
The per-version build options (kustomize.buildOptions.with-helm) are applied when an Application selects that version via spec.source.kustomize.version: with-helm.
Screenshots
Repo-server log output:
time="..." level=info msg="/usr/local/bin/kustomize build /tmp/_argocd-repo/.../kustomize-with-helm"
time="..." level=error msg="`/usr/local/bin/kustomize build /tmp/_argocd-repo/.../kustomize-with-helm` failed exit status 1:
Error: trouble configuring builtin HelmChartInflationGenerator with config: `
chartHome: charts
includeCRDs: true
name: podinfo
namespace: test-podinfo
releaseName: podinfo-test
repo: oci://ghcr.io/stefanprodan/charts
version: 6.7.1
`: must specify --enable-helm"
Note: --enable-helm is absent from the command. kustomize.path.with-helm is applied correctly (the right binary path is used); only kustomize.buildOptions.with-helm is ignored.
To confirm that kustomize.path.<version> is genuinely being respected, setting the path to a non-existent binary produces the expected error:
kustomize.path.with-helm: /usr/local/bin/kustomize-test # does not exist
Failed to load target state: failed to generate manifest for source 1 of 1:
rpc error: code = Unknown desc = fork/exec /usr/local/bin/kustomize-test: no such file or directory
This proves the path lookup works end-to-end. The build options from kustomize.buildOptions.with-helm are the only thing not reaching the command.
Version
argocd: v3.3.2
BuildDate: 2026-02-22T12:33:55Z
GitCommit: 8a3940d8db27928931f0a85ba7c636e54786bddc
Also reproduced by code inspection in v3.3.9 and v3.4.0-rc7: the relevant files are identical across all three versions.
Possible Root cause
GetKustomizeSettings() in util/settings/settings.go correctly parses kustomize.buildOptions.with-helm and stores it in KustomizeVersion.BuildOptions. However, in reposerver/repository/repository.go, after calling GetKustomizeBinaryPath() (which correctly resolves the binary path from Versions), there is no equivalent call to extract the matched version's BuildOptions. The Build() function in util/kustomize/kustomize.go only reads the top-level kustomizeOptions.BuildOptions (the global field): it never reads kustomizeOptions.Versions[i].BuildOptions.
Relevant files:
Related: #18026 (different symptom: global not applied as fallback: but similar underlying gap)
Workaround
Use the global build options instead:
data:
kustomize.buildOptions: --enable-helm
Checklist:
argocd version.Describe the bug
When using a named custom kustomize version in
argocd-cm(e.g.kustomize.path.with-helm+kustomize.buildOptions.with-helm), the per-version build options are correctly parsed and stored internally but are never appended to the actualkustomize buildcommand. Only the globalkustomize.buildOptions(no version suffix) reaches the build invocation. The result is thatkustomize.buildOptions.<version>is silently ignored even thoughkustomize.path.<version>works correctly.To Reproduce
argocd-cm:kustomization.yamlwithhelmCharts:Restart
argocd-repo-serverandargocd-applicationset-controller.Trigger a sync: the application fails with
must specify --enable-helm.Expected behavior
ArgoCD invokes:
The per-version build options (
kustomize.buildOptions.with-helm) are applied when an Application selects that version viaspec.source.kustomize.version: with-helm.Screenshots
Repo-server log output:
Note:
--enable-helmis absent from the command.kustomize.path.with-helmis applied correctly (the right binary path is used); onlykustomize.buildOptions.with-helmis ignored.To confirm that
kustomize.path.<version>is genuinely being respected, setting the path to a non-existent binary produces the expected error:This proves the path lookup works end-to-end. The build options from
kustomize.buildOptions.with-helmare the only thing not reaching the command.Version
Also reproduced by code inspection in v3.3.9 and v3.4.0-rc7: the relevant files are identical across all three versions.
Possible Root cause
GetKustomizeSettings()inutil/settings/settings.gocorrectly parseskustomize.buildOptions.with-helmand stores it inKustomizeVersion.BuildOptions. However, inreposerver/repository/repository.go, after callingGetKustomizeBinaryPath()(which correctly resolves the binary path fromVersions), there is no equivalent call to extract the matched version'sBuildOptions. TheBuild()function inutil/kustomize/kustomize.goonly reads the top-levelkustomizeOptions.BuildOptions(the global field): it never readskustomizeOptions.Versions[i].BuildOptions.Relevant files:
Related: #18026 (different symptom: global not applied as fallback: but similar underlying gap)
Workaround
Use the global build options instead: