mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
change preempting to PreemptionPolicy
This commit is contained in:
@@ -10,8 +10,11 @@ go_library(
|
||||
srcs = ["fuzzer.go"],
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/scheduling/fuzzer",
|
||||
deps = [
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/apis/scheduling:go_default_library",
|
||||
"//pkg/features:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
|
||||
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
||||
"//vendor/github.com/google/gofuzz:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -19,7 +19,10 @@ package fuzzer
|
||||
import (
|
||||
"github.com/google/gofuzz"
|
||||
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/kubernetes/pkg/apis/core"
|
||||
"k8s.io/kubernetes/pkg/apis/scheduling"
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
)
|
||||
|
||||
// Funcs returns the fuzzer functions for the scheduling api group.
|
||||
@@ -27,9 +30,9 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
return []interface{}{
|
||||
func(s *scheduling.PriorityClass, c fuzz.Continue) {
|
||||
c.FuzzNoCustom(s)
|
||||
if s.Preempting == nil {
|
||||
preempting := scheduling.DefaultPreempting
|
||||
s.Preempting = &preempting
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.NonPreemptingPriority) && s.PreemptionPolicy == nil {
|
||||
preemptLowerPriority := core.PreemptLowerPriority
|
||||
s.PreemptionPolicy = &preemptLowerPriority
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user