Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to go 1.18 #2745

Merged
merged 4 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
-
name: Cache Go modules
uses: actions/cache@v2
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apk add --no-cache git
# xx is a helper for cross-compilation
FROM --platform=$BUILDPLATFORM tonistiigi/xx@sha256:1e96844fadaa2f9aea021b2b05299bc02fe4c39a92d8e735b93e8e2b15610128 AS xx

FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS golatest
FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS golatest

# gobuild is base stage for compiling go/cgo
FROM golatest AS gobuild-base
Expand Down Expand Up @@ -123,7 +123,7 @@ RUN git clone https://github.com/containerd/containerd.git containerd
FROM gobuild-base AS containerd-base
WORKDIR /go/src/github.com/containerd/containerd
ARG TARGETPLATFORM
ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs
ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off
RUN xx-apk add musl-dev gcc && xx-go --wrap

FROM containerd-base AS containerd
Expand Down
2 changes: 1 addition & 1 deletion examples/buildkit0/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
}

func goBuildBase() llb.State {
goAlpine := llb.Image("docker.io/library/golang:1.17-alpine")
goAlpine := llb.Image("docker.io/library/golang:1.18-alpine")
return goAlpine.
AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix).
AddEnv("GOPATH", "/go").
Expand Down
2 changes: 1 addition & 1 deletion examples/buildkit1/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
}

func goBuildBase() llb.State {
goAlpine := llb.Image("docker.io/library/golang:1.17-alpine")
goAlpine := llb.Image("docker.io/library/golang:1.18-alpine")
return goAlpine.
AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix).
AddEnv("GOPATH", "/go").
Expand Down
2 changes: 1 addition & 1 deletion examples/buildkit2/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
}

func goBuildBase() llb.State {
goAlpine := llb.Image("docker.io/library/golang:1.17-alpine")
goAlpine := llb.Image("docker.io/library/golang:1.18-alpine")
return goAlpine.
AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix).
AddEnv("GOPATH", "/go").
Expand Down
2 changes: 1 addition & 1 deletion examples/buildkit3/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
}

func goBuildBase() llb.State {
goAlpine := llb.Image("docker.io/library/golang:1.17-alpine")
goAlpine := llb.Image("docker.io/library/golang:1.18-alpine")
return goAlpine.
AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix).
AddEnv("GOPATH", "/go").
Expand Down
2 changes: 1 addition & 1 deletion examples/buildkit4/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
}

func goBuildBase() llb.State {
goAlpine := llb.Image("docker.io/library/golang:1.17-alpine")
goAlpine := llb.Image("docker.io/library/golang:1.18-alpine")
return goAlpine.
AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix).
AddEnv("GOPATH", "/go").
Expand Down
2 changes: 1 addition & 1 deletion examples/nested-llb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func main() {
}

func goBuildBase() llb.State {
goAlpine := llb.Image("docker.io/library/golang:1.17-alpine")
goAlpine := llb.Image("docker.io/library/golang:1.18-alpine")
return goAlpine.
AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix).
AddEnv("GOPATH", "/go").
Expand Down
2 changes: 1 addition & 1 deletion frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# xx is a helper for cross-compilation
FROM --platform=$BUILDPLATFORM tonistiigi/xx:golang@sha256:810dc54d5144f133a218e88e319184bf8b9ce01d37d46ddb37573e90decd9eef AS xx

FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS base
FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS base
RUN apk add git bash
COPY --from=xx / /
WORKDIR /src
Expand Down
2 changes: 1 addition & 1 deletion frontend/dockerfile/instructions/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ func errExactlyOneArgument(command string) error {
}

func errNoDestinationArgument(command string) error {
return errors.Errorf("%s requires at least two arguments, but only one was provided. Destination could not be determined.", command)
return errors.Errorf("%s requires at least two arguments, but only one was provided. Destination could not be determined", command)
}

func errBadHeredoc(command string, option string) error {
Expand Down
2 changes: 1 addition & 1 deletion hack/dockerfiles/generated-files.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile-upstream:master

# protoc is dynamically linked to glibc to can't use golang:1.10-alpine
FROM golang:1.17-buster AS gobuild-base
FROM golang:1.18-buster AS gobuild-base

RUN apt-get update && apt-get --no-install-recommends install -y \
unzip \
Expand Down
5 changes: 3 additions & 2 deletions hack/dockerfiles/lint.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# syntax=docker/dockerfile-upstream:master

FROM golang:1.17-alpine
FROM golang:1.18-alpine
ENV GOFLAGS="-buildvcs=false"
RUN apk add --no-cache gcc musl-dev yamllint
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.43.0
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.45.0
WORKDIR /go/src/github.com/moby/buildkit
RUN --mount=target=/go/src/github.com/moby/buildkit --mount=target=/root/.cache,type=cache \
GOARCH=amd64 golangci-lint run && \
Expand Down
2 changes: 1 addition & 1 deletion hack/dockerfiles/vendor.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile-upstream:master

FROM golang:1.17-alpine AS vendored
FROM golang:1.18-alpine AS vendored
RUN apk add --no-cache git
WORKDIR /src
RUN --mount=target=/src,rw \
Expand Down
2 changes: 1 addition & 1 deletion solver/testutil/cachestorage_testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func testWalkIDsByResult(t *testing.T, st solver.CacheKeyStorage) {
func getFunctionName(i interface{}) string {
fullname := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
dot := strings.LastIndex(fullname, ".") + 1
return strings.Title(fullname[dot:])
return strings.Title(fullname[dot:]) //nolint:staticcheck // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support
}

func rootKey(dgst digest.Digest, output solver.Index) digest.Digest {
Expand Down
2 changes: 1 addition & 1 deletion util/archutil/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ FROM base AS exit-mips64
COPY fixtures/exit.mips64.s .
RUN mips64-linux-gnuabi64-as --noexecstack -o exit.o exit.mips64.s && mips64-linux-gnuabi64-ld -o exit -s exit.o

FROM golang:1.17-alpine AS generate
FROM golang:1.18-alpine AS generate
WORKDIR /src
COPY --from=exit-amd64 /src/exit amd64
COPY --from=exit-386 /src/exit 386
Expand Down
2 changes: 1 addition & 1 deletion util/resolver/retryhandler/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func retryError(err error) bool {
return true
}
// catches TLS timeout or other network-related temporary errors
if ne, ok := errors.Cause(err).(net.Error); ok && ne.Temporary() {
if ne, ok := errors.Cause(err).(net.Error); ok && ne.Temporary() { //nolint:staticcheck // ignoring "SA1019: Temporary is deprecated", continue to propagate net.Error through the "temporary" status
return true
}
// https://github.com/containerd/containerd/pull/4724
Expand Down
2 changes: 1 addition & 1 deletion util/testutil/integration/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func Run(t *testing.T, testCases []Test, opt ...TestOpt) {
func getFunctionName(i interface{}) string {
fullname := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
dot := strings.LastIndex(fullname, ".") + 1
return strings.Title(fullname[dot:])
return strings.Title(fullname[dot:]) //nolint:staticcheck // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support
}

var localImageCache map[string]map[string]struct{}
Expand Down