mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #128472 from sanposhiho/qhint-beta
feat: graduate SchedulerQueueingHints to beta
This commit is contained in:
commit
e5f5975f96
@ -635,6 +635,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
||||
|
||||
SchedulerQueueingHints: {
|
||||
{Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta},
|
||||
{Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta},
|
||||
},
|
||||
|
||||
SELinuxChangePolicy: {
|
||||
|
@ -104,6 +104,10 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
metrics.Register()
|
||||
}
|
||||
|
||||
func setQueuedPodInfoGated(queuedPodInfo *framework.QueuedPodInfo) *framework.QueuedPodInfo {
|
||||
queuedPodInfo.Gated = true
|
||||
return queuedPodInfo
|
||||
@ -129,7 +133,6 @@ func TestPriorityQueue_Add(t *testing.T) {
|
||||
logger, ctx := ktesting.NewTestContext(t)
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
metrics.Register()
|
||||
q := NewTestQueueWithObjects(ctx, newDefaultQueueSort(), objs)
|
||||
q.Add(logger, medPriorityPodInfo.Pod)
|
||||
q.Add(logger, unschedulablePodInfo.Pod)
|
||||
@ -994,7 +997,7 @@ func TestPriorityQueue_AddUnschedulableIfNotPresent_Backoff(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := q.AddUnschedulableIfNotPresent(logger, newQueuedPodInfoForLookup(unschedulablePod, "plugin"), oldCycle)
|
||||
err := q.AddUnschedulableIfNotPresent(logger, attemptQueuedPodInfo(newQueuedPodInfoForLookup(unschedulablePod, "plugin")), oldCycle)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error from AddUnschedulableIfNotPresent: %v", err)
|
||||
}
|
||||
@ -1031,7 +1034,6 @@ func TestPriorityQueue_Pop(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPriorityQueue_Update(t *testing.T) {
|
||||
metrics.Register()
|
||||
c := testingclock.NewFakeClock(time.Now())
|
||||
|
||||
queuePlugin := "queuePlugin"
|
||||
@ -2054,7 +2056,6 @@ func TestPriorityQueue_AssignedPodAdded_(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPriorityQueue_AssignedPodUpdated(t *testing.T) {
|
||||
metrics.Register()
|
||||
tests := []struct {
|
||||
name string
|
||||
unschedPod *v1.Pod
|
||||
@ -3068,7 +3069,6 @@ func TestPendingPodsMetric(t *testing.T) {
|
||||
pInfosWithDelay[i].Attempts = 0
|
||||
}
|
||||
}
|
||||
metrics.Register()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -3445,7 +3445,7 @@ func TestIncomingPodsMetrics(t *testing.T) {
|
||||
timestamp := time.Now()
|
||||
unschedulablePlg := "unschedulable_plugin"
|
||||
var pInfos = make([]*framework.QueuedPodInfo, 0, 3)
|
||||
metrics.Register()
|
||||
|
||||
for i := 1; i <= 3; i++ {
|
||||
p := &framework.QueuedPodInfo{
|
||||
PodInfo: mustNewTestPodInfo(t,
|
||||
|
@ -57,6 +57,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
||||
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
|
||||
"k8s.io/kubernetes/pkg/scheduler/metrics"
|
||||
"k8s.io/kubernetes/pkg/scheduler/profile"
|
||||
st "k8s.io/kubernetes/pkg/scheduler/testing"
|
||||
tf "k8s.io/kubernetes/pkg/scheduler/testing/framework"
|
||||
@ -247,6 +248,7 @@ func TestSchedulerCreation(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFailureHandler(t *testing.T) {
|
||||
metrics.Register()
|
||||
testPod := st.MakePod().Name("test-pod").Namespace(v1.NamespaceDefault).Obj()
|
||||
testPodUpdated := testPod.DeepCopy()
|
||||
testPodUpdated.Labels = map[string]string{"foo": ""}
|
||||
@ -285,7 +287,8 @@ func TestFailureHandler(t *testing.T) {
|
||||
// Need to add/update/delete testPod to the store.
|
||||
podInformer.Informer().GetStore().Add(testPod)
|
||||
|
||||
queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())))
|
||||
recorder := metrics.NewMetricsAsyncRecorder(3, 20*time.Microsecond, ctx.Done())
|
||||
queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())), internalqueue.WithMetricsRecorder(*recorder))
|
||||
schedulerCache := internalcache.New(ctx, 30*time.Second)
|
||||
|
||||
queue.Add(logger, testPod)
|
||||
|
@ -1058,6 +1058,10 @@
|
||||
lockToDefault: false
|
||||
preRelease: Beta
|
||||
version: "1.28"
|
||||
- default: true
|
||||
lockToDefault: false
|
||||
preRelease: Beta
|
||||
version: "1.32"
|
||||
- name: SELinuxChangePolicy
|
||||
versionedSpecs:
|
||||
- default: false
|
||||
|
Loading…
Reference in New Issue
Block a user