Skip to content

Commit 533874b

Browse files
authored
Merge pull request #2163 from kubernetes-sigs/master
🌱 update release-3 for v3.0.0
2 parents a8acd8a + 33ca7eb commit 533874b

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Bug Report
2-
about: Problems and issues with code or docs
2+
description: Problems and issues with code or docs
33
labels:
44
- kind/bug
55
body:
@@ -126,7 +126,7 @@ body:
126126
127127
- type: dropdown
128128
attributes:
129-
label: " "
129+
label: "Extra Labels"
130130
description: |
131131
If this is *also* a documentation request, etc, please select that below.
132132
multiple: true

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# allow free form issues as an escape hatch. This can be taken away if people abuse it ;-)
2-
blank_issues_enabled: true
2+
blank_issues_enabled: true
33

44
# link to CR and CT for easier access
55
contact_links:

.github/ISSUE_TEMPLATE/feature_request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ body:
8181

8282
- type: dropdown
8383
attributes:
84-
label: " "
84+
label: "Extra Labels"
8585
description: |
8686
If this is *also* a documentation request, etc, please select that below.
8787
multiple: true

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ separately.
9595

9696
The docs are published off of three branches:
9797

98-
- `book-v2`: [book.kubebuilder.io](https://book.kubebuilder.io) -- current
99-
docs
98+
- `book-v3`: [book.kubebuilder.io](https://book.kubebuilder.io) -- current docs
99+
- `book-v2`: [book-v2.kubebuilder.io](https://book.kubebuilder.io) -- legacy docs
100100
- `book-v1`:
101101
[book-v1.book.kubebuilder.io](https://book-v1.book.kubebuilder.io) --
102102
legacy docs

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ golangci-lint:
8888
##@ Tests
8989

9090
.PHONY: test
91-
test: test-unit test-integration test-testdata ## Run the unit and integration tests (used in the CI)
91+
test: test-unit test-integration test-testdata test-book ## Run the unit and integration tests (used in the CI)
9292

9393
.PHONY: test-unit
9494
test-unit: ## Run the unit tests
@@ -119,3 +119,7 @@ test-e2e-local: ## Run the end-to-end tests locally
119119
.PHONY: test-e2e-ci
120120
test-e2e-ci: ## Run the end-to-end tests (used in the CI)`
121121
./test/e2e/ci.sh
122+
123+
.PHONY: test-book
124+
test-book: ## Run the cronjob tutorial's unit tests to make sure we don't break it
125+
cd ./docs/book/src/cronjob-tutorial/testdata/project && make test

RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The Kubebuilder Project is released on an as-needed basis. The process is as fol
55
1. An issue is proposing a new release with a changelog since the last release. You will need to use the [kubebuilder-release-tools][kubebuilder-release-tools] to generate the notes. See [here][release-notes-generation]
66
1. All [OWNERS](OWNERS) must LGTM this release
77
1. An OWNER runs `git tag -s $VERSION` and pushes the tag with `git push $VERSION`. Note that after the OWNER push the tag the CI will automatically add the release notes and the assets.
8-
1. A PR needs to be created to merge `release-X` branch into `book-vX` to pick up the new docs.
8+
1. A PR needs to be created to merge `master` branch into `book-v3` to pick up the new docs.
99
1. The release issue is closed
1010
1. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] kubebuilder $VERSION is released`
1111

VERSIONING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ the latest controller-tools release. That info is stored in
3434
## Book Releases
3535

3636
The book's main version (https://book.kubebuilder.io) is published off of
37-
the [book-v2][book-branch] (a version built off the main branch can be
37+
the [book-v3][book-branch] (a version built off the main branch can be
3838
found at https://master.book.kubebuilder.io).
3939

4040
Docs changes that aren't specific to a new feature should be
@@ -43,7 +43,7 @@ The cherry-picks will automatically be published to the book once their PR
4343
merges.
4444

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

4949
[book-branch]: https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases
@@ -57,7 +57,7 @@ the desired next version. Once the PR is merged, Google Cloud Build will
5757
take care of building and publishing the artifacts.
5858

5959
[envtest-ref]: https://book.kubebuilder.io/reference/artifacts.html
60-
[tools-branch]: https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases)
60+
[tools-branch]: https://github.com/kubernetes-sigs/kubebuilder/tree/tools-releases
6161

6262
## Versioning
6363

docs/book/src/cronjob-tutorial/testdata/project/controllers/suite_test.go

+10-8
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,16 @@ var _ = BeforeSuite(func() {
115115
The only difference is that the manager is started in a separate goroutine so it does not block the cleanup of envtest
116116
when you’re done running your tests.
117117
118-
It is not recommended to use the manager client in tests because it is not strongly consistent. Indeed, the manager
119-
client is designed to do the "right thing" for controllers by default which is to read from caches. The best solution
120-
is to instantiate a new client using client.New for tests (as k8sClient above). It will provide a client that reads
121-
directly from the API meaning that you can write tests expecting read-after-write consistency.
122-
123-
However, keep in mind that you should not do this in the controller's conciliation loop (read an object after you have
124-
written it). Kubernetes favors an approach where you first do some reads, process and then do some writes and return.
125-
This way, you let the queue take care of the next cycle of readings if they are necessary.
118+
Note that we set up both a "live" k8s client, separate from the manager. This is because when making assertions in
119+
tests, you generally want to assert against the live state of the API server. If you used the client from the
120+
manager (`k8sManager.GetClient`), you'd end up asserting against the contents of the cache instead, which is slower
121+
and can introduce flakiness into your tests. We could use the manager's `APIReader` to accomplish the same thing,
122+
but that would leave us with two clients in our test assertions and setup (one for reading, one for writing), and
123+
it'd be easy to make mistakes.
124+
125+
Note that we keep the reconciler running against the manager's cache client, though -- we want our controller to
126+
behave as it would in production, and we use features of the cache (like indicies) in our controller which aren't
127+
available when talking directly to the API server.
126128
*/
127129

128130
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{

test.sh

+3-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
source test/common.sh
18-
19-
header_text "Running kubebuilder unit tests"
20-
go test -race -v ./pkg/...
21-
22-
./test/integration.sh
23-
24-
./test/testdata/test.sh
17+
# prow calls this file currently, but we can just use `make test` to test
18+
# the set of things we want.
19+
make test

0 commit comments

Comments
 (0)