Skip to content

Commit 75241ab

Browse files
authored
Merge pull request #2643 from kubernetes-sigs/master
🌱 Prepare for release 3.4.0
2 parents 47859bf + 61b263c commit 75241ab

File tree

270 files changed

+9744
-3329
lines changed

Some content is hidden

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

270 files changed

+9744
-3329
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
3-
Hiya! Welcome to KubeBuilder! For a smooth PR process, please ensure
3+
Hiya! Welcome to Kubebuilder! For a smooth PR process, please ensure
44
that you include the following information:
55
66
* a description of the change

.github/workflows/apidiff.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
go-version: '1.17'
2323
- name: Execute go-apidiff
24-
uses: joelanford/go-apidiff@v0.1.0
24+
uses: joelanford/go-apidiff@v0.2.0
2525
with:
2626
compare-imports: true
2727
print-compatible: true

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Run linter
1919
uses: golangci/golangci-lint-action@v2
2020
with:
21-
version: v1.41 # Always uses the latest patch version.
21+
version: v1.45.2 # Always uses the latest patch version.
2222
only-new-issues: true # Show only new issues if it's a pull request
2323
- name: Report failure
2424
uses: nashmaniac/[email protected]

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ You can reach the maintainers of this project at:
125125
## Becoming a reviewer or approver
126126

127127
Contributors may eventually become official reviewers or approvers in
128-
KubeBuilder and the related repositories. See
128+
Kubebuilder and the related repositories. See
129129
[CONTRIBUTING-ROLES.md](docs/CONTRIBUTING-ROLES.md) for more information.
130130

131131
## Code of conduct

DESIGN.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# KubeBuilder Design Principles
1+
# Kubebuilder Design Principles
22

3-
This lays out some of the guiding design principles behind the KubeBuilder
3+
This lays out some of the guiding design principles behind the Kubebuilder
44
project and its various components.
55

66
## Overarching
@@ -26,15 +26,15 @@ project and its various components.
2626
coding, and it may involve interoperating with lower-level components,
2727
but it should be possible without unreasonable friction.
2828

29-
## KubeBuilder
29+
## Kubebuilder
3030

31-
* **KubeBuilder Has Opinions**: KubeBuilder exists as an opinionated
31+
* **Kubebuilder Has Opinions**: Kubebuilder exists as an opinionated
3232
project generator. It should strive to give users a reasonable project
3333
layout that's simple enough to understand when getting started, but
3434
provides room to grow. It might not match everyone's opinions, but it
3535
should strive to be useful to most.
3636

37-
* **Batteries Included**: KubeBuilder projects should contain enough
37+
* **Batteries Included**: Kubebuilder projects should contain enough
3838
deployment information to reasonably develop and run the scaffolded
3939
project. This includes testing, deployment files, and development
4040
infrastructure to go from code to running containers.
@@ -99,7 +99,7 @@ project and its various components.
9999

100100
* **Well-commented code**: Code should be commented and given Godocs, even
101101
private methods and functions. It may *seem* obvious what they do at the
102-
time and why, but you might forget, and other will certainly come along.
102+
time and why, but you might forget, and others will certainly come along.
103103

