Skip to content

Commit 3323208

Browse files
committed
by codereview
Signed-off-by: dongjiang1989 <[email protected]>
1 parent c01736f commit 3323208

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ linters:
130130
- linters:
131131
- staticcheck
132132
text: 'SA1019: .*The component config package has been deprecated and will be removed in a future release.'
133-
- linters:
134-
- staticcheck
135-
text: 'SA1019: .* is deprecated: .* is deprecated, use .* instead '
136133
# With Go 1.16, the new embed directive can be used with an un-named import,
137134
# revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us.
138135
# This directive allows the embed package to be imported with an underscore everywhere.

pkg/builder/webhook.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ import (
3939
// WebhookBuilder builds a Webhook.
4040
type WebhookBuilder[T runtime.Object] struct {
4141
apiType runtime.Object
42-
customDefaulter admission.CustomDefaulter
42+
customDefaulter admission.CustomDefaulter //nolint:staticcheck
4343
defaulter admission.Defaulter[T]
4444
customDefaulterOpts []admission.DefaulterOption
45-
customValidator admission.CustomValidator
45+
customValidator admission.CustomValidator //nolint:staticcheck
4646
validator admission.Validator[T]
4747
customPath string
4848
customValidatorCustomPath string
@@ -308,6 +308,7 @@ func (blder *WebhookBuilder[T]) getValidatingWebhook() (*admission.Webhook, erro
308308
}
309309
w = admission.WithValidator(blder.mgr.GetScheme(), blder.validator)
310310
} else if blder.customValidator != nil {
311+
//nolint:staticcheck
311312
w = admission.WithCustomValidator(blder.mgr.GetScheme(), blder.apiType, blder.customValidator)
312313
}
313314
if w != nil && blder.recoverPanic != nil {

pkg/builder/webhook_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ func (*testDefaulter) Default(ctx context.Context, obj *TestDefaulterObject) err
11801180
return nil
11811181
}
11821182

1183+
//nolint:staticcheck
11831184
var _ admission.CustomDefaulter = &TestCustomDefaulter{}
11841185

11851186
type TestCustomValidator struct{}
@@ -1263,6 +1264,7 @@ func (*testValidator) ValidateDelete(ctx context.Context, obj *TestValidatorObje
12631264
return nil, nil
12641265
}
12651266

1267+
//nolint:staticcheck
12661268
var _ admission.CustomValidator = &TestCustomValidator{}
12671269

12681270
// TestCustomDefaultValidator for default
@@ -1286,6 +1288,7 @@ func (*TestCustomDefaultValidator) Default(ctx context.Context, obj runtime.Obje
12861288
return nil
12871289
}
12881290

1291+
//nolint:staticcheck
12891292
var _ admission.CustomDefaulter = &TestCustomDefaulter{}
12901293

12911294
// TestCustomDefaultValidator for validation
@@ -1345,6 +1348,7 @@ func (*TestCustomDefaultValidator) ValidateDelete(ctx context.Context, obj runti
13451348
return nil, nil
13461349
}
13471350

1351+
//nolint:staticcheck
13481352
var _ admission.CustomValidator = &TestCustomValidator{}
13491353

13501354
type testValidatorDefaulter struct{}

pkg/webhook/alias.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ import (
2626
// CustomDefaulter defines functions for setting defaults on resources.
2727
//
2828
// Deprecated: Use admission.Defaulter instead.
29-
type CustomDefaulter = admission.CustomDefaulter
29+
type CustomDefaulter = admission.CustomDefaulter //nolint:staticcheck
3030

3131
// CustomValidator defines functions for validating an operation.
3232
//
3333
// Deprecated: Use admission.Validator instead.
34-
type CustomValidator = admission.CustomValidator
34+
type CustomValidator = admission.CustomValidator //nolint:staticcheck
3535

3636
// AdmissionRequest defines the input for an admission handler.
3737
// It contains information to identify the object in

0 commit comments

Comments
 (0)