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

[BUG] Filepath issue when converting/loading env file from docker-compose env_file #1678

Closed
ycordier-pro opened this issue Jul 20, 2023 · 2 comments · Fixed by #1679
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ycordier-pro
Copy link

Expected Behavior

Hello,

It seems that with the latest version of kompose (1.30.0), there is a regression with the management of env_file.
I have a docker-compose.yaml with a properties.env file at the same level and some service definitions with :

[...]
    env_file:
      - properties.env
[...]

With version 1.29.0 of kompose, everything works fine and it generates a ConfigMap file named "properties-env-configmap.yaml" holding these values, but with version 1.30.0, I get an error like :

$ pwd
/work
$ kompose version
1.30.0 (9d8dcb518)
$ ls
docker-compose.yaml   properties.env
$ kompose -f docker-compose.yaml convert
FATA Unable to retrieve env file: Unable to read env_file: open /work/work/properties.env: no such file or directory

The path in the error contains twice the directory where the docker-compose.yaml file resides.
Thanks for looking into it !

Actual Behavior

kompose version 1.30.0 doesn't handle env_file path correctly anymore

Steps To Reproduce

Create a simple docker-compose.yaml file with an "env_file" section
Run kompose convert
Check for the path error

Kompose Version

1.30.0 (9d8dcb518)

Docker-Compose file

[...]
    env_file:
      - properties.env
[...]

Anything else?

Here's the output with debug enabled if it can be of any help :

$ kompose -v -f docker-compose.yaml convert
DEBU Checking validation of provider: kubernetes
DEBU Checking validation of controller:
DEBU Compose file dir: /work
FATA Unable to retrieve env file: Unable to read env_file: open /work/work/properties.env: no such file or directory
@ycordier-pro ycordier-pro added the kind/bug Categorizes issue or PR as related to a bug. label Jul 20, 2023
@AhmedGrati
Copy link
Contributor

Thanks @ycordier-pro for opening this issue.
/assign

@ycordier-pro
Copy link
Author

Thanks guys for fixing this !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants