commit
5b2321f946
|
@ -20,7 +20,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- id: go-env
|
- id: go-env
|
||||||
run: |
|
run: |
|
||||||
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||||
|
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Restore Go cache
|
- name: Restore Go cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -62,7 +62,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Enable integration tests
|
- name: Enable integration tests
|
||||||
# Only run integration tests for main branch
|
# Only run integration tests for main branch
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
|
|
@ -34,7 +34,7 @@ jobs:
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Restore Go cache
|
- name: Restore Go cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -49,7 +49,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
SKIP_COSIGN_VERIFICATION: true
|
SKIP_COSIGN_VERIFICATION: true
|
||||||
|
@ -80,7 +80,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Restore Go cache
|
- name: Restore Go cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.20.x
|
||||||
- name: Restore Go cache
|
- name: Restore Go cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
ARG BASE_VARIANT=alpine
|
ARG BASE_VARIANT=alpine
|
||||||
ARG GO_VERSION=1.19
|
ARG GO_VERSION=1.20
|
||||||
ARG XX_VERSION=1.1.2
|
ARG XX_VERSION=1.2.1
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||||
|
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -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
|
$(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
|
tidy: ## Run go mod tidy
|
||||||
cd api; 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.19
|
rm -f go.sum; go mod tidy -compat=1.20
|
||||||
|
|
||||||
fmt: ## Run go fmt against code
|
fmt: ## Run go fmt against code
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
|
|
|
@ -210,7 +210,6 @@ func TestOCIChartRepository_Get(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOCIChartRepository_DownloadChart(t *testing.T) {
|
func TestOCIChartRepository_DownloadChart(t *testing.T) {
|
||||||
client := &mockRegistryClient{}
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
url string
|
url string
|
||||||
|
@ -225,7 +224,7 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
|
||||||
Metadata: &chart.Metadata{Name: "chart"},
|
Metadata: &chart.Metadata{Name: "chart"},
|
||||||
URLs: []string{"oci://localhost:5000/my_repo/podinfo:1.0.0"},
|
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",
|
name: "no chart URL",
|
||||||
|
@ -245,19 +244,21 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
tc := tc
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
g := NewWithT(t)
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
mg := OCIMockGetter{}
|
|
||||||
|
g := NewWithT(t)
|
||||||
|
|
||||||
u, err := url.Parse(tc.url)
|
u, err := url.Parse(tc.url)
|
||||||
g.Expect(err).ToNot(HaveOccurred())
|
g.Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
|
mg := OCIMockGetter{}
|
||||||
r := OCIChartRepository{
|
r := OCIChartRepository{
|
||||||
Client: &mg,
|
Client: &mg,
|
||||||
URL: *u,
|
URL: *u,
|
||||||
}
|
}
|
||||||
r.Client = &mg
|
|
||||||
g.Expect(err).ToNot(HaveOccurred())
|
|
||||||
g.Expect(r).ToNot(BeNil())
|
|
||||||
res, err := r.DownloadChart(tc.chartVersion)
|
res, err := r.DownloadChart(tc.chartVersion)
|
||||||
if tc.expectedErr {
|
if tc.expectedErr {
|
||||||
g.Expect(err).To(HaveOccurred())
|
g.Expect(err).To(HaveOccurred())
|
||||||
|
@ -265,7 +266,7 @@ func TestOCIChartRepository_DownloadChart(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
g.Expect(err).ToNot(HaveOccurred())
|
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(res).ToNot(BeNil())
|
||||||
g.Expect(err).ToNot(HaveOccurred())
|
g.Expect(err).ToNot(HaveOccurred())
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue