From 58332b16e5b86561c31b2adb2f11197fc44e676f Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 22 Jun 2021 20:55:06 +1000 Subject: [PATCH] Open port 443 by default (#324) Signed-off-by: Karl Hepworth --- service/haproxy/haproxy.go | 6 ++++++ service/haproxy/haproxy_test.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/service/haproxy/haproxy.go b/service/haproxy/haproxy.go index b7214cba..8de52477 100644 --- a/service/haproxy/haproxy.go +++ b/service/haproxy/haproxy.go @@ -51,6 +51,12 @@ func NewDefaultPorts() model.Service { HostPort: "80", }, }, + "443/tcp": []nat.PortBinding{ + { + HostIP: "", + HostPort: "443", + }, + }, }, }, } diff --git a/service/haproxy/haproxy_test.go b/service/haproxy/haproxy_test.go index 614181fa..52a75b06 100644 --- a/service/haproxy/haproxy_test.go +++ b/service/haproxy/haproxy_test.go @@ -31,6 +31,6 @@ func Test(t *testing.T) { So(obj.HostConfig.PortBindings, ShouldEqual, nil) So(obj.HostConfig.RestartPolicy.Name, ShouldEqual, "unless-stopped") So(obj.HostConfig.RestartPolicy.MaximumRetryCount, ShouldEqual, 0) - So(fmt.Sprint(objPorts.HostConfig.PortBindings), ShouldEqual, fmt.Sprint(nat.PortMap{"80/tcp": []nat.PortBinding{{HostIP: "", HostPort: "80"}}})) + So(fmt.Sprint(objPorts.HostConfig.PortBindings), ShouldEqual, fmt.Sprint(nat.PortMap{"80/tcp": []nat.PortBinding{{HostIP: "", HostPort: "80"}}, "443/tcp": []nat.PortBinding{{HostIP: "", HostPort: "443"}}})) }) }