forked from LaconicNetwork/kompose
added tests
add e2e
This commit is contained in:
parent
58974092a5
commit
04acbf111f
@ -55,7 +55,6 @@ const (
|
|||||||
type DeploymentMapping struct {
|
type DeploymentMapping struct {
|
||||||
SourceDeploymentName string
|
SourceDeploymentName string
|
||||||
TargetDeploymentName string
|
TargetDeploymentName string
|
||||||
ContainerDestination []api.Container
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -339,3 +339,8 @@ os_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/resources-lowercase/compos
|
|||||||
os_output="$KOMPOSE_ROOT/script/test/fixtures/resources-lowercase/output-os.yaml"
|
os_output="$KOMPOSE_ROOT/script/test/fixtures/resources-lowercase/output-os.yaml"
|
||||||
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
|
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
|
||||||
convert::expect_success "$os_cmd" "$os_output" || exit 1
|
convert::expect_success "$os_cmd" "$os_output" || exit 1
|
||||||
|
|
||||||
|
# Test network_mode: service:
|
||||||
|
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/network-mode-service/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||||
|
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/network-mode-service/output-k8s.yaml"
|
||||||
|
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
|
||||||
17
script/test/fixtures/network-mode-service/compose.yaml
vendored
Normal file
17
script/test/fixtures/network-mode-service/compose.yaml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
client:
|
||||||
|
image: busybox
|
||||||
|
command: ['sleep', 'infinity']
|
||||||
|
container_name: threats-client
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- '8080:8080'
|
||||||
|
|
||||||
|
server:
|
||||||
|
image: busybox
|
||||||
|
command: ['sleep', 'infinity']
|
||||||
|
container_name: threats-server
|
||||||
|
restart: unless-stopped
|
||||||
|
network_mode: service:client
|
||||||
49
script/test/fixtures/network-mode-service/output-k8s.yaml
vendored
Normal file
49
script/test/fixtures/network-mode-service/output-k8s.yaml
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
io.kompose.service: client
|
||||||
|
name: client
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: "8080"
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
io.kompose.service: client
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
io.kompose.service: client
|
||||||
|
name: client
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
io.kompose.service: client
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
io.kompose.network/network-mode-service-default: "true"
|
||||||
|
io.kompose.service: client
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- args:
|
||||||
|
- sleep
|
||||||
|
- infinity
|
||||||
|
image: busybox
|
||||||
|
name: threats-client
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
hostPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
- args:
|
||||||
|
- sleep
|
||||||
|
- infinity
|
||||||
|
image: busybox
|
||||||
|
name: threats-server
|
||||||
|
restartPolicy: Always
|
||||||
Loading…
Reference in New Issue
Block a user