Skip to content

v3 env substitution is not working #650

Closed
@bgruening

Description

Hi,

I have a few problems with the latest kompose version and the substitutions of env vars.

bag@bag ~/temp/foo % go get -u github.com/kubernetes-incubator/kompose                                                  
bag@bag ~/temp/foo % kompose version
0.7.0 (08658d3)

This small test file:

version: "3"
services:
  web:
    image: quay.io/bgruening/galaxy-web:${IMAGE_VER:-latest}
    environment:
        - GALAXY_RUNNERS_ENABLE_K8=${GALAXY_RUNNERS_ENABLE_K8}

result in this k8s file:

bag@bag ~/temp/foo % IMAGE_VER=foo GALAXY_RUNNERS_ENABLE_K8="asdf" kompose convert -f k8.yaml && cat web-deployment.yaml
INFO Kubernetes file "web-service.yaml" created   
INFO Kubernetes file "web-deployment.yaml" created 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: web
  name: web
spec:
  replicas: 1
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: web
    spec:
      containers:
      - env:
        - name: GALAXY_RUNNERS_ENABLE_K8
        image: quay.io/bgruening/galaxy-web:latest
        name: web
        resources: {}
      restartPolicy: Always
status: {}

I tried to create an .env file

GALAXY_RUNNERS_ENABLE_K8=True
IMAGE_VER=8.9

and also exported it with no success.

- GALAXY_RUNNERS_ENABLE_K8=${GALAXY_RUNNERS_ENABLE_K8:-default} in the docker-compose.yml file will substitute it with default but not with the values available during runtime.
- GALAXY_RUNNERS_ENABLE_K8=$GALAXY_RUNNERS_ENABLE_K8 does not work at all.

Thanks a lot for any help!

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions