Skip to content

Commit 7720a94

Browse files
committed
Set DefaulterRemoveUnknownOrOmitableFields webhook option to preserve previous behavior
Signed-off-by: Stefan Büringer [email protected]
1 parent 8ecc5f5 commit 7720a94

File tree

19 files changed

+19
-19
lines changed

19 files changed

+19
-19
lines changed

bootstrap/kubeadm/internal/webhooks/kubeadmconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
func (webhook *KubeadmConfig) SetupWebhookWithManager(mgr ctrl.Manager) error {
3434
return ctrl.NewWebhookManagedBy(mgr).
3535
For(&bootstrapv1.KubeadmConfig{}).
36-
WithDefaulter(webhook).
36+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
3737
WithValidator(webhook).
3838
Complete()
3939
}

bootstrap/kubeadm/internal/webhooks/kubeadmconfigtemplate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
func (webhook *KubeadmConfigTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
3333
return ctrl.NewWebhookManagedBy(mgr).
3434
For(&bootstrapv1.KubeadmConfigTemplate{}).
35-
WithDefaulter(webhook).
35+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
3636
WithValidator(webhook).
3737
Complete()
3838
}

controlplane/kubeadm/internal/webhooks/kubeadm_control_plane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import (
4747
func (webhook *KubeadmControlPlane) SetupWebhookWithManager(mgr ctrl.Manager) error {
4848
return ctrl.NewWebhookManagedBy(mgr).
4949
For(&controlplanev1.KubeadmControlPlane{}).
50-
WithDefaulter(webhook).
50+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
5151
WithValidator(webhook).
5252
Complete()
5353
}

controlplane/kubeadm/internal/webhooks/kubeadmcontrolplanetemplate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
func (webhook *KubeadmControlPlaneTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
3737
return ctrl.NewWebhookManagedBy(mgr).
3838
For(&controlplanev1.KubeadmControlPlaneTemplate{}).
39-
WithDefaulter(webhook).
39+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
4040
WithValidator(webhook).
4141
Complete()
4242
}

exp/addons/internal/webhooks/clusterresourceset_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type ClusterResourceSet struct{}
3939
func (webhook *ClusterResourceSet) SetupWebhookWithManager(mgr ctrl.Manager) error {
4040
return ctrl.NewWebhookManagedBy(mgr).
4141
For(&addonsv1.ClusterResourceSet{}).
42-
WithDefaulter(webhook).
42+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
4343
WithValidator(webhook).
4444
Complete()
4545
}

exp/internal/webhooks/machinepool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (webhook *MachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error {
4949

5050
return ctrl.NewWebhookManagedBy(mgr).
5151
For(&expv1.MachinePool{}).
52-
WithDefaulter(webhook).
52+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
5353
WithValidator(webhook).
5454
Complete()
5555
}

internal/webhooks/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (webhook *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
5757

5858
return ctrl.NewWebhookManagedBy(mgr).
5959
For(&clusterv1.Cluster{}).
60-
WithDefaulter(webhook).
60+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
6161
WithValidator(webhook).
6262
Complete()
6363
}

internal/webhooks/clusterclass.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import (
4545
func (webhook *ClusterClass) SetupWebhookWithManager(mgr ctrl.Manager) error {
4646
return ctrl.NewWebhookManagedBy(mgr).
4747
For(&clusterv1.ClusterClass{}).
48-
WithDefaulter(webhook).
48+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
4949
WithValidator(webhook).
5050
Complete()
5151
}

internal/webhooks/machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const defaultNodeDeletionTimeout = 10 * time.Second
4040
func (webhook *Machine) SetupWebhookWithManager(mgr ctrl.Manager) error {
4141
return ctrl.NewWebhookManagedBy(mgr).
4242
For(&clusterv1.Machine{}).
43-
WithDefaulter(webhook).
43+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
4444
WithValidator(webhook).
4545
Complete()
4646
}

internal/webhooks/machinedeployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (webhook *MachineDeployment) SetupWebhookWithManager(mgr ctrl.Manager) erro
4848

4949
return ctrl.NewWebhookManagedBy(mgr).
5050
For(&clusterv1.MachineDeployment{}).
51-
WithDefaulter(webhook).
51+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
5252
WithValidator(webhook).
5353
Complete()
5454
}

0 commit comments

Comments
 (0)