Skip to content

Commit 2c13031

Browse files
Merge pull request #625 from stuggi/remove-webhook-interface-assertions
Remove deprecated webhook.Defaulter/Validator interface assertions
2 parents 80e29d8 + bbf7d7b commit 2c13031

7 files changed

Lines changed: 0 additions & 33 deletions

File tree

apis/memcached/v1beta1/memcached_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"k8s.io/apimachinery/pkg/runtime/schema"
2929
"k8s.io/apimachinery/pkg/util/validation/field"
3030
logf "sigs.k8s.io/controller-runtime/pkg/log"
31-
"sigs.k8s.io/controller-runtime/pkg/webhook"
3231
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3332

3433
common_webhook "github.com/openstack-k8s-operators/lib-common/modules/common/webhook"
@@ -50,8 +49,6 @@ func SetupMemcachedDefaults(defaults MemcachedDefaults) {
5049
memcachedlog.Info("Memcached defaults initialized", "defaults", defaults)
5150
}
5251

53-
var _ webhook.Defaulter = &Memcached{}
54-
5552
// Default implements webhook.Defaulter so a webhook will be registered for the type
5653
func (r *Memcached) Default() {
5754
memcachedlog.Info("default", "name", r.Name)
@@ -72,8 +69,6 @@ func (spec *MemcachedSpecCore) Default() {
7269
// nothing here
7370
}
7471

75-
var _ webhook.Validator = &Memcached{}
76-
7772
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
7873
func (r *Memcached) ValidateCreate() (admission.Warnings, error) {
7974
memcachedlog.Info("validate create", "name", r.Name)

apis/network/v1beta1/dnsmasq_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"k8s.io/apimachinery/pkg/runtime/schema"
2626
"k8s.io/apimachinery/pkg/util/validation/field"
2727
logf "sigs.k8s.io/controller-runtime/pkg/log"
28-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2928
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3029
)
3130

@@ -45,8 +44,6 @@ func SetupDNSMasqDefaults(defaults DNSMasqDefaults) {
4544
dnsmasqlog.Info("DNSMasq defaults initialized", "defaults", defaults)
4645
}
4746

48-
var _ webhook.Defaulter = &DNSMasq{}
49-
5047
// Default implements webhook.Defaulter so a webhook will be registered for the type
5148
func (r *DNSMasq) Default() {
5249
dnsmasqlog.Info("default", "name", r.Name)
@@ -85,8 +82,6 @@ func (spec *DNSMasqSpecCore) Default(namespace string) {
8582
}
8683
}
8784

88-
var _ webhook.Validator = &DNSMasq{}
89-
9085
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
9186
func (r *DNSMasq) ValidateCreate() (admission.Warnings, error) {
9287
dnsmasqlog.Info("validate create", "name", r.Name)

apis/network/v1beta1/ipset_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,19 @@ import (
2929
"k8s.io/apimachinery/pkg/util/validation/field"
3030
k8snet "k8s.io/utils/net"
3131
logf "sigs.k8s.io/controller-runtime/pkg/log"
32-
"sigs.k8s.io/controller-runtime/pkg/webhook"
3332
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3433
)
3534

3635
// log is for logging in this package.
3736
var ipsetlog = logf.Log.WithName("ipset-resource")
3837

39-
var _ webhook.Defaulter = &IPSet{}
40-
4138
// Default implements webhook.Defaulter so a webhook will be registered for the type
4239
func (r *IPSet) Default() {
4340
ipsetlog.Info("default", "name", r.Name)
4441

4542
// TODO(user): fill in your defaulting logic.
4643
}
4744

48-
var _ webhook.Validator = &IPSet{}
49-
5045
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
5146
func (r *IPSet) ValidateCreate() (admission.Warnings, error) {
5247
ipsetlog.Info("validate create", "name", r.Name)

apis/network/v1beta1/netconfig_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ import (
3030
"k8s.io/apimachinery/pkg/util/validation/field"
3131
k8snet "k8s.io/utils/net"
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

3736
// log is for logging in this package.
3837
var netconfiglog = logf.Log.WithName("netconfig-resource")
3938

40-
var _ webhook.Defaulter = &NetConfig{}
41-
4239
// Default implements webhook.Defaulter so a webhook will be registered for the type
4340
func (r *NetConfig) Default() {
4441
for idx, net := range r.Spec.Networks {
@@ -48,8 +45,6 @@ func (r *NetConfig) Default() {
4845
}
4946
}
5047

51-
var _ webhook.Validator = &NetConfig{}
52-
5348
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
5449
func (r *NetConfig) ValidateCreate() (admission.Warnings, error) {
5550
netconfiglog.Info("validate create", "name", r.Name)

apis/network/v1beta1/reservation_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,19 @@ package v1beta1
1919
import (
2020
"k8s.io/apimachinery/pkg/runtime"
2121
logf "sigs.k8s.io/controller-runtime/pkg/log"
22-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2322
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2423
)
2524

2625
// log is for logging in this package.
2726
var reservationlog = logf.Log.WithName("reservation-resource")
2827

29-
var _ webhook.Defaulter = &Reservation{}
30-
3128
// Default implements webhook.Defaulter so a webhook will be registered for the type
3229
func (r *Reservation) Default() {
3330
reservationlog.Info("default", "name", r.Name)
3431

3532
// TODO(user): fill in your defaulting logic.
3633
}
3734

38-
var _ webhook.Validator = &Reservation{}
39-
4035
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
4136
func (r *Reservation) ValidateCreate() (admission.Warnings, error) {
4237
reservationlog.Info("validate create", "name", r.Name)

apis/rabbitmq/v1beta1/rabbitmq_webhook.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"k8s.io/apimachinery/pkg/util/validation/field"
3030
"sigs.k8s.io/controller-runtime/pkg/client"
3131
logf "sigs.k8s.io/controller-runtime/pkg/log"
32-
"sigs.k8s.io/controller-runtime/pkg/webhook"
3332
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3433
)
3534

@@ -162,8 +161,6 @@ func (spec *RabbitMqSpecCore) Default(isNew bool) {
162161
}
163162
}
164163

165-
var _ webhook.Validator = &RabbitMq{}
166-
167164
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
168165
func (r *RabbitMq) ValidateCreate() (admission.Warnings, error) {
169166
rabbitmqlog.Info("validate create", "name", r.Name)

apis/redis/v1beta1/redis_webhook.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"k8s.io/apimachinery/pkg/runtime/schema"
2929
"k8s.io/apimachinery/pkg/util/validation/field"
3030
logf "sigs.k8s.io/controller-runtime/pkg/log"
31-
"sigs.k8s.io/controller-runtime/pkg/webhook"
3231
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3332

3433
common_webhook "github.com/openstack-k8s-operators/lib-common/modules/common/webhook"
@@ -50,8 +49,6 @@ func SetupRedisDefaults(defaults RedisDefaults) {
5049
redislog.Info("Redis defaults initialized", "defaults", defaults)
5150
}
5251

53-
var _ webhook.Defaulter = &Redis{}
54-
5552
// Default implements webhook.Defaulter so a webhook will be registered for the type
5653
func (r *Redis) Default() {
5754
redislog.Info("default", "name", r.Name)
@@ -72,8 +69,6 @@ func (spec *RedisSpecCore) Default() {
7269
//nothing to validate yet
7370
}
7471

75-
var _ webhook.Validator = &Redis{}
76-
7772
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
7873
func (r *Redis) ValidateCreate() (admission.Warnings, error) {
7974
redislog.Info("validate create", "name", r.Name)

0 commit comments

Comments
 (0)