Skip to content

Commit 5b2321f

Browse files
authored
Merge pull request #1040 from fluxcd/update-go-1.20
Update Go to 1.20
2 parents 3e0d081 + 9509b62 commit 5b2321f

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

.github/workflows/cifuzz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Go
2121
uses: actions/setup-go@v3
2222
with:
23-
go-version: 1.19.x
23+
go-version: 1.20.x
2424
- id: go-env
2525
run: |
2626
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT

.github/workflows/e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Go
2424
uses: actions/setup-go@v3
2525
with:
26-
go-version: 1.19.x
26+
go-version: 1.20.x
2727
- name: Restore Go cache
2828
uses: actions/cache@v3
2929
with:
@@ -62,7 +62,7 @@ jobs:
6262
- name: Setup Go
6363
uses: actions/setup-go@v3
6464
with:
65-
go-version: 1.19.x
65+
go-version: 1.20.x
6666
- name: Enable integration tests
6767
# Only run integration tests for main branch
6868
if: github.ref == 'refs/heads/main'

.github/workflows/scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Go
3535
uses: actions/setup-go@v2
3636
with:
37-
go-version: 1.19.x
37+
go-version: 1.20.x
3838
- name: Initialize CodeQL
3939
uses: github/codeql-action/init@v2
4040
with:

.github/workflows/tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Go
2525
uses: actions/setup-go@v3
2626
with:
27-
go-version: 1.19.x
27+
go-version: 1.20.x
2828
- name: Restore Go cache
2929
uses: actions/cache@v3
3030
with:
@@ -49,7 +49,7 @@ jobs:
4949
- name: Setup Go
5050
uses: actions/setup-go@v3
5151
with:
52-
go-version: 1.19.x
52+
go-version: 1.20.x
5353
- name: Run tests
5454
env:
5555
SKIP_COSIGN_VERIFICATION: true
@@ -80,7 +80,7 @@ jobs:
8080
- name: Setup Go
8181
uses: actions/setup-go@v3
8282
with:
83-
go-version: 1.19.x
83+
go-version: 1.20.x
8484
- name: Restore Go cache
8585
uses: actions/cache@v3
8686
with:

.github/workflows/verify.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Go
2525
uses: actions/setup-go@v3
2626
with:
27-
go-version: 1.19.x
27+
go-version: 1.20.x
2828
- name: Restore Go cache
2929
uses: actions/cache@v3
3030
with:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG BASE_VARIANT=alpine
2-
ARG GO_VERSION=1.19
3-
ARG XX_VERSION=1.1.2
2+
ARG GO_VERSION=1.20
3+
ARG XX_VERSION=1.2.1
44

55
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
66

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
120120
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v1beta2 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/source.md
121121

122122
tidy: ## Run go mod tidy
123-
cd api; rm -f go.sum; go mod tidy -compat=1.19
124-
rm -f go.sum; go mod tidy -compat=1.19
123+
cd api; rm -f go.sum; go mod tidy -compat=1.20
124+
rm -f go.sum; go mod tidy -compat=1.20
125125

126126
fmt: ## Run go fmt against code
127127
go fmt ./...

internal/helm/repository/oci_chart_repository_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ func TestOCIChartRepository_Get(t *testing.T) {
210210
}
211211

212212
func TestOCIChartRepository_DownloadChart(t *testing.T) {
213-
client := &mockRegistryClient{}
214213
testCases := []struct {
215214
name string
216215
url string
@@ -225,7 +224,7 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
225224
Metadata: &chart.Metadata{Name: "chart"},
226225
URLs: []string{"oci://localhost:5000/my_repo/podinfo:1.0.0"},
227226
},
228-
expected: "oci://localhost:5000/my_repo/podinfo:1.0.0",
227+
expected: "localhost:5000/my_repo/podinfo:1.0.0",
229228
},
230229
{
231230
name: "no chart URL",
@@ -245,27 +244,29 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
245244
}
246245

247246
for _, tc := range testCases {
247+
tc := tc
248248
t.Run(tc.name, func(t *testing.T) {
249-
g := NewWithT(t)
250249
t.Parallel()
251-
mg := OCIMockGetter{}
250+
251+
g := NewWithT(t)
252+
252253
u, err := url.Parse(tc.url)
253254
g.Expect(err).ToNot(HaveOccurred())
255+
256+
mg := OCIMockGetter{}
254257
r := OCIChartRepository{
255258
Client: &mg,
256259
URL: *u,
257260
}
258-
r.Client = &mg
259-
g.Expect(err).ToNot(HaveOccurred())
260-
g.Expect(r).ToNot(BeNil())
261+
261262
res, err := r.DownloadChart(tc.chartVersion)
262263
if tc.expectedErr {
263264
g.Expect(err).To(HaveOccurred())
264265
return
265266
}
266267

267268
g.Expect(err).ToNot(HaveOccurred())
268-
g.Expect(client.LastCalledURL).To(Equal(tc.expected))
269+
g.Expect(mg.LastCalledURL).To(Equal(tc.expected))
269270
g.Expect(res).ToNot(BeNil())
270271
g.Expect(err).ToNot(HaveOccurred())
271272
})

0 commit comments

Comments
 (0)