From 28051c3c870cf60423786e068b2b1c4ae69019a3 Mon Sep 17 00:00:00 2001 From: Ashish Billore Date: Sat, 19 Mar 2022 15:24:55 +0900 Subject: [PATCH] Fix wordings in cronjob_webhook.go Fix wordings in cronjob_webhook.go about validation methods for better readability. --- .../testdata/project/api/v1/cronjob_webhook.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go index a0c4f2a1129..495db4969f0 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go +++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go @@ -92,9 +92,9 @@ This marker is responsible for generating a validating webhook manifest. //+kubebuilder:webhook:verbs=create;update;delete,path=/validate-batch-tutorial-kubebuilder-io-v1-cronjob,mutating=false,failurePolicy=fail,groups=batch.tutorial.kubebuilder.io,resources=cronjobs,versions=v1,name=vcronjob.kb.io,sideEffects=None,admissionReviewVersions=v1 /* -To validate our CRD beyond what's possible with declarative validation. -Generally, declarative validation should be sufficient, but sometimes more -advanced use cases call for complex validation. +We can validate our CRD beyond what's possible with declarative +validation. Generally, declarative validation should be sufficient, but +sometimes more advanced use cases call for complex validation. For instance, we'll see below that we use this to validate a well-formed cron schedule without making up a long regular expression. @@ -103,7 +103,7 @@ If `webhook.Validator` interface is implemented, a webhook will automatically be served that calls the validation. The `ValidateCreate`, `ValidateUpdate` and `ValidateDelete` methods are expected -to validate that its receiver upon creation, update and deletion respectively. +to validate its receiver upon creation, update and deletion respectively. We separate out ValidateCreate from ValidateUpdate to allow behavior like making certain fields immutable, so that they can only be set on creation. ValidateDelete is also separated from ValidateUpdate to allow different