Browse Source

add e2e tests for bridge convert and transformers ls commands

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 8 tháng trước cách đây
mục cha
commit
be83f63f26
33 tập tin đã thay đổi với 686 bổ sung0 xóa
  1. 59 0
      pkg/e2e/bridge_test.go
  2. 18 0
      pkg/e2e/fixtures/bridge/Dockerfile
  3. 31 0
      pkg/e2e/fixtures/bridge/compose.yaml
  4. 12 0
      pkg/e2e/fixtures/bridge/expected-helm/Chart.yaml
  5. 8 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/0-bridge-namespace.yaml
  6. 12 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/bridge-configs.yaml
  7. 13 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/my-secrets-secret.yaml
  8. 24 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/private-network-network-policy.yaml
  9. 24 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/public-network-network-policy.yaml
  10. 45 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/serviceA-deployment.yaml
  11. 19 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/serviceA-expose.yaml
  12. 25 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/serviceA-service.yaml
  13. 46 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/serviceB-deployment.yaml
  14. 19 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/serviceB-expose.yaml
  15. 21 0
      pkg/e2e/fixtures/bridge/expected-helm/templates/serviceB-service.yaml
  16. 13 0
      pkg/e2e/fixtures/bridge/expected-helm/values.yaml
  17. 8 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/0-bridge-namespace.yaml
  18. 12 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/bridge-configs.yaml
  19. 16 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/kustomization.yaml
  20. 13 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/my-secrets-secret.yaml
  21. 24 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/private-network-network-policy.yaml
  22. 24 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/public-network-network-policy.yaml
  23. 44 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceA-deployment.yaml
  24. 18 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceA-expose.yaml
  25. 23 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceA-service.yaml
  26. 45 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceB-deployment.yaml
  27. 18 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceB-expose.yaml
  28. 19 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceB-service.yaml
  29. 9 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/overlays/desktop/kustomization.yaml
  30. 13 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/overlays/desktop/serviceA-service.yaml
  31. 9 0
      pkg/e2e/fixtures/bridge/expected-kubernetes/overlays/desktop/serviceB-service.yaml
  32. 1 0
      pkg/e2e/fixtures/bridge/my-config.txt
  33. 1 0
      pkg/e2e/fixtures/bridge/not-so-secret.txt

+ 59 - 0
pkg/e2e/bridge_test.go