104104
* **Test Behaviors**: Test cases should be comprehensible as sets of
105105
expected behaviors. Test cases read without code (e.g. just using `It`,

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
8282
golangci-lint:
8383
@[ -f $(GOLANGCI_LINT) ] || { \
8484
set -e ;\
85-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.41.1 ;\
85+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.45.2 ;\
8686
}
8787

8888
.PHONY: apidiff
@@ -98,7 +98,7 @@ go-apidiff:
9898
##@ Tests
9999

100100
.PHONY: test
101-
test: test-unit test-integration test-testdata test-book ## Run the unit and integration tests (used in the CI)
101+
test: test-unit test-integration test-testdata test-book test-license ## Run the unit and integration tests (used in the CI)
102102

103103
.PHONY: test-unit
104104
TEST_PKGS := ./pkg/... ./test/e2e/utils/...
@@ -134,3 +134,7 @@ test-e2e-ci: ## Run the end-to-end tests (used in the CI)`
134134
.PHONY: test-book
135135
test-book: ## Run the cronjob tutorial's unit tests to make sure we don't break it
136136
cd ./docs/book/src/cronjob-tutorial/testdata/project && make test
137+
138+
.PHONY: test-license
139+
test-license: ## Run the license check
140+
./test/check-license.sh

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Kubebuilder increases velocity and reduces the complexity managed by
1212
developers for rapidly building and publishing Kubernetes APIs in Go.
1313
It builds on top of the canonical techniques used to build the core Kubernetes APIs to provide simple abstractions that reduce boilerplate and toil.
1414

15-
**Note:** kubebuilder does not exist as an example to *copy-paste*, but instead provides powerful libraries and tools
15+
**Note:** Kubebuilder does not exist as an example to *copy-paste*, but instead provides powerful libraries and tools
1616
to simplify building and publishing Kubernetes APIs from scratch.
1717

1818
Kubebuilder is developed on top of the controller-runtime and controller-tools libraries.
@@ -63,7 +63,7 @@ Building APIs using CRDs, Controllers and Admission Webhooks.
6363

6464
## Philosophy
6565

66-
See [DESIGN.md](DESIGN.md) for the guiding principles of the various KubeBuilder projects.
66+
See [DESIGN.md](DESIGN.md) for the guiding principles of the various Kubebuilder projects.
6767

6868
TL;DR:
6969

VERSIONING.md

+6-50
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Versioning and Releasing for KubeBuilder
1+
# Versioning and Releasing for Kubebuilder
22

3-
We (mostly) follow the [common KubeBuilder versioning
3+
We (mostly) follow the [common Kubebuilder versioning
44
guidelines][guidelines], and use the corresponding tooling and PR process
55
described there.
66

7-
For the purposes of the aforementioned guidelines, KubeBuilder counts as
7+
For the purposes of the aforementioned guidelines, Kubebuilder counts as
88
a "CLI project".
99

1010
[guidelines]: https://sigs.k8s.io/kubebuilder-release-tools/VERSIONING.md
1111

12-
## Compability
12+
## Compatibility
1313

1414
Note that we generally do not support older release branches, except in
1515
extreme circumstances.
@@ -42,7 +42,7 @@ cherry-picked to the aforementioned branch to get them to be published.
4242
The cherry-picks will automatically be published to the book once their PR
4343
merges.
4444

45-
**When you publish a KubeBuilder release**, be sure to also submit a PR
45+
**When you publish a Kubebuilder release**, be sure to also submit a PR
4646
that merges the main branch into [book-v3][book-branch], so that it
4747
describes the latest changes in the new release.
4848

@@ -58,49 +58,5 @@ take care of building and publishing the artifacts.
5858

5959
[envtest-ref]: https://book.kubebuilder.io/reference/artifacts.html
6060
[tools-branch]: https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases
61-
62-
## Versioning
63-
64-
| Name | Example | Description |
65-
|--- |--- |--- |
66-
| KubeBuilder version | `v2.2.0`, `v2.3.0`, `v2.3.1` | Tagged versions of the KubeBuilder project, representing changes to the source code in this repository. See the [releases][kb-releases] page for binary releases. |
67-
| Project version | `"1"`, `"2"`, `"3"` | Project version defines the scheme of a `PROJECT` configuration file. This version is defined in a `PROJECT` file's `version`. |
68-
| Plugin version | `v2`, `v3` | Represents the version of an individual plugin, as well as the corresponding scaffolding that it generates. This version is defined in a plugin key, ex. `go.kubebuilder.io/v2`. See the [design doc][cli-plugins-versioning] for more details. |
69-
70-
### Incrementing versions
71-
72-
For more information on how KubeBuilder release versions work, see the [semver](https://semver.org/) documentation.
73-
74-
Project versions should only be increased if a breaking change is introduced in the PROJECT file scheme itself. Changes to the Go scaffolding or the KubeBuilder CLI *do not* affect project version.
75-
76-
Similarly, the introduction of a new plugin version might only lead to a new minor version release of KubeBuilder, since no breaking change is being made to the CLI itself. It'd only be a breaking change to KubeBuilder if we remove support for an older plugin version. See the plugins design doc [versioning section][cli-plugins-versioning]
77-
for more details on plugin versioning.
78-
79-
**NOTE:** the scheme for project version `"2"` was defined before the concept of plugins was introduced, so plugin `go.kubebuilder.io/v2` is implicitly used for those project types. Schema for project versions `"3"` and beyond define a `layout` key that informs the plugin system of which plugin to use.
80-
81-
## Introducing changes to plugins
82-
83-
Changes made to plugins only require a plugin version increase if and only if a change is made to a plugin
84-
that breaks projects scaffolded with the previous plugin version. Once a plugin version `vX` is stabilized (it doesn't
85-
have an "alpha" or "beta" suffix), a new plugin package should be created containing a new plugin with version
86-
`v(X+1)-alpha`. Typically this is done by (semantically) `cp -r pkg/plugins/golang/vX pkg/plugins/golang/v(X+1)` then updating
87-
version numbers and paths. All further breaking changes to the plugin should be made in this package; the `vX`
88-
plugin would then be frozen to breaking changes.
89-
90-
You must also add a migration guide to the [migrations](https://book.kubebuilder.io/migrations.html)
91-
section of the KubeBuilder book in your PR. It should detail the steps required
92-
for users to upgrade their projects from `vX` to `v(X+1)-alpha`.
93-
94-
### Example
95-
96-
KubeBuilder scaffolds projects with plugin `go.kubebuilder.io/v3` by default.
97-
98-
You create a feature that adds a new marker to the file `main.go` scaffolded by `init`
99-
that `create api` will use to update that file. The changes introduced in your feature
100-
would cause errors if used with projects built with plugins `go.kubebuilder.io/v2`
101-
without users manually updating their projects. Thus, your changes introduce a breaking change
102-
to plugin `go.kubebuilder.io`, and can only be merged into plugin version `v3-alpha`.
103-
This plugin's package should exist already.
104-
10561
[kb-releases]:https://github.com/kubernetes-sigs/kubebuilder/releases
106-
[cli-plugins-versioning]:docs/book/src/plugins/cli-plugins.md
62+
[cli-plugins-versioning]:docs/book/src/plugins/extending-cli.md#plugin-versioning

build/.goreleaser.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ builds:
4242
- linux_arm64
4343
- linux_ppc64le
4444
- darwin_amd64
45+
- darwin_arm64
4546
env:
46-
- KUBERNETES_VERSION=1.23.1
47+
- KUBERNETES_VERSION=1.23.5
4748
- CGO_ENABLED=0
4849

4950
# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.

build/cloudbuild_snapshot.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ steps:
3939
args: ["tar", "-zcvf", "kubebuilder_darwin_amd64.tar.gz", "-C", "dist/kubebuilder_darwin_amd64", "kubebuilder"]
4040
- name: "gcr.io/cloud-builders/gsutil"
4141
args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_darwin_amd64.tar.gz", "gs://kubebuilder-release/kubebuilder_master_darwin_amd64.tar.gz"]
42+
- name: "ubuntu"
43+
args: ["tar", "-zcvf", "kubebuilder_darwin_arm64.tar.gz", "-C", "dist/kubebuilder_darwin_arm64", "kubebuilder"]
44+
- name: "gcr.io/cloud-builders/gsutil"
45+
args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_darwin_arm64.tar.gz", "gs://kubebuilder-release/kubebuilder_master_darwin_arm64.tar.gz"]

designs/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Designs
22
=======
33

4-
These are design documents for changes to KubeBuilder (and
4+
These are design documents for changes to Kubebuilder (and
55
cross-repository changes for related projects, like controller-runtime and
66
controller-tools). They exist to help document the design processes that
7-
go into writing KubeBuilder, but may not be up-to-date (more below).
7+
go into writing Kubebuilder, but may not be up-to-date (more below).
88

9-
Not all changes to KubeBuilder need a design document -- only major ones.
9+
Not all changes to Kubebuilder need a design document -- only major ones.
1010
Use your best judgement.
1111

1212
When submitting a design document, we encourage having written
@@ -17,10 +17,10 @@ proof-of-concept process can help iron out wrinkles and can help with the
1717

1818
## Out-of-Date Designs
1919

20-
**KubeBuilder documentation (the [book](https://book.kubebuilder.io) and
20+
**Kubebuilder documentation (the [book](https://book.kubebuilder.io) and
2121
the [GoDoc](https://pkg.go.dev/sigs.k8s.io/controller-runtime?tab=doc)) should be
2222
considered the canonical, update-to-date reference and architectural
23-
documentation** for KubeBuilder.
23+
documentation** for Kubebuilder.
2424

2525
However, if you see an out-of-date design document, feel free to submit
2626
a PR marking it as such, and add an addendum linking to issues documenting

designs/simplified-scaffolding.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,27 @@ $ tree ./test/project/pkg/controller
9797

9898
## Motivation
9999

100-
The current scaffolding in KubeBuilder has two main problems:
100+
The current scaffolding in Kubebuilder has two main problems:
101101
comprehensibility and dependency passing.
102102

103103
### Complicated Initial Structure
104104

105-
While the structure of KubeBuilder projects will likely feel at home for
105+
While the structure of Kubebuilder projects will likely feel at home for
106106
existing Kubernetes contributors (since it matches the structure of
107107
Kubernetes itself quite closely), it provides a fairly convoluted
108108
experience out of the box.
109109

110110
Even for a single controller and API type (without a webhook), it
111111
generates 8 API-related files and 5 controller-related files. Of those
112-
files, 6 are KubeBuilder-specific glue code, 4 are test setup, and
112+
files, 6 are Kubebuilder-specific glue code, 4 are test setup, and
113113
1 contains standard Kubernetes glue code, leaving only 2 with actual
114114
user-edited code.
115115

116116
This proliferation of files makes it difficult for users to understand how
117117
their code relates to the library, posing some barrier for initial adoption
118118
and moving beyond a basic knowledge of functionality to actual
119119
understanding of the structure. A common line of questioning amongst
120-
newcomers to KubeBuilder includes "where should I put my code that adds
120+
newcomers to Kubebuilder includes "where should I put my code that adds
121121
new types to a scheme" (and similar questions), which indicates that it's
122122
not immediately obvious to these users why the project is structured the
123123
way it is.
@@ -148,13 +148,13 @@ construction of controllers (e.g. this [one file
148148
controller](https://github.com/DirectXMan12/sample-controller/blob/workshop/main.go)
149149
used as a getting started example for a workshop).
150150

151-
Current KubeBuilder scaffolding does not take advantage of the builder,
151+
Current Kubebuilder scaffolding does not take advantage of the builder,
152152
leaving generated code using the lower-level constructs which require more
153153
understanding of the internals of controller-runtime to comprehend.
154154

155155
### Dependency Passing Woes
156156

157-
Another common line of questioning amongst KubeBuilder users is "how to
157+
Another common line of questioning amongst Kubebuilder users is "how to
158158
I pass dependencies to my controllers?". This ranges from "how to I pass
159159
custom clients for the software I'm running" to "how to I pass
160160
configuration from files and flags down to my controllers" (e.g.
@@ -300,7 +300,7 @@ There are three options here:
300300
bury types deeper in a directory structure.
301301

302302
2. Try to move things and rename references. This takes a lot more effort
303-
on the KubeBuilder maintainers' part if we try to rename references
303+
on the Kubebuilder maintainers' part if we try to rename references
304304
across the codebase. Not so much if we force the user to, but that's
305305
a poorer experience.
306306

@@ -332,9 +332,9 @@ registering types to the scheme, and we can always fall back to emitting
332332
code for the user to place in manually if we can't find the correct
333333
comment.
334334

335-
### Making this work with Existing KubeBuilder Installations
335+
### Making this work with Existing Kubebuilder Installations
336336

337-
KubeBuilder projects currently have a `PROJECT` file that can be used to
337+
Kubebuilder projects currently have a `PROJECT` file that can be used to
338338
store information about project settings. We can make use of this to
339339
store a "scaffolding version", where we increment versions when making
340340
incompatible changes to how the scaffolding works.

docs/CONTRIBUTING-ROLES.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributing Roles
44
## Direct Code-Related Roles
55

66
While anyone (who's signed the [CLA and follows the code of
7-
conduct](../CONTRIBUTING.md)) is welcome to contribute to the KubeBuilder
7+
conduct](../CONTRIBUTING.md)) is welcome to contribute to the Kubebuilder
88
project, we've got two "formal" roles that carry additional privileges and
99
responsibilities: *reviewer* and *approver*.
1010

@@ -25,10 +25,10 @@ kubebuilder-admins in the `OWNERS_ALIASES` file).
2525
Anyone who wants to become a reviewer or approver must first be a [member
2626
of the Kubernetes project][kube-member]. The aforementioned doc has more
2727
details, but the gist is that you must have made a couple contributions to
28-
some part of the Kubernetes project -- *this includes KubeBuilder and
28+
some part of the Kubernetes project -- *this includes Kubebuilder and
2929
related repos*. Then, you need two existing members to sponsor you.
3030

31-
**If you've contributed a few times to KubeBuilder, we'll be happy to
31+
**If you've contributed a few times to Kubebuilder, we'll be happy to
3232
sponsor you, just ping us on Slack :-)**
3333

3434
## Reviewers

docs/book/install-and-build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ ${cmd} /tmp/mdbook.${ext}
6767
chmod +x /tmp/mdbook
6868

6969
echo "grabbing the latest released controller-gen"
70-
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0
70+
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0
7171

7272
# make sure we add the go bin directory to our path
7373
gobin=$(go env GOBIN)
74-
gobin=${GOBIN:-$(go env GOPATH)/bin} # GOBIN won't always be set :-/
74+
gobin=${GOBIN:-$(go env GOPATH)/bin} # GOBIN won't always be set :-/
7575

7676
export PATH=${gobin}:$PATH
7777
verb=${1:-build}

docs/book/src/SUMMARY.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@
9696
- [Configuring EnvTest](./reference/envtest.md)
9797

9898
- [Metrics](./reference/metrics.md)
99+
100+
- [Reference](./reference/metrics-reference.md)
101+
99102
- [Makefile Helpers](./reference/makefile-helpers.md)
100103
- [Project config](./reference/project-config.md)
101104

@@ -105,9 +108,14 @@
105108

106109
- [Extending the CLI](./plugins/extending-cli.md)
107110
- [Creating your own plugins](./plugins/creating-plugins.md)
111+
- [Available Plugins](./plugins/available-plugins.md)
112+
- [go/v3 plugin](./plugins/go-v3-plugin.md)
113+
- [go/v2 plugin](./plugins/go-v2-plugin.md)
114+
- [Declarative V1](./plugins/declarative-v1.md)
115+
- [Plugins Versioning](./plugins/plugins-versioning.md)
108116

109117
---
110118
[Appendix: The TODO Landing Page](./TODO.md)
111119

112120

113-
[plugins]: ./plugins/plugins.md
121+
[plugins]: ./plugins/plugins.md

docs/book/src/component-config-tutorial/define-config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ values that are passed into the controller, to do this we can take a look at
77
{{#literatego ./testdata/controller_manager_config.yaml}}
88

99
To see all the available fields you can look at the `v1alpha` Controller
10-
Runtime config [ControllerManagerConfiguration](configtype)
10+
Runtime config [ControllerManagerConfiguration][configtype]
1111

1212
[configtype]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerManagerConfigurationSpec

0 commit comments

Comments
 (0)