argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

Default Build Options for custom kustomize versions are not propageted

Open jpmaas opened this issue 10 months ago • 0 comments

Checklist:

  • [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • [x] I've included steps to reproduce the bug.
  • [x] I've pasted the output of argocd version.

Describe the bug

When setting up custom kustomize versions (https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/#custom-kustomize-versions), it is possible to configure custom build options per version if necessary.

However, if default options via kustomize.buildOptions are configured, these options are not considered when using custom versions in applications. I have to explicitly configure the same options per version to make the kustomize build command work. If no version is specified and hence the default version is used, the options configured in kustomize.buildOptions are used and all commands run as expected.

To Reproduce

  • deploy argocd with at least one custom kustomize version (e.g. default and v4.5.7)
  • configure kustomize.buildOptions (e.g. using "--enable-helm")
  • do not configure version specific options via kustomize.buildOptions.<version>
  • create an application using the default kustomize version
  • see application work
  • create an application with your custom kustomize version
  • see application not work and throwing an error
  • configure version specific build options
  • see application with custom kustomize version work

Expected behavior

If no version specific build options kustomize.buildOptions.<version> is specified, the default kustomize.buildOptions should be considered as a fallback.

Version

Initially found in 2.6.2, reproduced after update in 2.10.7. Reproducible via UI and Shell.

$ argocd version
argocd: v2.10.8+37b1cf5
  BuildDate: 2024-04-26T13:48:08Z
  GitCommit: 37b1cf5306f9c245f188c4c0566c23a0f80cdc65
  GitTreeState: clean
  GoVersion: go1.21.9
  Compiler: gc
  Platform: linux/amd64
WARN[0000] Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web. 
argocd-server: v2.10.7+b060053
  BuildDate: 2024-04-15T08:45:08Z
  GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
  GitTreeState: clean
  GoVersion: go1.21.3
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.2.1 2023-10-19T20:13:51Z
  Helm Version: v3.14.3+gf03cc04
  Kubectl Version: v0.26.11
  Jsonnet Version: v0.20.0

Logs Example command execution:

argocd app set argocd/application --kustomize-version v5.2.1
WARN[0000] Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web.
FATA[0002] rpc error: code = InvalidArgument desc = application spec for application is invalid: InvalidSpecError: Unable to generate manifests in k8s/application: rpc error: code = Unknown desc = `/kustomize-versions/v5.2.1 build .k8s/application` failed exit status 1: Error: accumulating resources: accumulation err='accumulating resources from '../../../apps/postgres-ha/overlays/application': '.k8s/apps/postgres-ha/overlays/application' must resolve to a file': recursed accumulation of path '.k8s/apps/postgres-ha/overlays/application': trouble configuring builtin HelmChartInflationGenerator with config: `%0AchartHome: ../../base/charts/%0Aname: postgresql-ha%0Anamespace: application%0AreleaseName: pgha%0Arepo: https://charts.bitnami.com/bitnami%0AvaluesFile: ../../base/values.yaml%0Aversion: 9.4.11%0A`: must specify --enable-helm

jpmaas avatar Apr 30 '24 08:04 jpmaas