Enable --disable-openapi-validation sync option when using Helm
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
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
--disable-openapi-validation is the flag of helm template, not kubectl
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-validationis 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.