Skip to content

Commit 494e39e

Browse files
committed
Remove deprecated webhook.Defaulter/Validator interface assertions
These compile-time assertions reference webhook.Defaulter and webhook.Validator interfaces that are removed in controller-runtime v0.21 (OCP 4.20). The assertions are dead code — webhook registration already uses CustomDefaulter/CustomValidator in internal/webhook/. Removing them makes the API module forward-compatible with CR v0.21 so that consumers (like openstack-operator) can bump controller-runtime without needing replace directives for this operator. Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent 8920bcd commit 494e39e

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

api/placement/v1beta1/api_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"k8s.io/apimachinery/pkg/runtime/schema"
3131
"k8s.io/apimachinery/pkg/util/validation/field"
3232
logf "sigs.k8s.io/controller-runtime/pkg/log"
33-
"sigs.k8s.io/controller-runtime/pkg/webhook"
3433
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3534
)
3635

@@ -51,8 +50,6 @@ func SetupPlacementAPIDefaults(defaults PlacementAPIDefaults) {
5150
placementapilog.Info("PlacementAPI defaults initialized", "defaults", defaults)
5251
}
5352

54-
var _ webhook.Defaulter = &PlacementAPI{}
55-
5653
// Default implements webhook.Defaulter so a webhook will be registered for the type
5754
func (r *PlacementAPI) Default() {
5855
placementapilog.Info("default", "name", r.Name)
@@ -75,8 +72,6 @@ func (spec *PlacementAPISpecCore) Default() {
7572
// nothing here yet
7673
}
7774

78-
var _ webhook.Validator = &PlacementAPI{}
79-
8075
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
8176
func (r *PlacementAPI) ValidateCreate() (admission.Warnings, error) {
8277
placementapilog.Info("validate create", "name", r.Name)

0 commit comments

Comments
 (0)