Skip to content

Commit 806fa70

Browse files
authored
Merge pull request #5219 from kubernetes-sigs/master
🌱 Update with changes shipped in patch release 4.10.1
2 parents 9eee7a7 + 8bce950 commit 806fa70

File tree

52 files changed

+641
-200
lines changed

Some content is hidden

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

52 files changed

+641
-200
lines changed

.github/*.instructions.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See [AGENTS.md](../../AGENTS.md) for AI agent guidelines.

.github/workflows/cross-platform-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,3 @@ jobs:
3737

3838
- name: Run Testdata
3939
run: make test-testdata
40-
41-
- name: Run Integration Tests
42-
run: make test-integration
43-

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ go-apidiff:
145145
##@ Tests
146146

147147
.PHONY: test
148-
test: test-unit test-integration test-testdata test-book test-license ## Run the unit and integration tests (used in the CI)
148+
test: test-unit test-integration test-testdata test-book test-license test-gomod ## Run the unit and integration tests (used in the CI)
149149

150150
.PHONY: test-unit
151151
TEST_PKGS := ./pkg/... ./test/e2e/utils/...
@@ -188,6 +188,10 @@ test-book: ## Run the cronjob tutorial's unit tests to make sure we don't break
188188
test-license: ## Run the license check
189189
./test/check-license.sh
190190

191+
.PHONY: test-gomod
192+
test-gomod: ## Run the Go module compatibility check
193+
go run ./hack/test/check_go_module.go
194+
191195
.PHONY: test-external-plugin
192196
test-external-plugin: install ## Run tests for external plugin
193197
make -C docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1 install

docs/book/book.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ src = "src"
55
title = "The Kubebuilder Book"
66

77
[output.html]
8+
default-theme = "light"
9+
preferred-dark-theme = "navy"
810
smart-punctuation = true
911
additional-css = ["theme/css/markers.css", "theme/css/custom.css", "theme/css/version-dropdown.css"]
1012
git-repository-url = "https://github.com/kubernetes-sigs/kubebuilder"

docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,23 @@ type CronJob struct {
192192

193193
// metadata is a standard object metadata
194194
// +optional
195-
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
195+
metav1.ObjectMeta `json:"metadata,omitzero"`
196196

197197
// spec defines the desired state of CronJob
198198
// +required
199199
Spec CronJobSpec `json:"spec"`
200200

201201
// status defines the observed state of CronJob
202202
// +optional
203-
Status CronJobStatus `json:"status,omitempty,omitzero"`
203+
Status CronJobStatus `json:"status,omitzero"`
204204
}
205205

206206
// +kubebuilder:object:root=true
207207

208208
// CronJobList contains a list of CronJob
209209
type CronJobList struct {
210210
metav1.TypeMeta `json:",inline"`
211-
metav1.ListMeta `json:"metadata,omitempty"`
211+
metav1.ListMeta `json:"metadata,omitzero"`
212212
Items []CronJob `json:"items"`
213213
}
214214

docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,24 +197,38 @@ var _ = Describe("Manager", Ordered, func() {
197197
Expect(err).NotTo(HaveOccurred())
198198
Expect(token).NotTo(BeEmpty())
199199

200-
By("waiting for the metrics endpoint to be ready")
201-
verifyMetricsEndpointReady := func(g Gomega) {
202-
cmd := exec.Command("kubectl", "get", "endpoints", metricsServiceName, "-n", namespace)
200+
By("ensuring the controller pod is ready")
201+
verifyControllerPodReady := func(g Gomega) {
202+
cmd := exec.Command("kubectl", "get", "pod", controllerPodName, "-n", namespace,
203+
"-o", "jsonpath={.status.conditions[?(@.type=='Ready')].status}")
203204
output, err := utils.Run(cmd)
204205
g.Expect(err).NotTo(HaveOccurred())
205-
g.Expect(output).To(ContainSubstring("8443"), "Metrics endpoint is not ready")
206+
g.Expect(output).To(Equal("True"), "Controller pod not ready")
206207
}
207-
Eventually(verifyMetricsEndpointReady).Should(Succeed())
208+
Eventually(verifyControllerPodReady, 3*time.Minute, time.Second).Should(Succeed())
208209

209210
By("verifying that the controller manager is serving the metrics server")
210211
verifyMetricsServerStarted := func(g Gomega) {
211212
cmd := exec.Command("kubectl", "logs", controllerPodName, "-n", namespace)
212213
output, err := utils.Run(cmd)
213214
g.Expect(err).NotTo(HaveOccurred())
214-
g.Expect(output).To(ContainSubstring("controller-runtime.metrics\tServing metrics server"),
215+
g.Expect(output).To(ContainSubstring("Serving metrics server"),
215216
"Metrics server not yet started")
216217
}
217-
Eventually(verifyMetricsServerStarted).Should(Succeed())
218+
Eventually(verifyMetricsServerStarted, 3*time.Minute, time.Second).Should(Succeed())
219+
220+
By("waiting for the webhook service endpoints to be ready")
221+
verifyWebhookEndpointsReady := func(g Gomega) {
222+
cmd := exec.Command("kubectl", "get", "endpointslices.discovery.k8s.io", "-n", namespace,
223+
"-l", "kubernetes.io/service-name=project-webhook-service",
224+
"-o", "jsonpath={range .items[*]}{range .endpoints[*]}{.addresses[*]}{end}{end}")
225+
output, err := utils.Run(cmd)
226+
g.Expect(err).NotTo(HaveOccurred(), "Webhook endpoints should exist")
227+
g.Expect(output).ShouldNot(BeEmpty(), "Webhook endpoints not yet ready")
228+
}
229+
Eventually(verifyWebhookEndpointsReady, 3*time.Minute, time.Second).Should(Succeed())
230+
231+
// +kubebuilder:scaffold:e2e-metrics-webhooks-readiness
218232

219233
By("creating the curl-metrics pod to access the metrics endpoint")
220234
cmd = exec.Command("kubectl", "run", "curl-metrics", "--restart=Never",

docs/book/src/getting-started/testdata/project/api/v1alpha1/memcached_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,23 @@ type Memcached struct {
7575

7676
// metadata is a standard object metadata
7777
// +optional
78-
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
78+
metav1.ObjectMeta `json:"metadata,omitzero"`
7979

8080
// spec defines the desired state of Memcached
8181
// +required
8282
Spec MemcachedSpec `json:"spec"`
8383

8484
// status defines the observed state of Memcached
8585
// +optional
86-
Status MemcachedStatus `json:"status,omitempty,omitzero"`
86+
Status MemcachedStatus `json:"status,omitzero"`
8787
}
8888

8989
// +kubebuilder:object:root=true
9090

9191
// MemcachedList contains a list of Memcached
9292
type MemcachedList struct {
9393
metav1.TypeMeta `json:",inline"`
94-
metav1.ListMeta `json:"metadata,omitempty"`
94+
metav1.ListMeta `json:"metadata,omitzero"`
9595
Items []Memcached `json:"items"`
9696
}
9797

docs/book/src/getting-started/testdata/project/test/e2e/e2e_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,24 +192,27 @@ var _ = Describe("Manager", Ordered, func() {
192192
Expect(err).NotTo(HaveOccurred())
193193
Expect(token).NotTo(BeEmpty())
194194

195-
By("waiting for the metrics endpoint to be ready")
196-
verifyMetricsEndpointReady := func(g Gomega) {
197-
cmd := exec.Command("kubectl", "get", "endpoints", metricsServiceName, "-n", namespace)
195+
By("ensuring the controller pod is ready")
196+
verifyControllerPodReady := func(g Gomega) {
197+
cmd := exec.Command("kubectl", "get", "pod", controllerPodName, "-n", namespace,
198+
"-o", "jsonpath={.status.conditions[?(@.type=='Ready')].status}")
198199
output, err := utils.Run(cmd)
199200
g.Expect(err).NotTo(HaveOccurred())
200-
g.Expect(output).To(ContainSubstring("8443"), "Metrics endpoint is not ready")
201+
g.Expect(output).To(Equal("True"), "Controller pod not ready")
201202
}
202-
Eventually(verifyMetricsEndpointReady).Should(Succeed())
203+
Eventually(verifyControllerPodReady, 3*time.Minute, time.Second).Should(Succeed())
203204

204205
By("verifying that the controller manager is serving the metrics server")
205206
verifyMetricsServerStarted := func(g Gomega) {
206207
cmd := exec.Command("kubectl", "logs", controllerPodName, "-n", namespace)
207208
output, err := utils.Run(cmd)
208209
g.Expect(err).NotTo(HaveOccurred())
209-
g.Expect(output).To(ContainSubstring("controller-runtime.metrics\tServing metrics server"),
210+
g.Expect(output).To(ContainSubstring("Serving metrics server"),
210211
"Metrics server not yet started")
211212
}
212-
Eventually(verifyMetricsServerStarted).Should(Succeed())
213+
Eventually(verifyMetricsServerStarted, 3*time.Minute, time.Second).Should(Succeed())
214+
215+
// +kubebuilder:scaffold:e2e-metrics-webhooks-readiness
213216

214217
By("creating the curl-metrics pod to access the metrics endpoint")
215218
cmd = exec.Command("kubectl", "run", "curl-metrics", "--restart=Never",

docs/book/src/logos/favicon.png

-2.75 KB
Binary file not shown.

0 commit comments

Comments
 (0)