Skip to content

Commit d360b1e

Browse files
committed
Update to k8s 1.32 client libs
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 920697c commit d360b1e

12 files changed

+459
-439
lines changed

api/v1alpha1/azureasomanagedcluster_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import (
3131

3232
// SetupAzureASOManagedClusterWebhookWithManager sets up and registers the webhook with the manager.
3333
func SetupAzureASOManagedClusterWebhookWithManager(mgr ctrl.Manager) error {
34-
azureASOManagedClusterWebhook := &azureASOManagedClusterWebhook{}
34+
w := &azureASOManagedClusterWebhook{}
3535
return ctrl.NewWebhookManagedBy(mgr).
3636
For(&AzureASOManagedCluster{}).
37-
WithValidator(azureASOManagedClusterWebhook).
37+
WithValidator(w).
3838
Complete()
3939
}
4040

api/v1alpha1/azureasomanagedcontrolplane_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import (
3131

3232
// SetupAzureASOManagedControlPlaneWebhookWithManager sets up and registers the webhook with the manager.
3333
func SetupAzureASOManagedControlPlaneWebhookWithManager(mgr ctrl.Manager) error {
34-
azureASOManagedControlPlaneWebhook := &azureASOManagedControlPlaneWebhook{}
34+
w := &azureASOManagedControlPlaneWebhook{}
3535
return ctrl.NewWebhookManagedBy(mgr).
3636
For(&AzureASOManagedControlPlane{}).
37-
WithValidator(azureASOManagedControlPlaneWebhook).
37+
WithValidator(w).
3838
Complete()
3939
}
4040

api/v1alpha1/azureasomanagedmachinepool_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import (
3131

3232
// SetupAzureASOManagedMachinePoolWebhookWithManager sets up and registers the webhook with the manager.
3333
func SetupAzureASOManagedMachinePoolWebhookWithManager(mgr ctrl.Manager) error {
34-
azureASOManagedMachinePoolWebhook := &azureASOManagedMachinePoolWebhook{}
34+
w := &azureASOManagedMachinePoolWebhook{}
3535
return ctrl.NewWebhookManagedBy(mgr).
3636
For(&AzureASOManagedMachinePool{}).
37-
WithValidator(azureASOManagedMachinePoolWebhook).
37+
WithValidator(w).
3838
Complete()
3939
}
4040

api/v1beta1/azurecluster_webhook.go

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
"context"
21+
"fmt"
2022
"reflect"
2123

2224
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -31,29 +33,50 @@ import (
3133

3234
// SetupWebhookWithManager sets up and registers the webhook with the manager.
3335
func (c *AzureCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
36+
w := new(azureClusterWebhook)
3437
return ctrl.NewWebhookManagedBy(mgr).
3538
For(c).
39+
WithValidator(w).
40+
WithDefaulter(w).
3641
Complete()
3742
}
3843

3944
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=validation.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4045
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=default.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4146

42-
var _ webhook.Validator = &AzureCluster{}
43-
var _ webhook.Defaulter = &AzureCluster{}
47+
type azureClusterWebhook struct{}
48+
49+
var _ webhook.CustomValidator = &azureClusterWebhook{}
50+
var _ webhook.CustomDefaulter = &azureClusterWebhook{}
51+
52+
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type.
53+
func (_ *azureClusterWebhook) Default(_ context.Context, obj runtime.Object) error {
54+
c, ok := obj.(*AzureCluster)
55+
if !ok {
56+
return fmt.Errorf("expected an AzureCluster object but got %T", c)
57+
}
4458

45-
// Default implements webhook.Defaulter so a webhook will be registered for the type.
46-
func (c *AzureCluster) Default() {
4759
c.setDefaults()
60+
return nil
4861
}
4962

50-
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
51-
func (c *AzureCluster) ValidateCreate() (admission.Warnings, error) {
63+
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
64+
func (_ *azureClusterWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
65+
c, ok := obj.(*AzureCluster)
66+
if !ok {
67+
return nil, fmt.Errorf("expected an AzureCluster object but got %T", c)
68+
}
69+
5270
return c.validateCluster(nil)
5371
}
5472

55-
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
56-
func (c *AzureCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
73+
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
74+
func (_ *azureClusterWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) {
75+
c, ok := newObj.(*AzureCluster)
76+
if !ok {
77+
return nil, fmt.Errorf("expected an AzureCluster object but got %T", c)
78+
}
79+
5780
var allErrs field.ErrorList
5881
old := oldRaw.(*AzureCluster)
5982

@@ -195,7 +218,7 @@ func (c *AzureCluster) validateSubnetUpdate(old *AzureCluster) field.ErrorList {
195218
return allErrs
196219
}
197220

198-
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
199-
func (c *AzureCluster) ValidateDelete() (admission.Warnings, error) {
221+
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
222+
func (_ *azureClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
200223
return nil, nil
201224
}

api/v1beta1/azureclusteridentity_webhook.go

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
"context"
21+
"fmt"
2022
apierrors "k8s.io/apimachinery/pkg/api/errors"
2123
"k8s.io/apimachinery/pkg/runtime"
2224
"k8s.io/apimachinery/pkg/util/validation/field"
@@ -29,22 +31,36 @@ import (
2931

3032
// SetupWebhookWithManager sets up and registers the webhook with the manager.
3133
func (c *AzureClusterIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error {
34+
w := new(azureClusterIdentityWebhook)
3235
return ctrl.NewWebhookManagedBy(mgr).
3336
For(c).
37+
WithValidator(w).
3438
Complete()
3539
}
3640

3741
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclusteridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusteridentities,versions=v1beta1,name=validation.azureclusteridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3842

39-
var _ webhook.Validator = &AzureClusterIdentity{}
43+
type azureClusterIdentityWebhook struct{}
44+
45+
var _ webhook.CustomValidator = &azureClusterIdentityWebhook{}
46+
47+
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
48+
func (_ *azureClusterIdentityWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
49+
c, ok := obj.(*AzureClusterIdentity)
50+
if !ok {
51+
return nil, fmt.Errorf("expected an AzureClusterIdentity object but got %T", c)
52+
}
4053

41-
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
42-
func (c *AzureClusterIdentity) ValidateCreate() (admission.Warnings, error) {
4354
return c.validateClusterIdentity()
4455
}
4556

46-
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
47-
func (c *AzureClusterIdentity) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
57+
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
58+
func (_ *azureClusterIdentityWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) {
59+
c, ok := newObj.(*AzureClusterIdentity)
60+
if !ok {
61+
return nil, fmt.Errorf("expected an AzureClusterIdentity object but got %T", c)
62+
}
63+
4864
var allErrs field.ErrorList
4965
old := oldRaw.(*AzureClusterIdentity)
5066
if err := webhookutils.ValidateImmutable(
@@ -59,7 +75,7 @@ func (c *AzureClusterIdentity) ValidateUpdate(oldRaw runtime.Object) (admission.
5975
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterIdentityKind).GroupKind(), c.Name, allErrs)
6076
}
6177

62-
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
63-
func (c *AzureClusterIdentity) ValidateDelete() (admission.Warnings, error) {
78+
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
79+
func (_ *azureClusterIdentityWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
6480
return nil, nil
6581
}

api/v1beta1/azureclustertemplate_webhook.go

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
"context"
21+
"fmt"
2022
"reflect"
2123

2224
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -32,30 +34,51 @@ const AzureClusterTemplateImmutableMsg = "AzureClusterTemplate spec.template.spe
3234

3335
// SetupWebhookWithManager will set up the webhook to be managed by the specified manager.
3436
func (c *AzureClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
37+
w := new(azureClusterTemplateWebhook)
3538
return ctrl.NewWebhookManagedBy(mgr).
3639
For(c).
40+
WithValidator(w).
41+
WithDefaulter(w).
3742
Complete()
3843
}
3944

4045
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=validation.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4146
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=default.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4247

43-
var _ webhook.Defaulter = &AzureClusterTemplate{}
48+
type azureClusterTemplateWebhook struct{}
49+
50+
var _ webhook.CustomDefaulter = &azureClusterTemplateWebhook{}
51+
52+
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type.
53+
func (_ *azureClusterTemplateWebhook) Default(_ context.Context, obj runtime.Object) error {
54+
c, ok := obj.(*AzureClusterTemplate)
55+
if !ok {
56+
return fmt.Errorf("expected an AzureClusterTemplate object but got %T", c)
57+
}
4458

45-
// Default implements webhook.Defaulter so a webhook will be registered for the type.
46-
func (c *AzureClusterTemplate) Default() {
4759
c.setDefaults()
60+
return nil
4861
}
4962

50-
var _ webhook.Validator = &AzureClusterTemplate{}
63+
var _ webhook.CustomValidator = &azureClusterTemplateWebhook{}
64+
65+
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
66+
func (_ *azureClusterTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
67+
c, ok := obj.(*AzureClusterTemplate)
68+
if !ok {
69+
return nil, fmt.Errorf("expected an AzureClusterTemplate object but got %T", c)
70+
}
5171

52-
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
53-
func (c *AzureClusterTemplate) ValidateCreate() (admission.Warnings, error) {
5472
return c.validateClusterTemplate()
5573
}
5674

57-
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
58-
func (c *AzureClusterTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
75+
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
76+
func (_ *azureClusterTemplateWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) {
77+
c, ok := newObj.(*AzureClusterTemplate)
78+
if !ok {
79+
return nil, fmt.Errorf("expected an AzureClusterTemplate object but got %T", c)
80+
}
81+
5982
var allErrs field.ErrorList
6083
old := oldRaw.(*AzureClusterTemplate)
6184
if !reflect.DeepEqual(c.Spec.Template.Spec, old.Spec.Template.Spec) {
@@ -70,7 +93,7 @@ func (c *AzureClusterTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.
7093
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterTemplateKind).GroupKind(), c.Name, allErrs)
7194
}
7295

73-
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
74-
func (c *AzureClusterTemplate) ValidateDelete() (admission.Warnings, error) {
96+
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
97+
func (_ *azureClusterTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
7598
return nil, nil
7699
}

api/v1beta1/azuremachinetemplate_webhook.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,38 @@ const (
4040

4141
// SetupWebhookWithManager sets up and registers the webhook with the manager.
4242
func (r *AzureMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
43+
w := new(azureMachineTemplateWebhook)
4344
return ctrl.NewWebhookManagedBy(mgr).
4445
For(r).
45-
WithValidator(r).
46-
WithDefaulter(r).
46+
WithValidator(w).
47+
WithDefaulter(w).
4748
Complete()
4849
}
4950

5051
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinetemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremachinetemplates,versions=v1beta1,name=default.azuremachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
5152
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremachinetemplates,versions=v1beta1,name=validation.azuremachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
5253

53-
var _ webhook.CustomDefaulter = &AzureMachineTemplate{}
54-
var _ webhook.CustomValidator = &AzureMachineTemplate{}
54+
type azureMachineTemplateWebhook struct{}
55+
56+
var _ webhook.CustomDefaulter = &azureMachineTemplateWebhook{}
57+
var _ webhook.CustomValidator = &azureMachineTemplateWebhook{}
5558

5659
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
57-
func (r *AzureMachineTemplate) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
58-
t := obj.(*AzureMachineTemplate)
59-
spec := t.Spec.Template.Spec
60+
func (_ *azureMachineTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
61+
r := obj.(*AzureMachineTemplate)
62+
spec := r.Spec.Template.Spec
6063

6164
allErrs := ValidateAzureMachineSpec(spec)
6265

6366
if spec.RoleAssignmentName != "" {
6467
allErrs = append(allErrs,
65-
field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "roleAssignmentName"), t, AzureMachineTemplateRoleAssignmentNameMsg),
68+
field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "roleAssignmentName"), r, AzureMachineTemplateRoleAssignmentNameMsg),
6669
)
6770
}
6871

6972
if spec.SystemAssignedIdentityRole != nil && spec.SystemAssignedIdentityRole.Name != "" {
7073
allErrs = append(allErrs,
71-
field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "systemAssignedIdentityRole", "name"), t, AzureMachineTemplateSystemAssignedIdentityRoleNameMsg),
74+
field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "systemAssignedIdentityRole", "name"), r, AzureMachineTemplateSystemAssignedIdentityRoleNameMsg),
7275
)
7376
}
7477

@@ -94,11 +97,11 @@ func (r *AzureMachineTemplate) ValidateCreate(_ context.Context, obj runtime.Obj
9497
return nil, nil
9598
}
9699

97-
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureMachineTemplateKind).GroupKind(), t.Name, allErrs)
100+
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureMachineTemplateKind).GroupKind(), r.Name, allErrs)
98101
}
99102

100103
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
101-
func (r *AzureMachineTemplate) ValidateUpdate(ctx context.Context, oldRaw runtime.Object, newRaw runtime.Object) (admission.Warnings, error) {
104+
func (r *azureMachineTemplateWebhook) ValidateUpdate(ctx context.Context, oldRaw runtime.Object, newRaw runtime.Object) (admission.Warnings, error) {
102105
var allErrs field.ErrorList
103106
old := oldRaw.(*AzureMachineTemplate)
104107
t := newRaw.(*AzureMachineTemplate)
@@ -123,7 +126,7 @@ func (r *AzureMachineTemplate) ValidateUpdate(ctx context.Context, oldRaw runtim
123126

124127
if err := r.Default(ctx, old); err != nil {
125128
allErrs = append(allErrs,
126-
field.Invalid(field.NewPath("AzureMachineTemplate"), r, fmt.Sprintf("Unable to apply defaults: %v", err)),
129+
field.Invalid(field.NewPath("AzureMachineTemplate"), t, fmt.Sprintf("Unable to apply defaults: %v", err)),
127130
)
128131
}
129132

@@ -142,12 +145,12 @@ func (r *AzureMachineTemplate) ValidateUpdate(ctx context.Context, oldRaw runtim
142145
}
143146

144147
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
145-
func (r *AzureMachineTemplate) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
148+
func (_ *azureMachineTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
146149
return nil, nil
147150
}
148151

149152
// Default implements webhookutil.defaulter so a webhook will be registered for the type.
150-
func (r *AzureMachineTemplate) Default(_ context.Context, obj runtime.Object) error {
153+
func (_ *azureMachineTemplateWebhook) Default(_ context.Context, obj runtime.Object) error {
151154
t := obj.(*AzureMachineTemplate)
152155
if err := t.Spec.Template.Spec.SetDefaultSSHPublicKey(); err != nil {
153156
ctrl.Log.WithName("SetDefault").Error(err, "SetDefaultSSHPublicKey failed")

api/v1beta1/azuremanagedcluster_webhook.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
"context"
2021
"k8s.io/apimachinery/pkg/runtime"
2122
ctrl "sigs.k8s.io/controller-runtime"
2223
"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -30,21 +31,23 @@ func (r *AzureManagedCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
3031
Complete()
3132
}
3233

34+
type azureManagedClusterWebhook struct{}
35+
3336
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcluster,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclusters,versions=v1beta1,name=validation.azuremanagedclusters.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3437

35-
var _ webhook.Validator = &AzureManagedCluster{}
38+
var _ webhook.CustomValidator = &azureManagedClusterWebhook{}
3639

37-
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
38-
func (r *AzureManagedCluster) ValidateCreate() (admission.Warnings, error) {
40+
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
41+
func (r *azureManagedClusterWebhook) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
3942
return nil, nil
4043
}
4144

42-
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
43-
func (r *AzureManagedCluster) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
45+
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
46+
func (r *azureManagedClusterWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) {
4447
return nil, nil
4548
}
4649

47-
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
48-
func (r *AzureManagedCluster) ValidateDelete() (admission.Warnings, error) {
50+
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
51+
func (r *azureManagedClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
4952
return nil, nil
5053
}

0 commit comments

Comments
 (0)