Thanks to visit codestin.com
Credit goes to github.com

Skip to content

helm chart: filter out volumeMounts parameters from volumes #1266

@mnacharov

Description

@mnacharov

Describe the bug
To specify additional volumes and volumeMounts for the manager container a single array parameter .Values.controller.manager.volumes is used.

The {{- define "vso.controller.volumeMounts" -}} helper passes only name, mountPath and readOnly parameters, so the chart generates a clear volumeMounts array.

On the other hand, the {{- define "vso.controller.volumes" -}} helper doesn't filter out mountPath and readOnly parameters, which have no sense in the volumes array.

To Reproduce
Steps to reproduce the behavior:

  1. Create values.yaml:
    controller:
      manager:
        volumes:
        - name: test
          emptyDir: {}
          mountPath: /mnt
          readOnly: false
    
  2. helm install:
    $ helm install --version 1.3.0 --namespace vault-secrets-operator vault-secrets-operator --create-namespace -f values.yaml hashicorp/vault-secrets-operator
    Error: INSTALLATION FAILED: failed to create typed patch object (vault-secrets-operator/vault-secrets-operator-controller-manager; apps/v1, Kind=Deployment): .spec.template.spec.volumes[name="test"].mountPath: field not declared in schema
    
    ❗ Error occurred ⤴️
  3. Deployment haven't been installed:
    $ kubectl -n vault-secrets-operator get deploy
    No resources found in vault-secrets-operator namespace.
    

Expected behavior

VSO should be created with custom volume. The mountPath and readOnly fields should be filtered out from volumes array.

Environment

  • Kubernetes version: v1.35.1
    • Distribution or cloud vendor (OpenShift, EKS, GKE, AKS, etc.): minikube version: v1.38.1
    • Other configuration options or runtime services (istio, etc.): -
  • vault-secrets-operator version: 1.3.0

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions