From a78c2957a23213d35a1c971fc796e1ae3d9e99de Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 30 Mar 2022 00:37:55 +0200 Subject: [PATCH] compose: add test for port mapping Signed-off-by: CrazyMax (cherry picked from commit 243b428a584c281334d048bf1db5c86daca4ada3) --- bake/compose_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bake/compose_test.go b/bake/compose_test.go index e6ad24a2..f2278ea8 100644 --- a/bake/compose_test.go +++ b/bake/compose_test.go @@ -310,6 +310,27 @@ services: require.Equal(t, c.Targets[0].Args, map[string]string{"CT_ECR": "foo", "FOO": "bsdf -csdf", "NODE_ENV": "test"}) } +func TestPorts(t *testing.T) { + var dt = []byte(` +services: + foo: + build: + context: . + ports: + - 3306:3306 + bar: + build: + context: . + ports: + - mode: ingress + target: 3306 + published: "3306" + protocol: tcp +`) + _, err := ParseCompose(dt) + require.NoError(t, err) +} + func newBool(val bool) *bool { b := val return &b