Merge pull request #134755 from neolit123/1.35-add-missing-statefullset-fuzzer-defaulting

apis/apps/fuzzer: add missing MaxUnavailable defaulting
This commit is contained in:
Kubernetes Prow Robot
2025-10-21 11:44:38 -07:00
committed by GitHub

View File

@@ -26,6 +26,7 @@ import (
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/utils/ptr"
)
// Funcs returns the fuzzer functions for the apps api group.
@@ -71,6 +72,9 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
if len(s.Labels) == 0 {
s.Labels = s.Spec.Template.Labels
}
if s.Spec.UpdateStrategy.RollingUpdate != nil && s.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable == nil {
s.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable = ptr.To(intstr.FromInt32(1))
}
},
func(j *apps.Deployment, c randfill.Continue) {
c.FillNoCustom(j)