forked from LaconicNetwork/kompose
add e2e to check env var with status value
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
This commit is contained in:
parent
a19dd1416e
commit
154c6f63c0
@ -344,3 +344,11 @@ convert::expect_success "$os_cmd" "$os_output" || exit 1
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/initcontainer/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/initcontainer/output-k8s.yaml"
|
||||
convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1
|
||||
|
||||
# Test env var with status
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/envvars-with-status/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/envvars-with-status/output-k8s.yaml"
|
||||
os_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/envvars-with-status/compose.yaml convert --provider openshift --stdout --with-kompose-annotation=false"
|
||||
os_output="$KOMPOSE_ROOT/script/test/fixtures/envvars-with-status/output-os.yaml"
|
||||
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
|
||||
convert::expect_success "$os_cmd" "$os_output" || exit 1
|
||||
|
||||
9
script/test/fixtures/envvars-with-status/compose.yaml
vendored
Normal file
9
script/test/fixtures/envvars-with-status/compose.yaml
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
services:
|
||||
app:
|
||||
image: node:18-alpine
|
||||
command: sh -c "yarn install && yarn run dev"
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
TOPICS: foo:1,status:2,bar:3
|
||||
OTHER_ENV: example
|
||||
50
script/test/fixtures/envvars-with-status/output-k8s.yaml
vendored
Normal file
50
script/test/fixtures/envvars-with-status/output-k8s.yaml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: app
|
||||
name: app
|
||||
spec:
|
||||
ports:
|
||||
- name: "3000"
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
selector:
|
||||
io.kompose.service: app
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: app
|
||||
name: app
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
io.kompose.service: app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.network/envvars-with-status-default: "true"
|
||||
io.kompose.service: app
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- sh
|
||||
- -c
|
||||
- yarn install && yarn run dev
|
||||
env:
|
||||
- name: OTHER_ENV
|
||||
value: example
|
||||
- name: TOPICS
|
||||
value: foo:1,status:2,bar:3
|
||||
image: node:18-alpine
|
||||
name: app
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
hostPort: 3000
|
||||
protocol: TCP
|
||||
restartPolicy: Always
|
||||
78
script/test/fixtures/envvars-with-status/output-os.yaml
vendored
Normal file
78
script/test/fixtures/envvars-with-status/output-os.yaml
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: app
|
||||
name: app
|
||||
spec:
|
||||
ports:
|
||||
- name: "3000"
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
selector:
|
||||
io.kompose.service: app
|
||||
|
||||
---
|
||||
apiVersion: apps.openshift.io/v1
|
||||
kind: DeploymentConfig
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: app
|
||||
name: app
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
io.kompose.service: app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.network/envvars-with-status-default: "true"
|
||||
io.kompose.service: app
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- sh
|
||||
- -c
|
||||
- yarn install && yarn run dev
|
||||
env:
|
||||
- name: OTHER_ENV
|
||||
value: example
|
||||
- name: TOPICS
|
||||
value: foo:1,status:2,bar:3
|
||||
image: ' '
|
||||
name: app
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
hostPort: 3000
|
||||
protocol: TCP
|
||||
restartPolicy: Always
|
||||
test: false
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- imageChangeParams:
|
||||
automatic: true
|
||||
containerNames:
|
||||
- app
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
name: app:18-alpine
|
||||
type: ImageChange
|
||||
|
||||
---
|
||||
apiVersion: image.openshift.io/v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: app
|
||||
name: app
|
||||
spec:
|
||||
lookupPolicy:
|
||||
local: false
|
||||
tags:
|
||||
- from:
|
||||
kind: DockerImage
|
||||
name: node:18-alpine
|
||||
name: 18-alpine
|
||||
referencePolicy:
|
||||
type: ""
|
||||
Loading…
Reference in New Issue
Block a user