Fix: Make the out flag print to one file using seperator (#1541)

* fix: make the out flag print to one file using seperator

* fix: comment an unused function

* fix: update test script

* fix: update output k8s

* fix: update the json output error condition

* fix: update envvars interpolation tests

* chore: update e2e tests to support yaml generation instead of JSON format

* fix: update e2e tests according to ci environment

* fix: apply PR changes
This commit is contained in:
AhmedGrati
2022-12-01 09:47:50 +01:00
committed by GitHub
parent 4c14b06333
commit 91391eb84f
63 changed files with 4919 additions and 7499 deletions
-397
View File
@@ -1,397 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"ports": [
{
"name": "6379",
"port": 6379,
"targetPort": 6379
},
{
"name": "6379-udp",
"protocol": "UDP",
"port": 6379,
"targetPort": 6379
},
{
"name": "3000",
"port": 3000,
"targetPort": 3000
},
{
"name": "3000-tcp",
"port": 3000,
"targetPort": 3000
},
{
"name": "3001",
"port": 3001,
"targetPort": 3001
},
{
"name": "3002",
"port": 3002,
"targetPort": 3002
},
{
"name": "3003",
"port": 3003,
"targetPort": 3003
},
{
"name": "3004",
"port": 3004,
"targetPort": 3004
},
{
"name": "3005",
"port": 3005,
"targetPort": 3005
},
{
"name": "8000",
"port": 8000,
"targetPort": 8000
},
{
"name": "9090",
"port": 9090,
"targetPort": 8080
},
{
"name": "9091",
"port": 9091,
"targetPort": 8081
},
{
"name": "49100",
"port": 49100,
"targetPort": 22
},
{
"name": "8001",
"port": 8001,
"targetPort": 8001
},
{
"name": "5000",
"port": 5000,
"targetPort": 5000
},
{
"name": "5001",
"port": 5001,
"targetPort": 5001
},
{
"name": "5002",
"port": 5002,
"targetPort": 5002
},
{
"name": "5003",
"port": 5003,
"targetPort": 5003
},
{
"name": "5004",
"port": 5004,
"targetPort": 5004
},
{
"name": "5005",
"port": 5005,
"targetPort": 5005
},
{
"name": "5006",
"port": 5006,
"targetPort": 5006
},
{
"name": "5007",
"port": 5007,
"targetPort": 5007
},
{
"name": "5008",
"port": 5008,
"targetPort": 5008
},
{
"name": "5009",
"port": 5009,
"targetPort": 5009
},
{
"name": "5010",
"port": 5010,
"targetPort": 5010
}
],
"selector": {
"io.kompose.service": "foo"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "redis-tcp",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis-tcp"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"ports": [
{
"name": "6379",
"port": 6379,
"targetPort": 6379
}
],
"selector": {
"io.kompose.service": "redis"
},
"type": "LoadBalancer"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "redis-udp",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis-udp"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"ports": [
{
"name": "1234",
"protocol": "UDP",
"port": 1234,
"targetPort": 1235
}
],
"selector": {
"io.kompose.service": "redis"
},
"type": "LoadBalancer"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foobar",
"ports": [
{
"containerPort": 6379
},
{
"containerPort": 6379,
"protocol": "UDP"
},
{
"containerPort": 3000
},
{
"containerPort": 3001
},
{
"containerPort": 3002
},
{
"containerPort": 3003
},
{
"containerPort": 3004
},
{
"containerPort": 3005
},
{
"containerPort": 8000
},
{
"containerPort": 8080
},
{
"containerPort": 8081
},
{
"containerPort": 22
},
{
"containerPort": 8001,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5000,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5001,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5002,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5003,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5004,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5005,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5006,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5007,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5008,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5009,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5010,
"hostIP": "127.0.0.1"
}
],
"env": [
{
"name": "GITHUB",
"value": "surajssd"
}
],
"resources": {
"limits": {
"memory": "10e3"
}
}
}
],
"restartPolicy": "Never",
"securityContext": {
"supplementalGroups": [
1234
]
}
},
"status": {}
},
{
"kind": "Deployment",
"apiVersion": "apps/v1",
"metadata": {
"name": "redis",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"io.kompose.service": "redis"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"containers": [
{
"name": "redis",
"image": "redis:3.0",
"ports": [
{
"containerPort": 6379
},
{
"containerPort": 1235,
"protocol": "UDP"
}
],
"resources": {
"limits": {
"memory": "10485760e3"
}
}
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
}
]
}
+233
View File
@@ -0,0 +1,233 @@
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: foo
name: foo
spec:
ports:
- name: "6379"
port: 6379
targetPort: 6379
- name: 6379-udp
port: 6379
protocol: UDP
targetPort: 6379
- name: "3000"
port: 3000
targetPort: 3000
- name: 3000-tcp
port: 3000
targetPort: 3000
- name: "3001"
port: 3001
targetPort: 3001
- name: "3002"
port: 3002
targetPort: 3002
- name: "3003"
port: 3003
targetPort: 3003
- name: "3004"
port: 3004
targetPort: 3004
- name: "3005"
port: 3005
targetPort: 3005
- name: "8000"
port: 8000
targetPort: 8000
- name: "9090"
port: 9090
targetPort: 8080
- name: "9091"
port: 9091
targetPort: 8081
- name: "49100"
port: 49100
targetPort: 22
- name: "8001"
port: 8001
targetPort: 8001
- name: "5000"
port: 5000
targetPort: 5000
- name: "5001"
port: 5001
targetPort: 5001
- name: "5002"
port: 5002
targetPort: 5002
- name: "5003"
port: 5003
targetPort: 5003
- name: "5004"
port: 5004
targetPort: 5004
- name: "5005"
port: 5005
targetPort: 5005
- name: "5006"
port: 5006
targetPort: 5006
- name: "5007"
port: 5007
targetPort: 5007
- name: "5008"
port: 5008
targetPort: 5008
- name: "5009"
port: 5009
targetPort: 5009
- name: "5010"
port: 5010
targetPort: 5010
selector:
io.kompose.service: foo
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis-tcp
name: redis-tcp
spec:
ports:
- name: "6379"
port: 6379
targetPort: 6379
selector:
io.kompose.service: redis
type: LoadBalancer
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis-udp
name: redis-udp
spec:
ports:
- name: "1234"
port: 1234
protocol: UDP
targetPort: 1235
selector:
io.kompose.service: redis
type: LoadBalancer
status:
loadBalancer: {}
---
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
io.kompose.service: foo
name: foo
spec:
containers:
- env:
- name: GITHUB
value: surajssd
image: foobar
name: foo
ports:
- containerPort: 6379
- containerPort: 6379
protocol: UDP
- containerPort: 3000
- containerPort: 3001
- containerPort: 3002
- containerPort: 3003
- containerPort: 3004
- containerPort: 3005
- containerPort: 8000
- containerPort: 8080
- containerPort: 8081
- containerPort: 22
- containerPort: 8001
hostIP: 127.0.0.1
- containerPort: 5000
hostIP: 127.0.0.1
- containerPort: 5001
hostIP: 127.0.0.1
- containerPort: 5002
hostIP: 127.0.0.1
- containerPort: 5003
hostIP: 127.0.0.1
- containerPort: 5004
hostIP: 127.0.0.1
- containerPort: 5005
hostIP: 127.0.0.1
- containerPort: 5006
hostIP: 127.0.0.1
- containerPort: 5007
hostIP: 127.0.0.1
- containerPort: 5008
hostIP: 127.0.0.1
- containerPort: 5009
hostIP: 127.0.0.1
- containerPort: 5010
hostIP: 127.0.0.1
resources:
limits:
memory: "10e3"
restartPolicy: Never
securityContext:
supplementalGroups:
- 1234
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis
name: redis
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: redis
strategy: {}
template:
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis
spec:
containers:
- image: redis:3.0
name: redis
ports:
- containerPort: 6379
- containerPort: 1235
protocol: UDP
resources:
limits:
memory: "10485760e3"
restartPolicy: Always
status: {}
-454
View File
@@ -1,454 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"ports": [
{
"name": "6379",
"port": 6379,
"targetPort": 6379
},
{
"name": "6379-udp",
"protocol": "UDP",
"port": 6379,
"targetPort": 6379
},
{
"name": "3000",
"port": 3000,
"targetPort": 3000
},
{
"name": "3000-tcp",
"port": 3000,
"targetPort": 3000
},
{
"name": "3001",
"port": 3001,
"targetPort": 3001
},
{
"name": "3002",
"port": 3002,
"targetPort": 3002
},
{
"name": "3003",
"port": 3003,
"targetPort": 3003
},
{
"name": "3004",
"port": 3004,
"targetPort": 3004
},
{
"name": "3005",
"port": 3005,
"targetPort": 3005
},
{
"name": "8000",
"port": 8000,
"targetPort": 8000
},
{
"name": "9090",
"port": 9090,
"targetPort": 8080
},
{
"name": "9091",
"port": 9091,
"targetPort": 8081
},
{
"name": "49100",
"port": 49100,
"targetPort": 22
},
{
"name": "8001",
"port": 8001,
"targetPort": 8001
},
{
"name": "5000",
"port": 5000,
"targetPort": 5000
},
{
"name": "5001",
"port": 5001,
"targetPort": 5001
},
{
"name": "5002",
"port": 5002,
"targetPort": 5002
},
{
"name": "5003",
"port": 5003,
"targetPort": 5003
},
{
"name": "5004",
"port": 5004,
"targetPort": 5004
},
{
"name": "5005",
"port": 5005,
"targetPort": 5005
},
{
"name": "5006",
"port": 5006,
"targetPort": 5006
},
{
"name": "5007",
"port": 5007,
"targetPort": 5007
},
{
"name": "5008",
"port": 5008,
"targetPort": 5008
},
{
"name": "5009",
"port": 5009,
"targetPort": 5009
},
{
"name": "5010",
"port": 5010,
"targetPort": 5010
}
],
"selector": {
"io.kompose.service": "foo"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "redis-tcp",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis-tcp"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"ports": [
{
"name": "6379",
"port": 6379,
"targetPort": 6379
}
],
"selector": {
"io.kompose.service": "redis"
},
"type": "LoadBalancer"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "redis-udp",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis-udp"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"ports": [
{
"name": "1234",
"protocol": "UDP",
"port": 1234,
"targetPort": 1235
}
],
"selector": {
"io.kompose.service": "redis"
},
"type": "LoadBalancer"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foobar",
"ports": [
{
"containerPort": 6379
},
{
"containerPort": 6379,
"protocol": "UDP"
},
{
"containerPort": 3000
},
{
"containerPort": 3001
},
{
"containerPort": 3002
},
{
"containerPort": 3003
},
{
"containerPort": 3004
},
{
"containerPort": 3005
},
{
"containerPort": 8000
},
{
"containerPort": 8080
},
{
"containerPort": 8081
},
{
"containerPort": 22
},
{
"containerPort": 8001,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5000,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5001,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5002,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5003,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5004,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5005,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5006,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5007,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5008,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5009,
"hostIP": "127.0.0.1"
},
{
"containerPort": 5010,
"hostIP": "127.0.0.1"
}
],
"env": [
{
"name": "GITHUB",
"value": "surajssd"
}
],
"resources": {
"limits": {
"memory": "10e3"
}
}
}
],
"restartPolicy": "Never",
"securityContext": {
"supplementalGroups": [
1234
]
}
},
"status": {}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "redis",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
},
"annotations": {
"kompose.service.type": "loadbalancer"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"redis"
],
"from": {
"kind": "ImageStreamTag",
"name": "redis:3.0"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "redis"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
}
},
"spec": {
"containers": [
{
"name": "redis",
"image": " ",
"ports": [
{
"containerPort": 6379
},
{
"containerPort": 1235,
"protocol": "UDP"
}
],
"resources": {
"limits": {
"memory": "10485760e3"
}
}
}
],
"restartPolicy": "Always"
}
}
},
"status": {
"latestVersion": 0,
"observedGeneration": 0,
"replicas": 0,
"updatedReplicas": 0,
"availableReplicas": 0,
"unavailableReplicas": 0
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "redis",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
}
},
"spec": {
"lookupPolicy": {
"local": false
},
"tags": [
{
"name": "3.0",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "redis:3.0"
},
"generation": null,
"importPolicy": {},
"referencePolicy": {
"type": ""
}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}
+272
View File
@@ -0,0 +1,272 @@
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: foo
name: foo
spec:
ports:
- name: "6379"
port: 6379
targetPort: 6379
- name: 6379-udp
port: 6379
protocol: UDP
targetPort: 6379
- name: "3000"
port: 3000
targetPort: 3000
- name: 3000-tcp
port: 3000
targetPort: 3000
- name: "3001"
port: 3001
targetPort: 3001
- name: "3002"
port: 3002
targetPort: 3002
- name: "3003"
port: 3003
targetPort: 3003
- name: "3004"
port: 3004
targetPort: 3004
- name: "3005"
port: 3005
targetPort: 3005
- name: "8000"
port: 8000
targetPort: 8000
- name: "9090"
port: 9090
targetPort: 8080
- name: "9091"
port: 9091
targetPort: 8081
- name: "49100"
port: 49100
targetPort: 22
- name: "8001"
port: 8001
targetPort: 8001
- name: "5000"
port: 5000
targetPort: 5000
- name: "5001"
port: 5001
targetPort: 5001
- name: "5002"
port: 5002
targetPort: 5002
- name: "5003"
port: 5003
targetPort: 5003
- name: "5004"
port: 5004
targetPort: 5004
- name: "5005"
port: 5005
targetPort: 5005
- name: "5006"
port: 5006
targetPort: 5006
- name: "5007"
port: 5007
targetPort: 5007
- name: "5008"
port: 5008
targetPort: 5008
- name: "5009"
port: 5009
targetPort: 5009
- name: "5010"
port: 5010
targetPort: 5010
selector:
io.kompose.service: foo
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis-tcp
name: redis-tcp
spec:
ports:
- name: "6379"
port: 6379
targetPort: 6379
selector:
io.kompose.service: redis
type: LoadBalancer
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis-udp
name: redis-udp
spec:
ports:
- name: "1234"
port: 1234
protocol: UDP
targetPort: 1235
selector:
io.kompose.service: redis
type: LoadBalancer
status:
loadBalancer: {}
---
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
io.kompose.service: foo
name: foo
spec:
containers:
- env:
- name: GITHUB
value: surajssd
image: foobar
name: foo
ports:
- containerPort: 6379
- containerPort: 6379
protocol: UDP
- containerPort: 3000
- containerPort: 3001
- containerPort: 3002
- containerPort: 3003
- containerPort: 3004
- containerPort: 3005
- containerPort: 8000
- containerPort: 8080
- containerPort: 8081
- containerPort: 22
- containerPort: 8001
hostIP: 127.0.0.1
- containerPort: 5000
hostIP: 127.0.0.1
- containerPort: 5001
hostIP: 127.0.0.1
- containerPort: 5002
hostIP: 127.0.0.1
- containerPort: 5003
hostIP: 127.0.0.1
- containerPort: 5004
hostIP: 127.0.0.1
- containerPort: 5005
hostIP: 127.0.0.1
- containerPort: 5006
hostIP: 127.0.0.1
- containerPort: 5007
hostIP: 127.0.0.1
- containerPort: 5008
hostIP: 127.0.0.1
- containerPort: 5009
hostIP: 127.0.0.1
- containerPort: 5010
hostIP: 127.0.0.1
resources:
limits:
memory: "10e3"
restartPolicy: Never
securityContext:
supplementalGroups:
- 1234
status: {}
---
apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
kompose.service.type: loadbalancer
creationTimestamp: null
labels:
io.kompose.service: redis
name: redis
spec:
replicas: 1
selector:
io.kompose.service: redis
strategy:
resources: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: redis
spec:
containers:
- image: ' '
name: redis
ports:
- containerPort: 6379
- containerPort: 1235
protocol: UDP
resources:
limits:
memory: "10485760e3"
restartPolicy: Always
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- redis
from:
kind: ImageStreamTag
name: redis:3.0
type: ImageChange
status:
availableReplicas: 0
latestVersion: 0
observedGeneration: 0
replicas: 0
unavailableReplicas: 0
updatedReplicas: 0
---
apiVersion: v1
kind: ImageStream
metadata:
creationTimestamp: null
labels:
io.kompose.service: redis
name: redis
spec:
lookupPolicy:
local: false
tags:
- annotations: null
from:
kind: DockerImage
name: redis:3.0
generation: null
importPolicy: {}
name: "3.0"
referencePolicy:
type: ""
status:
dockerImageRepository: ""