Skip to content

Commit 92e0349

Browse files
authored
Merge pull request #2189 from kubernetes-sigs/master
🌱 prepare for 3.1.0 release
2 parents 533874b + 68841fd commit 92e0349

File tree

78 files changed

+220
-246
lines changed

Some content is hidden

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

78 files changed

+220
-246
lines changed

.github/workflows/testdata.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Go
1919
uses: actions/setup-go@v2
2020
with:
21-
go-version: '1.15'
21+
go-version: '1.16'
2222
- name: Remove pre-installed kustomize
2323
# This step is needed as the following one tries to remove
2424
# kustomize for each test but has no permission to do so

.github/workflows/unit-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Go
2525
uses: actions/setup-go@v2
2626
with:
27-
go-version: '1.15'
27+
go-version: '1.16'
2828
# This step is needed as the following one tries to remove
2929
# kustomize for each test but has no permission to do so
3030
- name: Remove pre-installed kustomize
@@ -54,7 +54,7 @@ jobs:
5454
- name: Setup Go
5555
uses: actions/setup-go@v2
5656
with:
57-
go-version: '1.15'
57+
go-version: '1.16'
5858
- name: Generate the coverage output
5959
run: make test-coverage
6060
- name: Send the coverage output

docs/book/functions/handle-version.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
function notFound(info) {
2+
return {
3+
statusCode: 404,
4+
headers: {'content-type': 'text/html'},
5+
body: ("<h1>Not Found</h1>"+
6+
"<p>You shouldn't see this page, please file a bug</p>"+
7+
`<details><summary>debug details</summary><pre><code>${JSON.stringify(info)}</code></pre></details>`
8+
),
9+
};
10+
}
11+
12+
function redirectToDownload(version, file) {
13+
const loc = `https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/${file}`;
14+
return {
15+
statusCode: 302,
16+
headers: {'location': loc, 'content-type': 'text/plain'},
17+
body: `Redirecting to ${loc}`,
18+
};
19+
}
20+
21+
22+
exports.handler = async function(evt, ctx) {
23+
// grab the prefix too to check for coherence
24+
const [prefix, version, os, arch] = evt.path.split("/").slice(-4);
25+
if (prefix !== 'releases' || !version || !os || !arch) {
26+
return notFound({version: version, os: os, arch: arch, prefix: prefix, rawPath: evt.path});
27+
}
28+
29+
switch(version[0]) {
30+
case '1':
31+
// fallthrough
32+
case '2':
33+
return redirectToDownload(version, `kubebuilder_${version}_${os}_${arch}.tar.gz`);
34+
default:
35+
return redirectToDownload(version, `kubebuilder_${os}_${arch}`);
36+
}
37+
}

docs/book/src/component-config-tutorial/testdata/project/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.15 as builder
2+
FROM golang:1.16 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests
@@ -15,7 +15,7 @@ COPY apis/ apis/
1515
COPY controllers/ controllers/
1616

1717
# Build
18-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
18+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
1919

2020
# Use distroless as minimal base image to package the manager binary
2121
# Refer to https://github.com/GoogleContainerTools/distroless for more details

docs/book/src/component-config-tutorial/testdata/project/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module tutorial.kubebuilder.io/project
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/go-logr/logr v0.2.1

docs/book/src/cronjob-tutorial/testdata/project/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.15 as builder
2+
FROM golang:1.16 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests
@@ -15,7 +15,7 @@ COPY api/ api/
1515
COPY controllers/ controllers/
1616

1717
# Build
18-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
18+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
1919

2020
# Use distroless as minimal base image to package the manager binary
2121
# Refer to https://github.com/GoogleContainerTools/distroless for more details

docs/book/src/cronjob-tutorial/testdata/project/config/crd/patches/webhook_in_cronjobs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions:
16+
- "v1"

docs/book/src/cronjob-tutorial/testdata/project/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module tutorial.kubebuilder.io/project
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/go-logr/logr v0.3.0

docs/book/src/migration/manually_migration_guide_v2_v3.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,15 @@ Ensure that your `go.mod` is using Go version `1.15` and the following dependenc
353353
```go
354354
module example
355355
356-
go 1.15
356+
go 1.16
357357
358358
require (
359359
github.com/go-logr/logr v0.3.0
360360
github.com/onsi/ginkgo v1.14.1
361361
github.com/onsi/gomega v1.10.2
362-
k8s.io/apimachinery v0.19.2
363-
k8s.io/client-go v0.19.2
364-
sigs.k8s.io/controller-runtime v0.7.0
362+
k8s.io/apimachinery v0.20.2
363+
k8s.io/client-go v0.20.2
364+
sigs.k8s.io/controller-runtime v0.8.3
365365
)
366366
```
367367

@@ -377,7 +377,7 @@ FROM golang:1.13 as builder
377377
With:
378378
```
379379
# Build the manager binary
380-
FROM golang:1.15 as builder
380+
FROM golang:1.16 as builder
381381
```
382382

383383
#### Update your Makefile

docs/book/src/migration/migration_guide_v2tov3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ go mod init tutorial.kubebuilder.io/migration-project
3939
<aside class="note warning">
4040
<h1> Migrating to Kubebuilder v3 while staying on the go/v2 plugin </h1>
4141

