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

No variable interpolation in label name #708

Open
benzht opened this issue Jun 11, 2023 · 1 comment
Open

No variable interpolation in label name #708

benzht opened this issue Jun 11, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@benzht
Copy link

benzht commented Jun 11, 2023

Describe the bug
Variable interpolation from .env file is not happening everywhere where expected. In the following excerpt for labels for a traefik frontend, the env-variable PROJECT_NAME is interpolated only at the right of the = character, but not on the left

    labels:
      - "traefik.http.routers.${PROJECT_NAME}_VB_secure.rule=Host(`${HOST_NAME}`)"
      - testThis.${PROJECT_NAME}=${PROJECT_NAME}

With

PROJECT_NAME=testproject
HOST_NAME=www.example.com

The actually resulting labels look like this:

                "--label",
                "testThis.${PROJECT_NAME}=testproject",
                "--label",
                "traefik.http.routers.${PROJECT_NAME}_VB_secure.rule=Host(`www.example.com`)",

Expected outcome would be:

                "--label",
                "testThis.testproject=testproject",
                "--label",
                "traefik.http.routers.testproject_VB_secure.rule=Host(`www.example.com`)",

To Reproduce
Take any podman-compose file you have available, add the labels like show above, and define the variables in your .env file. Start the container and observe the generated podman command or inspect the created container.

Environment:

  • OS: Ubuntu 22.04.2 LTS
  • podman version:
$ podman version
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.17.3
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/amd64
  • podman compose version:
$ podman-compose version
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 3.4.4
podman-compose version 1.0.6
podman --version
podman version 3.4.4
exit code: 0
@ngolatka
Copy link

ngolatka commented Sep 10, 2024

Can confirm this exact problem.

podman version
Client:       Podman Engine
Version:      4.9.4-rhel
API Version:  4.9.4-rhel
Go Version:   go1.21.11 (Red Hat 1.21.11-1.el9_4)
Built:        Mon Jul  1 12:27:14 2024
OS/Arch:      linux/amd64
podman-compose version: 1.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants