forked from LaconicNetwork/kompose
Merge branch 'main' into feature-1631-add-hpa
This commit is contained in:
@@ -340,6 +340,11 @@ os_output="$KOMPOSE_ROOT/script/test/fixtures/resources-lowercase/output-os.yaml
|
||||
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
|
||||
convert::expect_success "$os_cmd" "$os_output" || exit 1
|
||||
|
||||
# Test resources to generate initcontainer
|
||||
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 HPA
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/hpa/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/hpa/output-k8s.yaml"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
version: "3"
|
||||
services:
|
||||
web:
|
||||
image: nginx
|
||||
labels:
|
||||
kompose.init.containers.name: "init-myservice"
|
||||
kompose.init.containers.image: "busybox:1.28"
|
||||
kompose.init.containers.command: '["sh", "-c", "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]'
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: web
|
||||
name: web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
io.kompose.service: web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.network/initcontainer-default: "true"
|
||||
io.kompose.service: web
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx
|
||||
name: web
|
||||
initContainers:
|
||||
- command:
|
||||
- sh
|
||||
- -c
|
||||
- until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done
|
||||
image: busybox:1.28
|
||||
name: init-myservice
|
||||
restartPolicy: Always
|
||||
Reference in New Issue
Block a user