Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 1dce987

Browse files
committed
Go 1.18
Signed-off-by: CrazyMax <[email protected]>
1 parent 0978185 commit 1dce987

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+243
-85
lines changed

.github/workflows/aci-tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run ACI tests
@@ -23,16 +26,13 @@ jobs:
2326
aci-tests:
2427
name: ACI e2e tests
2528
runs-on: ubuntu-latest
26-
env:
27-
GO111MODULE: "on"
2829
needs: check-optional-tests
2930
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true'
3031
steps:
31-
- name: Set up Go 1.16
32-
uses: actions/setup-go@v2
32+
- name: Set up Go
33+
uses: actions/setup-go@v3
3334
with:
34-
go-version: 1.16
35-
id: go
35+
go-version: ${{ env.GO_VERSION }}
3636

3737
- name: Setup docker CLI
3838
run: |

.github/workflows/ci.yml

+14-20
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
lint:
1114
name: Lint
1215
runs-on: ubuntu-latest
13-
env:
14-
GO111MODULE: "on"
1516
steps:
16-
- name: Set up Go 1.16
17-
uses: actions/setup-go@v2
17+
- name: Set up Go
18+
uses: actions/setup-go@v3
1819
with:
19-
go-version: 1.16
20-
id: go
20+
go-version: ${{ env.GO_VERSION }}
2121

2222
- name: Checkout code into the Go module directory
2323
uses: actions/checkout@v2
@@ -29,22 +29,19 @@ jobs:
2929
env:
3030
BUILD_TAGS: kube,e2e
3131
run: |
32-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.39.0
32+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.45.2
3333
make -f builder.Makefile lint
3434
3535
# only on main branch, costs too much for the gain on every PR
3636
validate-cross-build:
3737
name: Validate cross build
3838
runs-on: ubuntu-latest
3939
if: github.ref == 'refs/heads/main'
40-
env:
41-
GO111MODULE: "on"
4240
steps:
43-
- name: Set up Go 1.16
44-
uses: actions/setup-go@v2
41+
- name: Set up Go
42+
uses: actions/setup-go@v3
4543
with:
46-
go-version: 1.16
47-
id: go
44+
go-version: ${{ env.GO_VERSION }}
4845

4946
- name: Checkout code into the Go module directory
5047
uses: actions/checkout@v2
@@ -62,18 +59,15 @@ jobs:
6259
build:
6360
name: Build
6461
runs-on: ubuntu-latest
65-
env:
66-
GO111MODULE: "on"
6762
steps:
68-
- name: Set up Go 1.16
69-
uses: actions/setup-go@v2
63+
- name: Set up Go
64+
uses: actions/setup-go@v3
7065
with:
71-
go-version: 1.16
72-
id: go
66+
go-version: ${{ env.GO_VERSION }}
7367

7468
- name: Set up gosum
7569
run: |
76-
go get -u gotest.tools/gotestsum
70+
go install gotest.tools/gotestsum@latest
7771
7872
- name: Setup docker CLI
7973
run: |

.github/workflows/cli-release.yaml

+7-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ on:
1010
description: 'Dry run'
1111
required: false
1212
default: 'true'
13+
14+
env:
15+
GO_VERSION: 1.18
16+
1317
jobs:
1418
release:
1519
runs-on: ubuntu-latest
1620
steps:
17-
- name: Set up Go 1.16
18-
uses: actions/setup-go@v2
21+
- name: Set up Go
22+
uses: actions/setup-go@v3
1923
with:
20-
go-version: 1.16
21-
id: go
24+
go-version: ${{ env.GO_VERSION }}
2225

2326
- name: Setup docker CLI
2427
run: |

.github/workflows/ecs-tests.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run ECS tests
@@ -20,20 +23,16 @@ jobs:
2023
with:
2124
trigger: '/test-ecs'
2225