@@ -0,0 +1,59 @@
+/*
+   Copyright 2020 Docker Compose CLI authors
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+package e2e
+
+import (
+	"fmt"
+	"strings"
+	"testing"
+
+	"gotest.tools/v3/assert"
+)
+
+func TestConvertAndTransformList(t *testing.T) {
+	c := NewParallelCLI(t)
+
+	const projectName = "bridge"
+	tmpDir := t.TempDir()
+
+	t.Run("kubernetes manifests", func(t *testing.T) {
+		kubedir := fmt.Sprintf("%s/kubernetes", tmpDir)
+		res := c.RunDockerComposeCmd(t, "-f", "./fixtures/bridge/compose.yaml", "--project-name", projectName, "bridge", "convert",
+			"--output", kubedir)
+		assert.NilError(t, res.Error)
+		assert.Equal(t, res.ExitCode, 0)
+		res = c.RunCmd(t, "diff", "-r", kubedir, "./fixtures/bridge/expected-kubernetes")
+		assert.NilError(t, res.Error, res.Combined())
+	})
+
+	t.Run("helm charts", func(t *testing.T) {
+		helmDir := fmt.Sprintf("%s/helm", tmpDir)
+		res := c.RunDockerComposeCmd(t, "-f", "./fixtures/bridge/compose.yaml", "--project-name", projectName, "bridge", "convert",
+			"--output", helmDir, "--transformation", "docker/compose-bridge-helm")
+		assert.NilError(t, res.Error)
+		assert.Equal(t, res.ExitCode, 0)
+		res = c.RunCmd(t, "diff", "-r", helmDir, "./fixtures/bridge/expected-helm")
+		assert.NilError(t, res.Error, res.Combined())
+	})
+
+	t.Run("list transformers images", func(t *testing.T) {
+		res := c.RunDockerComposeCmd(t, "--project-name", projectName, "bridge", "transformations",
+			"ls")
+		assert.Assert(t, strings.Contains(res.Stdout(), "docker/compose-bridge-helm"), res.Combined())
+		assert.Assert(t, strings.Contains(res.Stdout(), "docker/compose-bridge-kubernetes"), res.Combined())
+	})
+}

+ 18 - 0
pkg/e2e/fixtures/bridge/Dockerfile

@@ -0,0 +1,18 @@
+#   Copyright 2020 Docker Compose CLI authors
+
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+
+#       http://www.apache.org/licenses/LICENSE-2.0
+
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+FROM alpine
+ENV ENV_FROM_DOCKERFILE=1
+EXPOSE 8081
+CMD ["echo", "Hello from Dockerfile"]

+ 31 - 0
pkg/e2e/fixtures/bridge/compose.yaml

@@ -0,0 +1,31 @@
+services:
+  serviceA:
+    image: alpine
+    build: .
+    ports:
+      - 80:8080
+    networks:
+      - private-network
+    configs:
+      - source: my-config
+        target: /etc/my-config1.txt
+  serviceB:
+    image: alpine
+    build: .
+    ports:
+      - 8081:8082
+    secrets:
+      - my-secrets
+    networks:
+      - private-network
+      - public-network
+configs:
+  my-config:
+    file: my-config.txt
+secrets:
+  my-secrets:
+    file: not-so-secret.txt
+networks:
+  private-network:
+    internal: true
+  public-network: {}

+ 12 - 0
pkg/e2e/fixtures/bridge/expected-helm/Chart.yaml

@@ -0,0 +1,12 @@
+#! Chart.yaml
+apiVersion: v2
+name: bridge
+version: 0.0.1
+# kubeVersion: >= 1.29.1
+description: A generated Helm Chart for bridge generated via compose-bridge.
+type: application
+keywords:
+    - bridge
+appVersion: 'v0.0.1'
+sources:
+annotations:

+ 8 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/0-bridge-namespace.yaml

@@ -0,0 +1,8 @@
+#! 0-bridge-namespace.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Namespace
+metadata:
+    name: bridge
+    labels:
+        com.docker.compose.project: bridge

+ 12 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/bridge-configs.yaml

@@ -0,0 +1,12 @@
+#! bridge-configs.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: ConfigMap
+metadata:
+    name: bridge
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+data:
+    my-config: |
+        My config file

+ 13 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/my-secrets-secret.yaml

@@ -0,0 +1,13 @@
+#! my-secrets-secret.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Secret
+metadata:
+    name: my-secrets
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.secret: my-secrets
+data:
+    my-secrets: bm90LXNlY3JldA==
+type: Opaque

+ 24 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/private-network-network-policy.yaml

@@ -0,0 +1,24 @@
+#! private-network-network-policy.yaml
+# Generated code, do not edit
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+    name: private-network-network-policy
+    namespace: {{ .Values.namespace }}
+spec:
+    podSelector:
+        matchLabels:
+            com.docker.compose.network.private-network: "true"
+    policyTypes:
+        - Ingress
+        - Egress
+    ingress:
+        - from:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.private-network: "true"
+    egress:
+        - to:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.private-network: "true"

+ 24 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/public-network-network-policy.yaml

@@ -0,0 +1,24 @@
+#! public-network-network-policy.yaml
+# Generated code, do not edit
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+    name: public-network-network-policy
+    namespace: {{ .Values.namespace }}
+spec:
+    podSelector:
+        matchLabels:
+            com.docker.compose.network.public-network: "true"
+    policyTypes:
+        - Ingress
+        - Egress
+    ingress:
+        - from:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.public-network: "true"
+    egress:
+        - to:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.public-network: "true"

+ 45 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/serviceA-deployment.yaml

@@ -0,0 +1,45 @@
+#! serviceA-deployment.yaml
+# Generated code, do not edit
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+    name: servicea
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+        app.kubernetes.io/managed-by: Helm
+spec:
+    replicas: 1
+    selector:
+        matchLabels:
+            com.docker.compose.project: bridge
+            com.docker.compose.service: serviceA
+    strategy:
+        type: Recreate
+    template:
+        metadata:
+            labels:
+                com.docker.compose.project: bridge
+                com.docker.compose.service: serviceA
+                com.docker.compose.network.private-network: "true"
+        spec:
+            containers:
+                - name: servicea
+                  image: {{ .Values.serviceA.image }}
+                  imagePullPolicy: {{ .Values.serviceA.imagePullPolicy }}
+                  ports:
+                    - name: servicea-8080
+                      containerPort: 8080
+                  volumeMounts:
+                    - name: etc-my-config1-txt
+                      mountPath: /etc/my-config1.txt
+                      subPath: my-config
+                      readOnly: true
+            volumes:
+                - name: etc-my-config1-txt
+                  configMap:
+                    name: bridge
+                    items:
+                        - key: my-config
+                          path: my-config

+ 19 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/serviceA-expose.yaml

@@ -0,0 +1,19 @@
+#! serviceA-expose.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: servicea
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+        app.kubernetes.io/managed-by: Helm
+spec:
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+    ports:
+        - name: servicea-8080
+          port: 8080
+          targetPort: servicea-8080

+ 25 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/serviceA-service.yaml

@@ -0,0 +1,25 @@
+# check if there is at least one published port
+
+#! serviceA-service.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: servicea-published
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+        app.kubernetes.io/managed-by: Helm
+spec:
+    type: LoadBalancer
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+    ports:
+        - name: servicea-80
+          port: 80
+          protocol: TCP
+          targetPort: servicea-8080
+
+# check if there is at least one published port

+ 46 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/serviceB-deployment.yaml

@@ -0,0 +1,46 @@
+#! serviceB-deployment.yaml
+# Generated code, do not edit
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+    name: serviceb
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+        app.kubernetes.io/managed-by: Helm
+spec:
+    replicas: 1
+    selector:
+        matchLabels:
+            com.docker.compose.project: bridge
+            com.docker.compose.service: serviceB
+    strategy:
+        type: Recreate
+    template:
+        metadata:
+            labels:
+                com.docker.compose.project: bridge
+                com.docker.compose.service: serviceB
+                com.docker.compose.network.private-network: "true"
+                com.docker.compose.network.public-network: "true"
+        spec:
+            containers:
+                - name: serviceb
+                  image: {{ .Values.serviceB.image }}
+                  imagePullPolicy: {{ .Values.serviceB.imagePullPolicy }}
+                  ports:
+                    - name: serviceb-8082
+                      containerPort: 8082
+                  volumeMounts:
+                    - name: run-secrets-my-secrets
+                      mountPath: /run/secrets/my-secrets
+                      subPath: my-secrets
+                      readOnly: true
+            volumes:
+                - name: run-secrets-my-secrets
+                  secret:
+                    secretName: my-secrets
+                    items:
+                        - key: my-secrets
+                          path: my-secrets

+ 19 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/serviceB-expose.yaml

@@ -0,0 +1,19 @@
+#! serviceB-expose.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: serviceb
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+        app.kubernetes.io/managed-by: Helm
+spec:
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+    ports:
+        - name: serviceb-8082
+          port: 8082
+          targetPort: serviceb-8082

+ 21 - 0
pkg/e2e/fixtures/bridge/expected-helm/templates/serviceB-service.yaml

@@ -0,0 +1,21 @@
+#! serviceB-service.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: serviceb-published
+    namespace: {{ .Values.namespace }}
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+        app.kubernetes.io/managed-by: Helm
+spec:
+    type: LoadBalancer
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+    ports:
+        - name: serviceb-8081
+          port: 8081
+          protocol: TCP
+          targetPort: serviceb-8082

+ 13 - 0
pkg/e2e/fixtures/bridge/expected-helm/values.yaml

@@ -0,0 +1,13 @@
+#! values.yaml
+# Namespace
+namespace: bridge
+# Services variables
+
+serviceA:
+    image: alpine
+    imagePullPolicy: IfNotPresent
+serviceB:
+    image: alpine
+    imagePullPolicy: IfNotPresent
+
+# You can apply the same logic to loop on networks, volumes, secrets and configs...

+ 8 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/0-bridge-namespace.yaml

@@ -0,0 +1,8 @@
+#! 0-bridge-namespace.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Namespace
+metadata:
+    name: bridge
+    labels:
+        com.docker.compose.project: bridge

+ 12 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/bridge-configs.yaml

@@ -0,0 +1,12 @@
+#! bridge-configs.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: ConfigMap
+metadata:
+    name: bridge
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+data:
+    my-config: |
+        My config file

+ 16 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/kustomization.yaml

@@ -0,0 +1,16 @@
+#! kustomization.yaml
+# Generated code, do not edit
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+    - 0-bridge-namespace.yaml
+    - bridge-configs.yaml
+    - my-secrets-secret.yaml
+    - private-network-network-policy.yaml
+    - public-network-network-policy.yaml
+    - serviceA-deployment.yaml
+    - serviceA-expose.yaml
+    - serviceA-service.yaml
+    - serviceB-deployment.yaml
+    - serviceB-expose.yaml
+    - serviceB-service.yaml

+ 13 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/my-secrets-secret.yaml

@@ -0,0 +1,13 @@
+#! my-secrets-secret.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Secret
+metadata:
+    name: my-secrets
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.secret: my-secrets
+data:
+    my-secrets: bm90LXNlY3JldA==
+type: Opaque

+ 24 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/private-network-network-policy.yaml

@@ -0,0 +1,24 @@
+#! private-network-network-policy.yaml
+# Generated code, do not edit
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+    name: private-network-network-policy
+    namespace: bridge
+spec:
+    podSelector:
+        matchLabels:
+            com.docker.compose.network.private-network: "true"
+    policyTypes:
+        - Ingress
+        - Egress
+    ingress:
+        - from:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.private-network: "true"
+    egress:
+        - to:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.private-network: "true"

+ 24 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/public-network-network-policy.yaml

@@ -0,0 +1,24 @@
+#! public-network-network-policy.yaml
+# Generated code, do not edit
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+    name: public-network-network-policy
+    namespace: bridge
+spec:
+    podSelector:
+        matchLabels:
+            com.docker.compose.network.public-network: "true"
+    policyTypes:
+        - Ingress
+        - Egress
+    ingress:
+        - from:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.public-network: "true"
+    egress:
+        - to:
+            - podSelector:
+                matchLabels:
+                    com.docker.compose.network.public-network: "true"

+ 44 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceA-deployment.yaml

@@ -0,0 +1,44 @@
+#! serviceA-deployment.yaml
+# Generated code, do not edit
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+    name: servicea
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+spec:
+    replicas: 1
+    selector:
+        matchLabels:
+            com.docker.compose.project: bridge
+            com.docker.compose.service: serviceA
+    strategy:
+        type: Recreate
+    template:
+        metadata:
+            labels:
+                com.docker.compose.project: bridge
+                com.docker.compose.service: serviceA
+                com.docker.compose.network.private-network: "true"
+        spec:
+            containers:
+                - name: servicea
+                  image: alpine
+                  imagePullPolicy: IfNotPresent
+                  ports:
+                    - name: servicea-8080
+                      containerPort: 8080
+                  volumeMounts:
+                    - name: etc-my-config1-txt
+                      mountPath: /etc/my-config1.txt
+                      subPath: my-config
+                      readOnly: true
+            volumes:
+                - name: etc-my-config1-txt
+                  configMap:
+                    name: bridge
+                    items:
+                        - key: my-config
+                          path: my-config

+ 18 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceA-expose.yaml

@@ -0,0 +1,18 @@
+#! serviceA-expose.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: servicea
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+spec:
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+    ports:
+        - name: servicea-8080
+          port: 8080
+          targetPort: servicea-8080

+ 23 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceA-service.yaml

@@ -0,0 +1,23 @@
+# check if there is at least one published port
+
+#! serviceA-service.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: servicea-published
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+spec:
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceA
+    ports:
+        - name: servicea-80
+          port: 80
+          protocol: TCP
+          targetPort: servicea-8080
+
+# check if there is at least one published port

+ 45 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceB-deployment.yaml

@@ -0,0 +1,45 @@
+#! serviceB-deployment.yaml
+# Generated code, do not edit
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+    name: serviceb
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+spec:
+    replicas: 1
+    selector:
+        matchLabels:
+            com.docker.compose.project: bridge
+            com.docker.compose.service: serviceB
+    strategy:
+        type: Recreate
+    template:
+        metadata:
+            labels:
+                com.docker.compose.project: bridge
+                com.docker.compose.service: serviceB
+                com.docker.compose.network.private-network: "true"
+                com.docker.compose.network.public-network: "true"
+        spec:
+            containers:
+                - name: serviceb
+                  image: alpine
+                  imagePullPolicy: IfNotPresent
+                  ports:
+                    - name: serviceb-8082
+                      containerPort: 8082
+                  volumeMounts:
+                    - name: run-secrets-my-secrets
+                      mountPath: /run/secrets/my-secrets
+                      subPath: my-secrets
+                      readOnly: true
+            volumes:
+                - name: run-secrets-my-secrets
+                  secret:
+                    secretName: my-secrets
+                    items:
+                        - key: my-secrets
+                          path: my-secrets

+ 18 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceB-expose.yaml

@@ -0,0 +1,18 @@
+#! serviceB-expose.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: serviceb
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+spec:
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+    ports:
+        - name: serviceb-8082
+          port: 8082
+          targetPort: serviceb-8082

+ 19 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/base/serviceB-service.yaml

@@ -0,0 +1,19 @@
+#! serviceB-service.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: serviceb-published
+    namespace: bridge
+    labels:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+spec:
+    selector:
+        com.docker.compose.project: bridge
+        com.docker.compose.service: serviceB
+    ports:
+        - name: serviceb-8081
+          port: 8081
+          protocol: TCP
+          targetPort: serviceb-8082

+ 9 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/overlays/desktop/kustomization.yaml

@@ -0,0 +1,9 @@
+#! kustomization.yaml
+# Generated code, do not edit
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+    - ../../base
+patches:
+    - path: serviceA-service.yaml
+    - path: serviceB-service.yaml

+ 13 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/overlays/desktop/serviceA-service.yaml

@@ -0,0 +1,13 @@
+# check if there is at least one published port
+
+#! serviceA-service.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: servicea-published
+    namespace: bridge
+spec:
+    type: LoadBalancer
+
+# check if there is at least one published port

+ 9 - 0
pkg/e2e/fixtures/bridge/expected-kubernetes/overlays/desktop/serviceB-service.yaml

@@ -0,0 +1,9 @@
+#! serviceB-service.yaml
+# Generated code, do not edit
+apiVersion: v1
+kind: Service
+metadata:
+    name: serviceb-published
+    namespace: bridge
+spec:
+    type: LoadBalancer

+ 1 - 0
pkg/e2e/fixtures/bridge/my-config.txt

@@ -0,0 +1 @@
+My config file

+ 1 - 0
pkg/e2e/fixtures/bridge/not-so-secret.txt

@@ -0,0 +1 @@
+not-secret