diff --git a/pkg/webhook/daemonset/validating/daemonset_create_update_handler.go b/pkg/webhook/daemonset/validating/daemonset_create_update_handler.go index 42549f03eb..819b08baaa 100644 --- a/pkg/webhook/daemonset/validating/daemonset_create_update_handler.go +++ b/pkg/webhook/daemonset/validating/daemonset_create_update_handler.go @@ -55,6 +55,7 @@ func (h *DaemonSetCreateUpdateHandler) validateDaemonSetUpdate(ds, oldDs *appsv1 if !apiequality.Semantic.DeepEqual(daemonset.Spec, oldDs.Spec) { allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to daemonset spec for fields other than 'BurstReplicas', 'template', 'lifecycle', 'updateStrategy', 'minReadySeconds', and 'revisionHistoryLimit' are forbidden")) } + allErrs = append(allErrs, validateDaemonSetSpec(&ds.Spec, field.NewPath("spec"))...) return allErrs } diff --git a/pkg/webhook/daemonset/validating/daemonset_validation_test.go b/pkg/webhook/daemonset/validating/daemonset_validation_test.go index 75f369beba..63d79fed06 100644 --- a/pkg/webhook/daemonset/validating/daemonset_validation_test.go +++ b/pkg/webhook/daemonset/validating/daemonset_validation_test.go @@ -126,7 +126,6 @@ func TestValidateDaemonSetUpdate(t *testing.T) { } intOrStr1 := intstr.FromInt(1) intOrStr2 := intstr.FromInt(2) - intOrStr3 := intstr.FromInt(3) successCases := []testCase{ { spec: &appsv1alpha1.DaemonSetSpec{ @@ -137,7 +136,6 @@ func TestValidateDaemonSetUpdate(t *testing.T) { Type: appsv1alpha1.RollingUpdateDaemonSetStrategyType, RollingUpdate: &appsv1alpha1.RollingUpdateDaemonSet{ MaxUnavailable: &intOrStr1, - MaxSurge: &intOrStr2, }, }, }, @@ -149,7 +147,6 @@ func TestValidateDaemonSetUpdate(t *testing.T) { Type: appsv1alpha1.RollingUpdateDaemonSetStrategyType, RollingUpdate: &appsv1alpha1.RollingUpdateDaemonSet{ MaxUnavailable: &intOrStr1, - MaxSurge: &intOrStr2, }, }, }, @@ -163,7 +160,6 @@ func TestValidateDaemonSetUpdate(t *testing.T) { Type: appsv1alpha1.RollingUpdateDaemonSetStrategyType, RollingUpdate: &appsv1alpha1.RollingUpdateDaemonSet{ MaxUnavailable: &intOrStr1, - MaxSurge: &intOrStr3, }, }, }, @@ -175,7 +171,6 @@ func TestValidateDaemonSetUpdate(t *testing.T) { Type: appsv1alpha1.RollingUpdateDaemonSetStrategyType, RollingUpdate: &appsv1alpha1.RollingUpdateDaemonSet{ MaxUnavailable: &intOrStr1, - MaxSurge: &intOrStr2, }, }, },