From 37699db341e46a3a7e7656c98013982b7ef8e47e Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 13:10:47 +0200 Subject: [PATCH 1/6] Bump golang to 1.13.10 Signed-off-by: Silvin Lubecki --- Dockerfile | 6 +++--- Dockerfile.invocation-image | 2 +- Dockerfile.lint | 2 +- docs/yaml/Dockerfile | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 987bc2c55..8adc8a135 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM dockercore/golang-cross:1.12.9@sha256:3ea9dcef4dd2c46d80445c0b22d6177817f4cfce22c523cc12a5a1091cb37705 AS cli-build +FROM dockercore/golang-cross:1.13.10@sha256:ad2725ac9af0273f1de9bb85e166084d5e8d915df334154fe9c8bd9af912a90d AS cli-build ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 ARG CLI_CHANNEL=stable ARG CLI_VERSION=19.03.5 -RUN apt-get install -y -q --no-install-recommends \ +RUN apt-get update && apt-get install -y -q --no-install-recommends \ coreutils \ util-linux \ uuid-runtime @@ -21,7 +21,7 @@ ARG GOPROXY RUN make binary-windows # main dev image -FROM golang:1.13.3 AS dev +FROM golang:1.13.10 AS dev RUN apt-get update && apt-get install -y -q --no-install-recommends \ coreutils \ diff --git a/Dockerfile.invocation-image b/Dockerfile.invocation-image index 211443b20..cf891a6c7 100644 --- a/Dockerfile.invocation-image +++ b/Dockerfile.invocation-image @@ -1,6 +1,6 @@ ARG ALPINE_VERSION=3.10.3 -FROM golang:1.13.2 AS build +FROM golang:1.13.10 AS build RUN apt-get update -qq && apt-get install -y -q --no-install-recommends \ coreutils \ diff --git a/Dockerfile.lint b/Dockerfile.lint index 7de086689..0f1b656f3 100644 --- a/Dockerfile.lint +++ b/Dockerfile.lint @@ -1,5 +1,5 @@ ARG ALPINE_VERSION=3.10 -ARG GO_VERSION=1.12.9 +ARG GO_VERSION=1.13.10 FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} RUN apk add --no-cache \ diff --git a/docs/yaml/Dockerfile b/docs/yaml/Dockerfile index 45e867410..9c1c1e212 100644 --- a/docs/yaml/Dockerfile +++ b/docs/yaml/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.12-alpine AS base +FROM golang:1.13-alpine AS base ARG PROJECT=github.com/docker/app ARG PROJECT_PATH=/go/src/${PROJECT} From 5bb93d6c0370e433a07e0beb44d55bc6be7e342d Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 13:21:31 +0200 Subject: [PATCH 2/6] Bump docker cli to 19.03.8 Signed-off-by: Silvin Lubecki --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8adc8a135..6b8cb1a52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM dockercore/golang-cross:1.13.10@sha256:ad2725ac9af0273f1de9bb85e166084d5e8d915df334154fe9c8bd9af912a90d AS cli-build ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 ARG CLI_CHANNEL=stable -ARG CLI_VERSION=19.03.5 +ARG CLI_VERSION=19.03.8 RUN apt-get update && apt-get install -y -q --no-install-recommends \ coreutils \ From f85ac4ae2dc856d618b5f26aee9a4b2124ede2ef Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 13:29:26 +0200 Subject: [PATCH 3/6] Bump alpine to 3.11.5 Signed-off-by: Silvin Lubecki --- Dockerfile.invocation-image | 2 +- Dockerfile.lint | 2 +- e2e/testdata/cnab-parameters/cnab/build/Dockerfile | 2 +- e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile | 2 +- e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile | 2 +- e2e/testdata/cnab-without-status/cnab/build/Dockerfile | 2 +- vars.mk | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile.invocation-image b/Dockerfile.invocation-image index cf891a6c7..449079fed 100644 --- a/Dockerfile.invocation-image +++ b/Dockerfile.invocation-image @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM golang:1.13.10 AS build diff --git a/Dockerfile.lint b/Dockerfile.lint index 0f1b656f3..c8b8bc73b 100644 --- a/Dockerfile.lint +++ b/Dockerfile.lint @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10 +ARG ALPINE_VERSION=3.11 ARG GO_VERSION=1.13.10 FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-parameters/cnab/build/Dockerfile b/e2e/testdata/cnab-parameters/cnab/build/Dockerfile index bf6ad536a..05820db88 100644 --- a/e2e/testdata/cnab-parameters/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-parameters/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile b/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile index bf6ad536a..05820db88 100644 --- a/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile b/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile index bf6ad536a..05820db88 100644 --- a/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-without-status/cnab/build/Dockerfile b/e2e/testdata/cnab-without-status/cnab/build/Dockerfile index ab1af2cad..05820db88 100644 --- a/e2e/testdata/cnab-without-status/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-without-status/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.1 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/vars.mk b/vars.mk index 51b172769..c608e790b 100644 --- a/vars.mk +++ b/vars.mk @@ -2,7 +2,7 @@ PKG_NAME := github.com/docker/app BIN_NAME ?= docker-app E2E_NAME := $(BIN_NAME)-e2e -ALPINE_VERSION=3.10.3 +ALPINE_VERSION=3.11.5 # Failing to resolve sh.exe to a full path denotes a windows vanilla shell. # Although 'simple' commands are still exec'ed, 'complex' ones are batch'ed instead of sh'ed. From 87346d60f7c04fff113303b775fe939bed98e224 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 13:30:37 +0200 Subject: [PATCH 4/6] Bump golangci linter to 1.23.0 Signed-off-by: Silvin Lubecki --- Dockerfile.lint | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.lint b/Dockerfile.lint index c8b8bc73b..f3a02f023 100644 --- a/Dockerfile.lint +++ b/Dockerfile.lint @@ -6,10 +6,11 @@ RUN apk add --no-cache \ curl \ git \ make \ - coreutils + coreutils \ + build-base RUN GO111MODULE=on go get \ - github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0 \ + github.com/golangci/golangci-lint/cmd/golangci-lint@v1.23.0 \ && rm -rf /go/src/* /go/pkg/* WORKDIR /go/src/github.com/docker/app From d484da268c19e5364ba16c7442866619cc126068 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 13:33:50 +0200 Subject: [PATCH 5/6] Bump gotestsum to v0.4.2 Signed-off-by: Silvin Lubecki --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6b8cb1a52..7fbac7ea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/ ARG DEP_VERSION=v0.5.4 RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \ chmod +x /usr/bin/dep -ARG GOTESTSUM_VERSION=v0.3.4 +ARG GOTESTSUM_VERSION=v0.4.2 ARG GOPROXY RUN mkdir $GOPATH/src/gotest.tools && \ git clone -q https://github.com/gotestyourself/gotestsum $GOPATH/src/gotest.tools/gotestsum && \ From 32732b3038917f7f7c93dd08219b8f0778e90468 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 21 Apr 2020 14:31:13 +0200 Subject: [PATCH 6/6] Fix linter timeout: add some concurrency Fix linter errors due to linter bump Signed-off-by: Silvin Lubecki --- .golangci.yml | 5 +++++ Makefile | 2 +- e2e/helper_test.go | 5 ++--- internal/commands/image/tag_test.go | 2 +- loader/loader_test.go | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2c6f43826..ad6665dcd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,9 @@ linters: + run: + concurrency: 2 + modules-download-mode: vendor + skip-dirs: + - vendor enable-all: false disable-all: true enable: diff --git a/Makefile b/Makefile index 4620d886c..7db67c0b8 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ test: test-unit test-e2e ## run all tests lint: ## run linter(s) @echo "Linting..." - @golangci-lint run ./... + golangci-lint run --verbose --print-resources-usage --timeout 10m0s ./... test-e2e: bin/$(BIN_NAME) ## run end-to-end tests @echo "Running e2e tests..." diff --git a/e2e/helper_test.go b/e2e/helper_test.go index d489086a9..cdc591a44 100644 --- a/e2e/helper_test.go +++ b/e2e/helper_test.go @@ -122,14 +122,13 @@ func runWithDindSwarmAndRegistry(t *testing.T, todo func(dindSwarmAndRegistryInf todo(runner) } -func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) string { +func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) { iidfile := fs.NewFile(t, "iid") defer iidfile.Remove() cmd.Command = dockerCli.Command("app", "build", "--iidfile", iidfile.Path(), "-t", ref, path) icmd.RunCmd(cmd).Assert(t, icmd.Success) - bytes, err := ioutil.ReadFile(iidfile.Path()) + _, err := ioutil.ReadFile(iidfile.Path()) assert.NilError(t, err) - return string(bytes) } // Container represents a docker container diff --git a/internal/commands/image/tag_test.go b/internal/commands/image/tag_test.go index acc95c794..8639f764d 100644 --- a/internal/commands/image/tag_test.go +++ b/internal/commands/image/tag_test.go @@ -95,7 +95,7 @@ func TestInvalidDestinationReference(t *testing.T) { err := runTag(mockedImageStore, "ref", badRef) - assert.ErrorContains(t, err, fmt.Sprintf("invalid reference format")) + assert.ErrorContains(t, err, "invalid reference format") } func TestBundleNotStored(t *testing.T) { diff --git a/loader/loader_test.go b/loader/loader_test.go index 8009e8b8c..e035ea1eb 100644 --- a/loader/loader_test.go +++ b/loader/loader_test.go @@ -35,7 +35,7 @@ func TestLoadFromDirectory(t *testing.T) { app, err := LoadFromDirectory(dir.Path()) assert.NilError(t, err) assert.Assert(t, app != nil) - assert.Assert(t, is.Equal(app.Path, dir.Path())) + assert.Assert(t, is.Equal(app.Path, dir.Path())) //nolint:staticcheck assertAppContent(t, app) } @@ -62,7 +62,7 @@ func TestLoadFromTar(t *testing.T) { app, err := LoadFromTar(myapp.Path()) assert.NilError(t, err) assert.Assert(t, app != nil) - assert.Assert(t, is.Equal(app.Path, myapp.Path())) + assert.Assert(t, is.Equal(app.Path, myapp.Path())) //nolint:staticcheck assertAppContent(t, app) }