42-
You can use `--plugins=go/v2` if you wish to continue using "`Kubebuilder 2.x`" layout and avoid dealing with the breaking changes that will be faced because of the default upper versions which will be used now. See that the [controller-tools][controller-tools] `v0.4.1` & [controller-runtime][controller-runtime] `v0.7.0` are just used by default with the `go/v3` plugin layout.
42+
You can use `--plugins=go/v2` if you wish to continue using "`Kubebuilder 2.x`" layout and avoid dealing with the breaking changes that will be faced because of the default upper versions which will be used now. See that the [controller-tools][controller-tools] `v0.4.1` & [controller-runtime][controller-runtime] `v0.8.3` are just used by default with the `go/v3` plugin layout.
4343
</aside>
4444

4545
<aside class="note">
@@ -128,7 +128,7 @@ func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
128128
<aside class="note warning">
129129
<h1>Controller-runtime version updated has breaking changes</h1>
130130
131-
Check [sigs.k8s.io/controller-runtime release docs from 0.7.0+ version][controller-runtime] for breaking changes.
131+
Check [sigs.k8s.io/controller-runtime release docs from 0.8.0+ version][controller-runtime] for breaking changes.
132132
133133
</aside>
134134

docs/book/src/migration/v2vsv3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Projects scaffolded with Kubebuilder v3 will use the `go.kubebuilder.io/v3` plug
4242
* Manager manifests now use `SecurityContext` to address security concerns. More info: [#1637][issue-1637]
4343
- Misc:
4444
* Support for [controller-tools][controller-tools] `v0.4.1` (for `go/v2` it is `v0.3.0` and previously it was `v0.2.5`)
45-
* Support for [controller-runtime][controller-runtime] `v0.7.0` (for `go/v2` it is `v0.6.4` and previously it was `v0.5.0`)
45+
* Support for [controller-runtime][controller-runtime] `v0.8.3` (for `go/v2` it is `v0.6.4` and previously it was `v0.5.0`)
4646
* Support for [kustomize][kustomize] `v3.8.7` (for `go/v2` it is `v3.5.4` and previously it was `v3.1.0`)
4747
* Required Envtest binaries are automatically downloaded
4848
* The minimum Go version is now `1.15` (previously it was `1.13).

docs/book/src/multiversion-tutorial/testdata/project/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.15 as builder
2+
FROM golang:1.16 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests
@@ -15,7 +15,7 @@ COPY api/ api/
1515
COPY controllers/ controllers/
1616

1717
# Build
18-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
18+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
1919

2020
# Use distroless as minimal base image to package the manager binary
2121
# Refer to https://github.com/GoogleContainerTools/distroless for more details

docs/book/src/multiversion-tutorial/testdata/project/config/crd/patches/webhook_in_cronjobs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions:
16+
- "v1"

docs/book/src/multiversion-tutorial/testdata/project/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module tutorial.kubebuilder.io/project
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/go-logr/logr v0.3.0

docs/book/utils/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module sigs.k8s.io/kubebuilder/docs/book/utils
22

3-
go 1.15
3+
go 1.16

docs/book/utils/markerdocs/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ func main() {
256256
if err := plugin.Run(MarkerDocs{
257257
Args: map[string][]string{
258258
// marker args
259-
"": []string{"-wwww", "crd", "webhook", "rbac:roleName=cheddar" /* role name doesn't mean anything here */, "object", "schemapatch:manifests=."},
259+
"": {"-wwww", "crd", "webhook", "rbac:roleName=cheddar" /* role name doesn't mean anything here */, "object", "schemapatch:manifests=."},
260260
// cli options args
261-
"CLI: ": []string{"-hhhh"},
261+
"CLI: ": {"-hhhh"},
262262
},
263263
}, os.Stdin, os.Stdout, os.Args[1:]...); err != nil {
264264
log.Fatal(err.Error())

go.mod

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
module sigs.k8s.io/kubebuilder/v3
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/cloudflare/cfssl v1.5.0 // for `kubebuilder alpha config-gen`
7+
github.com/go-logr/logr v0.3.0 // indirect
78
github.com/gobuffalo/flect v0.2.2
89
// TODO: remove this in favor of embed once using 1.16
910
github.com/markbates/pkger v0.17.1 // for `kubebuilder alpha config-gen`
@@ -15,9 +16,10 @@ require (
1516
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e
1617
// for `kubebuilder alpha config-gen`
1718
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
19+
k8s.io/api v0.20.2 // indirect
20+
k8s.io/apiextensions-apiserver v0.20.1 // indirect
1821
k8s.io/apimachinery v0.20.2 // for `kubebuilder alpha config-gen`
1922
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect
20-
sigs.k8s.io/controller-runtime v0.8.3
2123
sigs.k8s.io/controller-tools v0.3.0 // for `kubebuilder alpha config-gen`
2224
sigs.k8s.io/kustomize/kyaml v0.10.10 // for `kubebuilder alpha config-gen`
2325
sigs.k8s.io/yaml v1.2.0

0 commit comments

Comments
 (0)