diff --git a/.github/workflows/testdata.yml b/.github/workflows/testdata.yml index 18e977ac3da..5ec04e9a22f 100644 --- a/.github/workflows/testdata.yml +++ b/.github/workflows/testdata.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.15' + go-version: '1.16' - name: Remove pre-installed kustomize # This step is needed as the following one tries to remove # kustomize for each test but has no permission to do so diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 744148b5ef9..d8b9b836ba9 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.15' + go-version: '1.16' # This step is needed as the following one tries to remove # kustomize for each test but has no permission to do so - name: Remove pre-installed kustomize @@ -54,7 +54,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.15' + go-version: '1.16' - name: Generate the coverage output run: make test-coverage - name: Send the coverage output diff --git a/docs/book/functions/handle-version.js b/docs/book/functions/handle-version.js new file mode 100644 index 00000000000..54b657e8763 --- /dev/null +++ b/docs/book/functions/handle-version.js @@ -0,0 +1,37 @@ +function notFound(info) { + return { + statusCode: 404, + headers: {'content-type': 'text/html'}, + body: ("

Not Found

"+ + "

You shouldn't see this page, please file a bug

"+ + `
debug details
${JSON.stringify(info)}
` + ), + }; +} + +function redirectToDownload(version, file) { + const loc = `https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/${file}`; + return { + statusCode: 302, + headers: {'location': loc, 'content-type': 'text/plain'}, + body: `Redirecting to ${loc}`, + }; +} + + +exports.handler = async function(evt, ctx) { + // grab the prefix too to check for coherence + const [prefix, version, os, arch] = evt.path.split("/").slice(-4); + if (prefix !== 'releases' || !version || !os || !arch) { + return notFound({version: version, os: os, arch: arch, prefix: prefix, rawPath: evt.path}); + } + + switch(version[0]) { + case '1': + // fallthrough + case '2': + return redirectToDownload(version, `kubebuilder_${version}_${os}_${arch}.tar.gz`); + default: + return redirectToDownload(version, `kubebuilder_${os}_${arch}`); + } +} diff --git a/docs/book/src/component-config-tutorial/testdata/project/Dockerfile b/docs/book/src/component-config-tutorial/testdata/project/Dockerfile index 5169a8c09c9..3ab32a14c7e 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/component-config-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.15 as builder +FROM golang:1.16 as builder WORKDIR /workspace # Copy the Go Modules manifests @@ -15,7 +15,7 @@ COPY apis/ apis/ COPY controllers/ controllers/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod index 35be1c3a748..eae1236092c 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/go.mod +++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod @@ -1,6 +1,6 @@ module tutorial.kubebuilder.io/project -go 1.15 +go 1.16 require ( github.com/go-logr/logr v0.2.1 diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile b/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile index ce816f3b0e7..4152680b742 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.15 as builder +FROM golang:1.16 as builder WORKDIR /workspace # Copy the Go Modules manifests @@ -15,7 +15,7 @@ COPY api/ api/ COPY controllers/ controllers/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/patches/webhook_in_cronjobs.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/patches/webhook_in_cronjobs.yaml index 76d1d9a3744..63c1303a0f5 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/patches/webhook_in_cronjobs.yaml +++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/patches/webhook_in_cronjobs.yaml @@ -12,3 +12,5 @@ spec: namespace: system name: webhook-service path: /convert + conversionReviewVersions: + - "v1" diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod index 50f3f11f644..ac1e7d4e341 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod +++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod @@ -1,6 +1,6 @@ module tutorial.kubebuilder.io/project -go 1.15 +go 1.16 require ( github.com/go-logr/logr v0.3.0 diff --git a/docs/book/src/migration/manually_migration_guide_v2_v3.md b/docs/book/src/migration/manually_migration_guide_v2_v3.md index 3a995e76bcd..e7938915773 100644 --- a/docs/book/src/migration/manually_migration_guide_v2_v3.md +++ b/docs/book/src/migration/manually_migration_guide_v2_v3.md @@ -353,15 +353,15 @@ Ensure that your `go.mod` is using Go version `1.15` and the following dependenc ```go module example -go 1.15 +go 1.16 require ( github.com/go-logr/logr v0.3.0 github.com/onsi/ginkgo v1.14.1 github.com/onsi/gomega v1.10.2 - k8s.io/apimachinery v0.19.2 - k8s.io/client-go v0.19.2 - sigs.k8s.io/controller-runtime v0.7.0 + k8s.io/apimachinery v0.20.2 + k8s.io/client-go v0.20.2 + sigs.k8s.io/controller-runtime v0.8.3 ) ``` @@ -377,7 +377,7 @@ FROM golang:1.13 as builder With: ``` # Build the manager binary -FROM golang:1.15 as builder +FROM golang:1.16 as builder ``` #### Update your Makefile diff --git a/docs/book/src/migration/migration_guide_v2tov3.md b/docs/book/src/migration/migration_guide_v2tov3.md index be1a1d2dcbd..84227b1db1b 100644 --- a/docs/book/src/migration/migration_guide_v2tov3.md +++ b/docs/book/src/migration/migration_guide_v2tov3.md @@ -39,7 +39,7 @@ go mod init tutorial.kubebuilder.io/migration-project