23-
2426
ecs-tests:
2527
name: ECS e2e tests
2628
runs-on: ubuntu-latest
27-
env:
28-
GO111MODULE: "on"
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-ecs == 'true'
3131
steps:
32-
- name: Set up Go 1.16
33-
uses: actions/setup-go@v2
32+
- name: Set up Go
33+
uses: actions/setup-go@v3
3434
with:
35-
go-version: 1.16
36-
id: go
35+
go-version: ${{ env.GO_VERSION }}
3736

3837
- name: Setup docker CLI
3938
run: |

.github/workflows/kube-tests.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run Kube tests
@@ -20,20 +23,16 @@ jobs:
2023
with:
2124
trigger: '/test-kube'
2225

23-
2426
kube-tests:
2527
name: Kube e2e tests
2628
runs-on: ubuntu-latest
27-
env:
28-
GO111MODULE: "on"
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-kube == 'true'
3131
steps:
32-
- name: Set up Go 1.16
33-
uses: actions/setup-go@v2
32+
- name: Set up Go
33+
uses: actions/setup-go@v3
3434
with:
35-
go-version: 1.16
36-
id: go
35+
go-version: ${{ env.GO_VERSION }}
3736

3837
- name: Setup docker CLI
3938
run: |

.github/workflows/windows-ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run Windows build and tests
@@ -20,7 +23,6 @@ jobs:
2023
with:
2124
trigger: '/test-windows'
2225

23-
2426
windows-build:
2527
name: Windows Build
2628
runs-on: windows-latest
@@ -29,11 +31,10 @@ jobs:
2931
needs: check-optional-tests
3032
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true'
3133
steps:
32-
- name: Set up Go 1.16
33-
uses: actions/setup-go@v2
34+
- name: Set up Go
35+
uses: actions/setup-go@v3
3436
with:
35-
go-version: 1.16
36-
id: go
37+
go-version: ${{ env.GO_VERSION }}
3738

3839
- name: Setup docker CLI
3940
run: |

Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
ARG GO_VERSION=1.16-alpine
19-
ARG GOLANGCI_LINT_VERSION=v1.40.1-alpine
18+
ARG GO_VERSION=1.18-alpine
19+
ARG GOLANGCI_LINT_VERSION=v1.45.2-alpine
2020
ARG PROTOC_GEN_GO_VERSION=v1.5.2
2121

2222
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
@@ -34,13 +34,14 @@ RUN --mount=type=cache,target=/go/pkg/mod \
3434

3535
FROM base AS make-protos
3636
ARG PROTOC_GEN_GO_VERSION
37-
RUN go get github.com/golang/protobuf/protoc-gen-go@${PROTOC_GEN_GO_VERSION}
37+
RUN go install github.com/golang/protobuf/protoc-gen-go@${PROTOC_GEN_GO_VERSION}
3838
COPY . .
3939
RUN make -f builder.Makefile protos
4040

4141
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION} AS lint-base
4242

4343
FROM base AS lint
44+
ENV GOFLAGS="-buildvcs=false"
4445
ENV CGO_ENABLED=0
4546
COPY --from=lint-base /usr/bin/golangci-lint /usr/bin/golangci-lint
4647
ARG BUILD_TAGS
@@ -54,7 +55,7 @@ RUN --mount=target=. \
5455
make -f builder.Makefile lint
5556

5657
FROM base AS import-restrictions-base
57-
RUN go get github.com/docker/import-restrictions
58+
RUN go install github.com/docker/import-restrictions@latest
5859

5960
FROM import-restrictions-base AS import-restrictions
6061
RUN --mount=target=. \

aci/convert/secrets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func validateMountPathCollisions(vms []containerinstance.VolumeMount) error {
136136
}
137137
}
138138
if isPrefixed {
139-
return errors.Errorf("mount paths %q and %q collide. A volume mount cannot include another one.", *vm1.MountPath, *vm2.MountPath)
139+
return errors.Errorf("mount paths %q and %q collide. A volume mount cannot include another one", *vm1.MountPath, *vm2.MountPath)
140140
}
141141
}
142142
}

