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] pod env_file does not create configmaps #1683

Closed
realgam3 opened this issue Aug 4, 2023 · 3 comments · Fixed by #1684
Closed

[BUG] pod env_file does not create configmaps #1683

realgam3 opened this issue Aug 4, 2023 · 3 comments · Fixed by #1684
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@realgam3
Copy link
Contributor

realgam3 commented Aug 4, 2023

Expected Behavior

docker-compose:

version: "3"

services:
  pod:
    image: busybox
    env_file:
      - "envs/pod.env"
    restart: "no"

  deployment:
    image: busybox
    env_file:
      - "envs/deployment.env"
    restart: "always"
  • Should create 2 ConfigMaps: envs-deployment-env & envs-pod-env.

Actual Behavior

Creates only 1 ConfigMap: envs-deployment-env

  • in Windows it fails to create any ConfigMap.
    reason: service.EnvFile is not relative and it cause issues with some functions.

Steps To Reproduce

  1. Create envs directory
  2. Create 2 files envs/deployment.env and envs/pod.env with the contents of TEST=TEST
  3. Run command: kompose convert

Kompose Version

1.30.0 
Branch: main
Commit: 17fbe3b4632cca0f61a7fda5f3b91034cdf5c5e4

Docker-Compose file

version: "3"

services:
  pod:
    image: busybox
    env_file:
      - "envs/pod.env"
    restart: "no"

  deployment:
    image: busybox
    env_file:
      - "envs/deployment.env"
    restart: "always"

Anything else?

No response

@realgam3 realgam3 added the kind/bug Categorizes issue or PR as related to a bug. label Aug 4, 2023
realgam3 added a commit to realgam3/kompose that referenced this issue Aug 4, 2023
@xinmans
Copy link

xinmans commented Aug 17, 2023

same issue when use env file in docker-compose, hope will fix

env_file: ./.env
ports:
- $NESTJS_APP1_LOCAL_PORT:$NESTJS_APP_DOCKER_PORT
WARN The "MYSQLDB_LOCAL_PORT" variable is not set. Defaulting to a blank string.
WARN The "NESTJS_APP2_LOCAL_PORT" variable is not set. Defaulting to a blank string.
WARN The "NESTJS_APP_DOCKER_PORT" variable is not set. Defaulting to a blank string.
FATA Unable to load files: 1 error(s) decoding:

  • error decoding 'ports': No port specified: :

@realgam3
Copy link
Contributor Author

realgam3 commented Aug 18, 2023

same issue when use env file in docker-compose, hope will fix

env_file: ./.env ports: - $NESTJS_APP1_LOCAL_PORT:$NESTJS_APP_DOCKER_PORT WARN The "MYSQLDB_LOCAL_PORT" variable is not set. Defaulting to a blank string. WARN The "NESTJS_APP2_LOCAL_PORT" variable is not set. Defaulting to a blank string. WARN The "NESTJS_APP_DOCKER_PORT" variable is not set. Defaulting to a blank string. FATA Unable to load files: 1 error(s) decoding:

  • error decoding 'ports': No port specified: :

Can you check if my pull request fixes the issue? :)

Edit: It worked just fine!

@zhukai242
Copy link

same

realgam3 added a commit to realgam3/kompose that referenced this issue Dec 16, 2023
cdrage pushed a commit that referenced this issue Jan 2, 2024
* fix issue #1683

* add tests, die if inputfiles not specified

* fix GetComposeFileDir function and use it

* use fixed GetComposeFileDir instead of filepath.Dir

* return error instead of fatal

* add pod configmap creation to openshift
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.

3 participants