Skip to content

Commit

Permalink
Remove unnecessary manageJobsWithoutQueueName field on deployment web…
Browse files Browse the repository at this point in the history
  • Loading branch information
mbobrovskyi authored and kannon92 committed Dec 5, 2024
1 parent 4f7927d commit 17dd411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions pkg/controller/jobs/deployment/deployment_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ import (
)

type Webhook struct {
client client.Client
manageJobsWithoutQueueName bool
client client.Client
}

func SetupWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
options := jobframework.ProcessOptions(opts...)
func SetupWebhook(mgr ctrl.Manager, _ ...jobframework.Option) error {
wh := &Webhook{
client: mgr.GetClient(),
manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
client: mgr.GetClient(),
}
obj := &appsv1.Deployment{}
return webhook.WebhookManagedBy(mgr).
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/jobs/deployment/deployment_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ func TestDefault(t *testing.T) {
cli := builder.Build()

w := &Webhook{
client: cli,
manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName,
client: cli,
}

ctx, _ := utiltesting.ContextWithLog(t)
Expand Down

0 comments on commit 17dd411

Please sign in to comment.