Skip to content

Commit

Permalink
Merge pull request #4308 from camilamacedo86/fix-follow-up
Browse files Browse the repository at this point in the history
🐛 revert the changes done in the PR #4286
  • Loading branch information
k8s-ci-robot authored Nov 9, 2024
2 parents d79cfa6 + b1db95f commit a9ee390
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (f *Webhook) SetTemplateDefaults() error {
if f.Force {
f.IfExistsAction = machinery.OverwriteFile
} else {
f.IfExistsAction = machinery.SkipFile
f.IfExistsAction = machinery.Error
}

f.AdmissionReviewVersions = "v1"
Expand Down
9 changes: 3 additions & 6 deletions pkg/plugins/golang/v4/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,9 @@ func (p *createWebhookSubcommand) InjectResource(res *resource.Resource) error {
return err
}

// Ensure at least one webhook type is specified
if !p.resource.HasDefaultingWebhook() &&
!p.resource.HasValidationWebhook() &&
!p.resource.HasConversionWebhook() {
return fmt.Errorf("%s create webhook requires at least one of --defaulting, --programmatic-validation, "+
"and --conversion to be true", p.commandName)
if !p.resource.HasDefaultingWebhook() && !p.resource.HasValidationWebhook() && !p.resource.HasConversionWebhook() {
return fmt.Errorf("%s create webhook requires at least one of --defaulting,"+
" --programmatic-validation and --conversion to be true", p.commandName)
}

// check if resource exist to create webhook
Expand Down

0 comments on commit a9ee390

Please sign in to comment.