File tree 2 files changed +4
-7
lines changed
scaffolds/internal/templates/webhooks
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 {
81
81
if f .Force {
82
82
f .IfExistsAction = machinery .OverwriteFile
83
83
} else {
84
- f .IfExistsAction = machinery .SkipFile
84
+ f .IfExistsAction = machinery .Error
85
85
}
86
86
87
87
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 {
119
119
return err
120
120
}
121
121
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 )
128
125
}
129
126
130
127
// check if resource exist to create webhook
You can’t perform that action at this time.
0 commit comments