Skip to content

Commit

Permalink
revert the changes done in the PR kubernetes-sigs#4286
Browse files Browse the repository at this point in the history
We are reverting the changes done in the PR kubernetes-sigs#4286.
We are just keeping the e2e tests improvements.
We will not able to solve the issue kubernetes-sigs#4146 without add new markers.

We cannot skip the action to write an webhook since
it will result in incomplete inplementation in the <kind>_webhook.go as in
the <kind>_webhook_test.go
  • Loading branch information
camilamacedo86 committed Nov 9, 2024
1 parent f3a65b6 commit b1db95f
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 b1db95f

Please sign in to comment.