File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
scaffolds/internal/templates/webhooks Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ func (f *Webhook) SetTemplateDefaults() error {
8181 if f .Force {
8282 f .IfExistsAction = machinery .OverwriteFile
8383 } else {
84- f .IfExistsAction = machinery .SkipFile
84+ f .IfExistsAction = machinery .Error
8585 }
8686
8787 f .AdmissionReviewVersions = "v1"
Original file line number Diff line number Diff line change @@ -119,12 +119,9 @@ func (p *createWebhookSubcommand) InjectResource(res *resource.Resource) error {
119119 return err
120120 }
121121
122- // Ensure at least one webhook type is specified
123- if ! p .resource .HasDefaultingWebhook () &&
124- ! p .resource .HasValidationWebhook () &&
125- ! p .resource .HasConversionWebhook () {
126- return fmt .Errorf ("%s create webhook requires at least one of --defaulting, --programmatic-validation, " +
127- "and --conversion to be true" , p .commandName )
122+ if ! p .resource .HasDefaultingWebhook () && ! p .resource .HasValidationWebhook () && ! p .resource .HasConversionWebhook () {
123+ return fmt .Errorf ("%s create webhook requires at least one of --defaulting," +
124+ " --programmatic-validation and --conversion to be true" , p .commandName )
128125 }
129126
130127 // check if resource exist to create webhook
You can’t perform that action at this time.
0 commit comments