From daf87201f686710974b282d4c0b0c8422e55dac9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 Aug 2019 21:22:58 +0200 Subject: [PATCH 1/4] Bump Golang 1.11.13 Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fa099aa4f2..c6dc96f957 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # NOTE(dperny): for some reason, alpine was giving me trouble -FROM golang:1.11.0-stretch +FROM golang:1.11.13-stretch RUN apt-get update && apt-get install -y make git unzip From be528e80a841ae89e1bd7539201f12c4de496ab3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 Aug 2019 21:27:13 +0200 Subject: [PATCH 2/4] Bump Golang 1.12.9 Signed-off-by: Sebastiaan van Stijn --- .circleci/config.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c0fcf6dfc7..7ab18ff408 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: # Needed to install go OS: linux ARCH: amd64 - GOVERSION: 1.11 + GOVERSION: 1.12 # Needed to install protoc PROTOC_VERSION: 3.6.1 diff --git a/Dockerfile b/Dockerfile index c6dc96f957..6d795a468b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # NOTE(dperny): for some reason, alpine was giving me trouble -FROM golang:1.11.13-stretch +FROM golang:1.12.9-stretch RUN apt-get update && apt-get install -y make git unzip From 43fac9c8049f7dd2ae42d87f60d2a88f86f63853 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 Aug 2019 22:52:58 +0200 Subject: [PATCH 3/4] Update tests for new output with Go 1.12 Signed-off-by: Sebastiaan van Stijn --- template/getter_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/template/getter_test.go b/template/getter_test.go index a24fbfaa84..c2c1be0b22 100644 --- a/template/getter_test.go +++ b/template/getter_test.go @@ -160,7 +160,7 @@ func TestTemplatedSecret(t *testing.T) { Data: []byte("SECRET_VAL={{secret \"unknowntarget\"}}\n"), Templating: &api.Driver{Name: "golang"}, }, - expectedErr: `failed to expand templated secret templatedsecret: template: expansion:1:13: executing "expansion" at : error calling secret: secret target unknowntarget not found`, + expectedErr: `failed to expand templated secret templatedsecret: template: expansion:1:13: executing "expansion" at : error calling secret: secret target unknowntarget not found`, task: modifyTask(func(t *api.Task) { t.Spec = api.TaskSpec{ Runtime: &api.TaskSpec_Container{ @@ -185,7 +185,7 @@ func TestTemplatedSecret(t *testing.T) { Data: []byte("CONFIG_VAL={{config \"unknowntarget\"}}\n"), Templating: &api.Driver{Name: "golang"}, }, - expectedErr: `failed to expand templated secret templatedsecret: template: expansion:1:13: executing "expansion" at : error calling config: config target unknowntarget not found`, + expectedErr: `failed to expand templated secret templatedsecret: template: expansion:1:13: executing "expansion" at : error calling config: config target unknowntarget not found`, task: modifyTask(func(t *api.Task) { t.Spec = api.TaskSpec{ Runtime: &api.TaskSpec_Container{ @@ -440,7 +440,7 @@ func TestTemplatedConfig(t *testing.T) { Data: []byte("SECRET_VAL={{secret \"unknowntarget\"}}\n"), Templating: &api.Driver{Name: "golang"}, }, - expectedErr: `failed to expand templated config templatedconfig: template: expansion:1:13: executing "expansion" at : error calling secret: secret target unknowntarget not found`, + expectedErr: `failed to expand templated config templatedconfig: template: expansion:1:13: executing "expansion" at : error calling secret: secret target unknowntarget not found`, task: modifyTask(func(t *api.Task) { t.Spec = api.TaskSpec{ Runtime: &api.TaskSpec_Container{ @@ -465,7 +465,7 @@ func TestTemplatedConfig(t *testing.T) { Data: []byte("CONFIG_VAL={{config \"unknowntarget\"}}\n"), Templating: &api.Driver{Name: "golang"}, }, - expectedErr: `failed to expand templated config templatedconfig: template: expansion:1:13: executing "expansion" at : error calling config: config target unknowntarget not found`, + expectedErr: `failed to expand templated config templatedconfig: template: expansion:1:13: executing "expansion" at : error calling config: config target unknowntarget not found`, task: modifyTask(func(t *api.Task) { t.Spec = api.TaskSpec{ Runtime: &api.TaskSpec_Container{ From 42085d2f8e43a3ed90ed289d3f3ed3de57837100 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 Aug 2019 23:51:59 +0200 Subject: [PATCH 4/4] YOLO see if this works ``` panic: Log in goroutine after TestWorkerUpdate has completed goroutine 1175 [running]: testing.(*common).logDepth(0xc00019a100, 0xc0000396a0, 0x1d, 0x3) /usr/local/go/src/testing/testing.go:634 +0x51a testing.(*common).log(...) /usr/local/go/src/testing/testing.go:614 testing.(*common).Log(0xc00019a100, 0xc00006fb00, 0x1, 0x1) /usr/local/go/src/testing/testing.go:642 +0x79 github.com/docker/swarmkit/agent.(*mockTaskController).Remove(0xc00020a780, 0x13b6f40, 0xc0000b4010, 0x13b6f40, 0xc0000b4010) /home/circleci/.go_workspace/src/github.com/docker/swarmkit/agent/worker_test.go:604 +0x8e github.com/docker/swarmkit/agent.reconcileTaskState.func1(0xc0004dac60) /home/circleci/.go_workspace/src/github.com/docker/swarmkit/agent/worker.go:270 +0x137 created by github.com/docker/swarmkit/agent.reconcileTaskState /home/circleci/.go_workspace/src/github.com/docker/swarmkit/agent/worker.go:313 +0x1a6f FAIL github.com/docker/swarmkit/agent 4.244s make: *** [coverage] Error 1 Exited with code 2 ``` Signed-off-by: Sebastiaan van Stijn --- agent/worker.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/agent/worker.go b/agent/worker.go index efe538afa7..212aa1e12f 100644 --- a/agent/worker.go +++ b/agent/worker.go @@ -257,13 +257,11 @@ func reconcileTaskState(ctx context.Context, w *worker, assignments []*api.Assig } closeManager := func(tm *taskManager) { - go func(tm *taskManager) { - defer w.closers.Done() - // when a task is no longer assigned, we shutdown the task manager - if err := tm.Close(); err != nil { - log.G(ctx).WithError(err).Error("error closing task manager") - } - }(tm) + defer w.closers.Done() + // when a task is no longer assigned, we shutdown the task manager + if err := tm.Close(); err != nil { + log.G(ctx).WithError(err).Error("error closing task manager") + } // make an attempt at removing. this is best effort. any errors will be // retried by the reaper later.