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

Enable --disable-openapi-validation sync option when using Helm

Open esys opened this issue 4 years ago • 2 comments

Summary

When using helm as a templating tool, charts requiring the --disable-openapi-validation cannot be installed using ArgoCD

Motivation

For example, the privatebin chart is failing to deploy because the StatefulSet object is missing the spec.serviceName field. So we have a chart that is deployable through Helm using the --disable-openapi-validation option but not with ArgoCD

Proposal

Support additional Helm flags when defining application CRD. For example:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: 
  name: privatebin
  namespace: argocd
spec:
  project: default
  source:
    repoURL: '[email protected]'
    path: helm/charts/pio-privatebin
    targetRevision: master
    helm:
      valueFiles:
        - values-custom.yaml
      releaseName: privatebin
      flags:
        # will translate to helm template ... --disable-openapi-validation=true
        disable-openapi-validation: true
  destination:
    server: 'https://kubernetes.default.svc'
    namespace: privatebin
  syncPolicy:
    syncOptions:
      - CreateNamespace=true

esys avatar Feb 01 '21 15:02 esys

You can already do this with a Validate=false sync option. See:

https://github.com/argoproj/argo-cd/blob/baa0f2e39c45b86bedc3b3cca0878c0f77253529/docs/user-guide/sync-options.md#disable-kubectl-validation

jessesuen avatar Feb 01 '21 21:02 jessesuen

--disable-openapi-validation is the flag of helm template, not kubectl

saltbo avatar Oct 12 '24 09:10 saltbo

Can we please add this option? It blocks us from using argocd for managing NVIDIA's gpu-operator that requires this flag https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/upgrade.html#option-2-automatically-upgrading-crds-using-a-helm-hook

Option --disable-openapi-validation is required in this case so that Helm will not try to validate if CR instance from the new chart is valid as per old CRD. Since CR instance in the Chart is valid for the upgraded CRD, this will be compatible.

chiragjn avatar Jul 08 '25 06:07 chiragjn