aci/convert/secrets_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TestConvertSecrets(t *testing.T) {
149149

150150
_, err := service.getAciSecretsVolumeMounts()
151151
assert.Equal(t, err.Error(),
152-
fmt.Sprintf(`mount paths %q and %q collide. A volume mount cannot include another one.`,
152+
fmt.Sprintf(`mount paths %q and %q collide. A volume mount cannot include another one`,
153153
path.Dir(targetName1), path.Dir(targetName2)))
154154
})
155155

@@ -173,7 +173,7 @@ func TestConvertSecrets(t *testing.T) {
173173

174174
_, err := service.getAciSecretsVolumeMounts()
175175
assert.Equal(t, err.Error(),
176-
fmt.Sprintf(`mount paths %q and %q collide. A volume mount cannot include another one.`,
176+
fmt.Sprintf(`mount paths %q and %q collide. A volume mount cannot include another one`,
177177
path.Dir(targetName1), path.Dir(targetName2)))
178178
})
179179
}

aci/e2e/aci-demo/web/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# BUILD
15-
FROM golang:1.16-alpine AS build
15+
FROM golang:1.18-alpine AS build
1616
COPY dispatcher.go .
1717
RUN mkdir -p /out && go build -o /out/dispatcher dispatcher.go
1818

aci/e2e/aci_secrets_resources/web/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
FROM golang:1.16-alpine AS build
18+
FROM golang:1.18-alpine AS build
1919
COPY main.go .
2020
RUN --mount=type=cache,target=/go/pkg/mod \
2121
go build -trimpath -ldflags="-s -w" -o server main.go

aci/etchosts/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.16 AS builder
15+
FROM golang:1.18 AS builder
1616
WORKDIR $GOPATH/src/github.com/docker/compose-cli/aci/etchosts
1717
COPY . .
1818
RUN GO111MODULE=auto CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/hosts main/main.go
1919

2020
FROM scratch
21-
COPY --from=builder /go/bin/hosts /hosts
21+
COPY --from=builder /go/bin/hosts /hosts

aci/login/login.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ func (login *azureLoginService) GetValidToken() (oauth2.Token, string, error) {
289289

290290
ce, err := login.cloudEnvironmentSvc.Get(loginInfo.CloudEnvironment)
291291
if err != nil {
292-
return oauth2.Token{}, "", errors.Wrap(err, "access token request failed--cloud environment could not be determined.")
292+
return oauth2.Token{}, "", errors.Wrap(err, "access token request failed--cloud environment could not be determined")
293293
}
294294

295295
token, err = login.refreshToken(token.RefreshToken, tenantID, ce)
296296
if err != nil {
297-
return oauth2.Token{}, "", errors.Wrap(err, "access token request failed. Maybe you need to login to Azure again.")
297+
return oauth2.Token{}, "", errors.Wrap(err, "access token request failed. Maybe you need to login to Azure again")
298298
}
299299
err = login.tokenStore.writeLoginInfo(TokenInfo{TenantID: tenantID, Token: token, CloudEnvironment: ce.Name})
300300
if err != nil {

cli/cmd/context/create_kube.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build kube
12
// +build kube
23

34
/*

cli/metrics/conn_other.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !windows,!darwin
1+
//go:build !windows && !darwin
22
// +build !windows,!darwin
33

44
/*

cli/mobycli/exec_unix.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
/*

cli/mobycli/resolvepath/lp_unix.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
/*

cli/server/socket_unix.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
/*

cli/server/socket_windows.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build windows
12
// +build windows
23

34
/*

ecs/resolv/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.16 AS builder
15+
FROM golang:1.18 AS builder
1616
WORKDIR $GOPATH/src/github.com/docker/compose-cli/ecs/resolv
1717
COPY . .
1818
RUN GO111MODULE=auto CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/resolv main/main.go

ecs/secrets/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.16 AS builder
15+
FROM golang:1.18 AS builder
1616
WORKDIR $GOPATH/src/github.com/docker/compose-cli/ecs/secrets
1717
COPY . .
1818
RUN GO111MODULE=auto CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/secrets main/main.go

0 commit comments

Comments
 (0)