kubernetes-csi / csi-driver-nfs

This driver allows Kubernetes to access NFS server on Linux node.
Apache License 2.0
765 stars 236 forks source link

wrong chart intent when using multiple mountOptions #668

Closed efficacy38 closed 1 month ago

efficacy38 commented 1 month ago

What happened: when using the multiple mount option in the helm chart value, it would get the following error.

YAML parse error on csi-driver-nfs/templates/storageclass.yaml: error converting YAML to JSON: yaml: line 18: did not find expected key","errorVerbose":"error converting YAML to JSON: yaml: line 18: did not find expected key
YAML parse error on csi-driver-nfs/templates/storageclass.yaml
helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort
        helm.sh/helm/v3@v3.13.3/pkg/releaseutil/manifest_sorter.go:146
helm.sh/helm/v3/pkg/releaseutil.SortManifests
        helm.sh/helm/v3@v3.13.3/pkg/releaseutil/manifest_sorter.go:106
helm.sh/helm/v3/pkg/action.(*Configuration).renderResources
        helm.sh/helm/v3@v3.13.3/pkg/action/action.go:168
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
        helm.sh/helm/v3@v3.13.3/pkg/action/install.go:304
github.com/fluxcd/helm-controller/internal/action.Install
        github.com/fluxcd/helm-controller/internal/action/install.go:62
github.com/fluxcd/helm-controller/internal/reconcile.(*Install).Reconcile
        github.com/fluxcd/helm-controller/internal/reconcile/install.go:92
github.com/fluxcd/helm-controller/internal/reconcile.(*AtomicRelease).Reconcile
        github.com/fluxcd/helm-controller/internal/reconcile/atomic_release.go:252
github.com/fluxcd/helm-controller/internal/controller.(*HelmReleaseReconciler).reconcileRelease
        github.com/fluxcd/helm-controller/internal/controller/helmrelease_controller.go:387
github.com/fluxcd/helm-controller/internal/controller.(*HelmReleaseReconciler).Reconcile
        github.com/fluxcd/helm-controller/internal/controller/helmrelease_controller.go:220
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:119
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:316
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:227
runtime.goexit
        runtime/asm_amd64.s:1650

What you expected to happen: it should indent all of the mountOptions.

How to reproduce it: using the following values.yaml.

storageClass:
  create: true
  name: csi-driver-nfs
  parameters:
    server: "1.1.1.1"
    share: "/share"
  reclaimPolicy: Delete
  volumeBindingMode: Immediate
  mountOptions:
    - nfsvers=4.1
    - async

Anything else we need to know?:

Environment: