Skip to content

[BUG] Multiple secrets for single service result in non-unique "mountPath" error #1894

@gramian

Description

@gramian

Expected Behavior

Multiple secrets for a single service are correctly translated.

Actual Behavior

"kubectl" reports:

Error from server (Invalid): error when creating "service-deployment.yaml": Deployment.apps "service" is invalid: spec.template.spec.containers[0].volumeMounts[1].mountPath: Invalid value: "/run/secrets": must be unique

Steps To Reproduce

  1. Prepare first secret: echo -n 'password1' > textfile1
  2. Prepare second secret: echo -n 'password2' > textfile2
  3. kompose convert -f compose.yaml
  4. minikube start
  5. kubectl apply -f .

Kompose Version

1.34 (cbf2835db)

Docker-Compose file

name: "test"

secrets:
  "secret1":
    file: "textfile1"
  "secret2":
    file: "textfile2"

services:

  "service":
    image: "hello-world:latest"
    ports:
      - "80:80"
    secrets:
      - "secret1"
      - "secret2"

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions