Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not mount ConfigMap and Secret as volume if they have same name #150

Open
yorinasub17 opened this issue Jan 3, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working p:backlog

Comments

@yorinasub17
Copy link
Contributor

Describe the bug
If you have a ConfigMap and Secret that has the same name, you can't mount both as a volume due to a volume name collision. This is because the template will name both volumes as NAME-volume.

The proposed fix is to support specifying a custom volume name to avoid the collision. E.g.,

configMaps:
  myconfig:
    as: volume
    mountPath: /etc/myconfig/config
    volumeName: myconfig-configmap-volume

To Reproduce

  • Create a ConfigMap and Secret that has the same name (e.g., myconfig).
  • Try to mount both as volumes:
configMaps:
  myconfig:
    as: volume
    mountPath: /etc/myconfig/config

secrets:
  myconfig:
    as: volume
    mountPath: /etc/myconfig/secrets

Expected behavior
Mount both the ConfigMap and Secret as a volume.

Actual behavior
Error:

Helm install failed: Deployment.apps "myapp" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "myconfig-volume"
@yorinasub17 yorinasub17 added the bug Something isn't working label Jan 3, 2023
@autero1 autero1 self-assigned this Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p:backlog
Projects
None yet
Development

No branches or pull requests

2 participants