From 6eb859b3afcf27c1991317feea428d0a64b5b153 Mon Sep 17 00:00:00 2001 From: Mateus Oliveira Date: Fri, 27 Dec 2024 14:34:24 -0300 Subject: [PATCH] fix: tutorial test docs Signed-off-by: Mateus Oliveira --- .../testdata/project/internal/controller/suite_test.go | 6 +++--- .../testdata/project/internal/controller/suite_test.go | 6 +++--- hack/docs/internal/cronjob-tutorial/writing_tests_env.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go index edb60cb7d8d..5a31a16de21 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go +++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go @@ -75,7 +75,7 @@ var _ = BeforeSuite(func() { ctx, cancel = context.WithCancel(context.TODO()) /* - First, the envtest cluster is configured to read CRDs from the CRD directory Kubebuilder scaffolds for you. + The envtest environment is configured to load Custom Resource Definitions (CRDs) from the specified directory. This setup enables the test environment to recognize and interact with the custom resources defined by these CRDs. */ By("bootstrapping test environment") testEnv = &envtest.Environment{ @@ -98,8 +98,8 @@ var _ = BeforeSuite(func() { Expect(cfg).NotTo(BeNil()) /* - The autogenerated test code will add the CronJob Kind schema to the default client-go k8s scheme. - This ensures that the CronJob API/Kind will be used in our test controller. + The CronJob Kind is added to the runtime scheme used by the test environment. + This ensures that the CronJob API is registered with the scheme, allowing the test controller to recognize and interact with CronJob resources. */ err = batchv1.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) diff --git a/docs/book/src/multiversion-tutorial/testdata/project/internal/controller/suite_test.go b/docs/book/src/multiversion-tutorial/testdata/project/internal/controller/suite_test.go index edb60cb7d8d..5a31a16de21 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/internal/controller/suite_test.go +++ b/docs/book/src/multiversion-tutorial/testdata/project/internal/controller/suite_test.go @@ -75,7 +75,7 @@ var _ = BeforeSuite(func() { ctx, cancel = context.WithCancel(context.TODO()) /* - First, the envtest cluster is configured to read CRDs from the CRD directory Kubebuilder scaffolds for you. + The envtest environment is configured to load Custom Resource Definitions (CRDs) from the specified directory. This setup enables the test environment to recognize and interact with the custom resources defined by these CRDs. */ By("bootstrapping test environment") testEnv = &envtest.Environment{ @@ -98,8 +98,8 @@ var _ = BeforeSuite(func() { Expect(cfg).NotTo(BeNil()) /* - The autogenerated test code will add the CronJob Kind schema to the default client-go k8s scheme. - This ensures that the CronJob API/Kind will be used in our test controller. + The CronJob Kind is added to the runtime scheme used by the test environment. + This ensures that the CronJob API is registered with the scheme, allowing the test controller to recognize and interact with CronJob resources. */ err = batchv1.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) diff --git a/hack/docs/internal/cronjob-tutorial/writing_tests_env.go b/hack/docs/internal/cronjob-tutorial/writing_tests_env.go index dae5490fb6b..6fffc7595d2 100644 --- a/hack/docs/internal/cronjob-tutorial/writing_tests_env.go +++ b/hack/docs/internal/cronjob-tutorial/writing_tests_env.go @@ -43,13 +43,13 @@ var ( const SuiteTestReadCRD = ` /* - First, the envtest cluster is configured to read CRDs from the CRD directory Kubebuilder scaffolds for you. + The envtest environment is configured to load Custom Resource Definitions (CRDs) from the specified directory. This setup enables the test environment to recognize and interact with the custom resources defined by these CRDs. */` const SuiteTestAddSchema = ` /* - The autogenerated test code will add the CronJob Kind schema to the default client-go k8s scheme. - This ensures that the CronJob API/Kind will be used in our test controller. + The CronJob Kind is added to the runtime scheme used by the test environment. + This ensures that the CronJob API is registered with the scheme, allowing the test controller to recognize and interact with CronJob resources. */ err = batchv1.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred())