Skip to content

Commit

Permalink
fix: tutorial test docs
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Oliveira <[email protected]>
  • Loading branch information
mateusoliveira43 committed Dec 27, 2024
1 parent 944a9de commit 6eb859b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions hack/docs/internal/cronjob-tutorial/writing_tests_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 6eb859b

Please sign in to comment.