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 Go to 1.20 #1040

Merged
merged 3 commits into from
Mar 2, 2023
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/cifuzz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- id: go-env
run: |
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Enable integration tests
# Only run integration tests for main branch
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@v3
with:
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Run tests
env:
SKIP_COSIGN_VERIFICATION: true
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore Go cache
uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_VARIANT=alpine
ARG GO_VERSION=1.19
ARG XX_VERSION=1.1.2
ARG GO_VERSION=1.20
ARG XX_VERSION=1.2.1

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

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
$(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

tidy: ## Run go mod tidy
cd api; rm -f go.sum; go mod tidy -compat=1.19
rm -f go.sum; go mod tidy -compat=1.19
cd api; rm -f go.sum; go mod tidy -compat=1.20
rm -f go.sum; go mod tidy -compat=1.20

fmt: ## Run go fmt against code
go fmt ./...
Expand Down
17 changes: 9 additions & 8 deletions internal/helm/repository/oci_chart_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ func TestOCIChartRepository_Get(t *testing.T) {
}

func TestOCIChartRepository_DownloadChart(t *testing.T) {
client := &mockRegistryClient{}
testCases := []struct {
name string
url string
Expand All @@ -225,7 +224,7 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
Metadata: &chart.Metadata{Name: "chart"},
URLs: []string{"oci://localhost:5000/my_repo/podinfo:1.0.0"},
},
expected: "oci://localhost:5000/my_repo/podinfo:1.0.0",
expected: "localhost:5000/my_repo/podinfo:1.0.0",
},
{
name: "no chart URL",
Expand All @@ -245,27 +244,29 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
}

for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
t.Parallel()
mg := OCIMockGetter{}

g := NewWithT(t)

u, err := url.Parse(tc.url)
g.Expect(err).ToNot(HaveOccurred())

mg := OCIMockGetter{}
r := OCIChartRepository{
Client: &mg,
URL: *u,
}
r.Client = &mg
g.Expect(err).ToNot(HaveOccurred())
g.Expect(r).ToNot(BeNil())

res, err := r.DownloadChart(tc.chartVersion)
if tc.expectedErr {
g.Expect(err).To(HaveOccurred())
return
}

g.Expect(err).ToNot(HaveOccurred())
g.Expect(client.LastCalledURL).To(Equal(tc.expected))
g.Expect(mg.LastCalledURL).To(Equal(tc.expected))
g.Expect(res).ToNot(BeNil())
g.Expect(err).ToNot(HaveOccurred())
})
Expand Down