From f944c146d3bdc837bf18df3d54044db45b701161 Mon Sep 17 00:00:00 2001 From: moshebe Date: Wed, 30 Sep 2020 21:08:06 +0300 Subject: [PATCH] upgrade golang 1.14 to 1.15.2 (#42) --- README.md | 2 +- doc.go | 2 +- pkg/config/config_test.go | 12 ++++++------ pkg/config/render_test.go | 4 ++-- pkg/config/testdata/generate_docker_compose_0.in | 2 +- pkg/config/testdata/generate_docker_compose_1.in | 2 +- pkg/config/testdata/generate_docker_compose_2.in | 2 +- pkg/config/testdata/generate_docker_compose_3.in | 2 +- pkg/config/testdata/generate_docker_compose_4.in | 2 +- pkg/config/testdata/generate_dockerfile_0.golden | 2 +- pkg/config/testdata/generate_dockerfile_0.in | 2 +- pkg/config/testdata/generate_dockerfile_1.golden | 2 +- pkg/config/testdata/generate_dockerfile_1.in | 2 +- pkg/input/input.go | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 6ae1e6c8..878b93f3 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Let's examine the `config.yaml` fields so you will feel more comfortable editing | output_binary | /app | output binary artifact inside the runtime container | | build_command | go build -o {{.output_binary}} | build command inside the runtime container. Note you can reference other configuration fields. When enabling Debugger `-gcflags="all=-N -l"` will be appended to the build command to stop compiler optimization and symbol removing | | run_command | {.output_binary}} | run command, probably most of the time will just be the binary artifact path | -| runtime_image | golang:1.14 | base Docker image for the runtime container | +| runtime_image | golang:1.15.2 | base Docker image for the runtime container | | debugger_enabled | false | whether to enable delve debugger inside the container or just use hot-reload | | debugger_port | 40000 | delve debugger listen port, relevant only if `debugger_enabled` was set | | expose_ports | [] | list of ports to expose inside the container. Uses the same syntax as docker-compose for mapping between host and container ports(e.g: "8080:8080"). No need to add the delve debugger listen port as it will be auto-added | diff --git a/doc.go b/doc.go index 2e9789ab..b56a762b 100644 --- a/doc.go +++ b/doc.go @@ -22,7 +22,7 @@ Configurations output_binary - output binary artifact inside the runtime container (default: "/app") build_command - build command inside the runtime container (default: "go build -o {{.output_binary}}") run_command - run command, probably most of the time will just be the binary artifact path (default: "{.output_binary}}") - runtime_image - base Docker image for the runtime container (default: "golang:1.14") + runtime_image - base Docker image for the runtime container (default: "golang:1.15.2") debugger_enabled - whether to enable delve debugger inside the container or just use hot-reload (default: false) debugger_port - delve debugger listen port, relevant only if debugger_enabled was set (default: 40000) expose_ports - list of ports to expose inside the container (default: []) diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 24aa0826..632cb941 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -21,7 +21,7 @@ func TestConfig_Load(t *testing.T) { name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -gcflags="all=-N-l" -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 expose_ports: @@ -32,7 +32,7 @@ expose_ports: OutputBinaryPath: "/app", BuildCommand: `go build -o /app -gcflags="all=-N-l"`, RunCommand: "/app", - RuntimeImage: "golang:1.14", + RuntimeImage: "golang:1.15.2", DebuggerPort: 40000, ExposePorts: []string{"8080:8080"}, }, @@ -43,7 +43,7 @@ expose_ports: name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -gcflags="all=-N-l" -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 expose_ports: @@ -54,7 +54,7 @@ expose_ports: OutputBinaryPath: "/app", BuildCommand: `go build -o /app -gcflags="all=-N-l"`, RunCommand: "/app", - RuntimeImage: "golang:1.14", + RuntimeImage: "golang:1.15.2", DebuggerPort: 40000, ExposePorts: []string{"8080:8080"}, }, @@ -122,7 +122,7 @@ func TestConfig_Write(t *testing.T) { OutputBinaryPath: "/app", BuildCommand: "go build -o /app -gcflags=\"all=-N-l\"", RunCommand: "/app", - RuntimeImage: "golang:1.14", + RuntimeImage: "golang:1.15.2", DebuggerPort: 40000, DebuggerEnabled: true, ExposePorts: []string{"8080", "8081:8081"}, @@ -131,7 +131,7 @@ func TestConfig_Write(t *testing.T) { output_binary: /app build_command: go build -o /app -gcflags="all=-N-l" run_command: /app -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 debugger_enabled: true debugger_port: 40000 expose_ports: diff --git a/pkg/config/render_test.go b/pkg/config/render_test.go index 9929236a..029a8382 100644 --- a/pkg/config/render_test.go +++ b/pkg/config/render_test.go @@ -12,7 +12,7 @@ var mockConfig = &Config{ OutputBinaryPath: "/app", BuildCommand: "go build", RunCommand: "/app", - RuntimeImage: "golang:1.14", + RuntimeImage: "golang:1.15.2", DebuggerEnabled: false, DebuggerPort: 0, ExposePorts: []string{"8080"}, @@ -67,7 +67,7 @@ func TestConfig_RenderDockerfile(t *testing.T) { err := mockConfig.RenderDockerfile(out) assert.NoError(t, err) assert.Equal(t, - `FROM golang:1.14 + `FROM golang:1.15.2 RUN go get github.com/githubnemo/CompileDaemon RUN go get github.com/go-delve/delve/cmd/dlv diff --git a/pkg/config/testdata/generate_docker_compose_0.in b/pkg/config/testdata/generate_docker_compose_0.in index af4619c8..c8d810de 100644 --- a/pkg/config/testdata/generate_docker_compose_0.in +++ b/pkg/config/testdata/generate_docker_compose_0.in @@ -1,7 +1,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 debugger_enabled: true diff --git a/pkg/config/testdata/generate_docker_compose_1.in b/pkg/config/testdata/generate_docker_compose_1.in index e5a09698..87aba6e7 100644 --- a/pkg/config/testdata/generate_docker_compose_1.in +++ b/pkg/config/testdata/generate_docker_compose_1.in @@ -1,7 +1,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 debugger_enabled: false diff --git a/pkg/config/testdata/generate_docker_compose_2.in b/pkg/config/testdata/generate_docker_compose_2.in index 78791e5f..b83dd965 100644 --- a/pkg/config/testdata/generate_docker_compose_2.in +++ b/pkg/config/testdata/generate_docker_compose_2.in @@ -1,7 +1,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 debugger_enabled: false diff --git a/pkg/config/testdata/generate_docker_compose_3.in b/pkg/config/testdata/generate_docker_compose_3.in index d682f3aa..e4c46677 100644 --- a/pkg/config/testdata/generate_docker_compose_3.in +++ b/pkg/config/testdata/generate_docker_compose_3.in @@ -1,7 +1,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 debugger_enabled: false diff --git a/pkg/config/testdata/generate_docker_compose_4.in b/pkg/config/testdata/generate_docker_compose_4.in index 4580f116..e1b6591b 100644 --- a/pkg/config/testdata/generate_docker_compose_4.in +++ b/pkg/config/testdata/generate_docker_compose_4.in @@ -2,7 +2,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} run_command: '{{.output_binary}}' -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 debugger_enabled: true debugger_port: 40000 expose_ports: [] diff --git a/pkg/config/testdata/generate_dockerfile_0.golden b/pkg/config/testdata/generate_dockerfile_0.golden index c47f1bb4..d785004f 100644 --- a/pkg/config/testdata/generate_dockerfile_0.golden +++ b/pkg/config/testdata/generate_dockerfile_0.golden @@ -1,4 +1,4 @@ -FROM golang:1.14 +FROM golang:1.15.2 RUN go get github.com/githubnemo/CompileDaemon RUN go get github.com/go-delve/delve/cmd/dlv diff --git a/pkg/config/testdata/generate_dockerfile_0.in b/pkg/config/testdata/generate_dockerfile_0.in index af4619c8..c8d810de 100644 --- a/pkg/config/testdata/generate_dockerfile_0.in +++ b/pkg/config/testdata/generate_dockerfile_0.in @@ -1,7 +1,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 debugger_enabled: true diff --git a/pkg/config/testdata/generate_dockerfile_1.golden b/pkg/config/testdata/generate_dockerfile_1.golden index 3dc3c3b4..fc6c0077 100644 --- a/pkg/config/testdata/generate_dockerfile_1.golden +++ b/pkg/config/testdata/generate_dockerfile_1.golden @@ -1,4 +1,4 @@ -FROM golang:1.14 +FROM golang:1.15.2 RUN go get github.com/githubnemo/CompileDaemon RUN go get github.com/go-delve/delve/cmd/dlv diff --git a/pkg/config/testdata/generate_dockerfile_1.in b/pkg/config/testdata/generate_dockerfile_1.in index e5a09698..87aba6e7 100644 --- a/pkg/config/testdata/generate_dockerfile_1.in +++ b/pkg/config/testdata/generate_dockerfile_1.in @@ -1,7 +1,7 @@ name: my-app output_binary: /app build_command: go build -o {{.output_binary}} -runtime_image: golang:1.14 +runtime_image: golang:1.15.2 run_command: '{{.output_binary}}' debugger_port: 40000 debugger_enabled: false diff --git a/pkg/input/input.go b/pkg/input/input.go index 734dde8f..eb6b9e42 100644 --- a/pkg/input/input.go +++ b/pkg/input/input.go @@ -28,7 +28,7 @@ func LoadOrDefault(workDir string) (*config.Config, bool) { OutputBinaryPath: "/app", BuildCommand: `go build -o {{.output_binary}}`, RunCommand: `{{.output_binary}}`, - RuntimeImage: "golang:1.14", + RuntimeImage: "golang:1.15.2", } configFilePath := config.FilePath(workDir, config.Path)