Skip to content

Commit e5f5975

Browse files
authored
Merge pull request kubernetes#128472 from sanposhiho/qhint-beta
feat: graduate SchedulerQueueingHints to beta
2 parents c93ba4e + b96eee8 commit e5f5975

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

pkg/features/versioned_kube_features.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
635635

636636
SchedulerQueueingHints: {
637637
{Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta},
638+
{Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta},
638639
},
639640

640641
SELinuxChangePolicy: {

pkg/scheduler/backend/queue/scheduling_queue_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ var (
104104
}
105105
)
106106

107+
func init() {
108+
metrics.Register()
109+
}
110+
107111
func setQueuedPodInfoGated(queuedPodInfo *framework.QueuedPodInfo) *framework.QueuedPodInfo {
108112
queuedPodInfo.Gated = true
109113
return queuedPodInfo
@@ -129,7 +133,6 @@ func TestPriorityQueue_Add(t *testing.T) {
129133
logger, ctx := ktesting.NewTestContext(t)
130134
ctx, cancel := context.WithCancel(ctx)
131135
defer cancel()
132-
metrics.Register()
133136
q := NewTestQueueWithObjects(ctx, newDefaultQueueSort(), objs)
134137
q.Add(logger, medPriorityPodInfo.Pod)
135138
q.Add(logger, unschedulablePodInfo.Pod)
@@ -994,7 +997,7 @@ func TestPriorityQueue_AddUnschedulableIfNotPresent_Backoff(t *testing.T) {
994997
},
995998
}
996999

997-
err := q.AddUnschedulableIfNotPresent(logger, newQueuedPodInfoForLookup(unschedulablePod, "plugin"), oldCycle)
1000+
err := q.AddUnschedulableIfNotPresent(logger, attemptQueuedPodInfo(newQueuedPodInfoForLookup(unschedulablePod, "plugin")), oldCycle)
9981001
if err != nil {
9991002
t.Fatalf("unexpected error from AddUnschedulableIfNotPresent: %v", err)
10001003
}
@@ -1031,7 +1034,6 @@ func TestPriorityQueue_Pop(t *testing.T) {
10311034
}
10321035

10331036
func TestPriorityQueue_Update(t *testing.T) {
1034-
metrics.Register()
10351037
c := testingclock.NewFakeClock(time.Now())
10361038

10371039
queuePlugin := "queuePlugin"
@@ -2054,7 +2056,6 @@ func TestPriorityQueue_AssignedPodAdded_(t *testing.T) {
20542056
}
20552057

20562058
func TestPriorityQueue_AssignedPodUpdated(t *testing.T) {
2057-
metrics.Register()
20582059
tests := []struct {
20592060
name string
20602061
unschedPod *v1.Pod
@@ -3068,7 +3069,6 @@ func TestPendingPodsMetric(t *testing.T) {
30683069
pInfosWithDelay[i].Attempts = 0
30693070
}
30703071
}
3071-
metrics.Register()
30723072

30733073
tests := []struct {
30743074
name string
@@ -3445,7 +3445,7 @@ func TestIncomingPodsMetrics(t *testing.T) {
34453445
timestamp := time.Now()
34463446
unschedulablePlg := "unschedulable_plugin"
34473447
var pInfos = make([]*framework.QueuedPodInfo, 0, 3)
3448-
metrics.Register()
3448+
34493449
for i := 1; i <= 3; i++ {
34503450
p := &framework.QueuedPodInfo{
34513451
PodInfo: mustNewTestPodInfo(t,

pkg/scheduler/scheduler_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import (
5757
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
5858
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
5959
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
60+
"k8s.io/kubernetes/pkg/scheduler/metrics"
6061
"k8s.io/kubernetes/pkg/scheduler/profile"
6162
st "k8s.io/kubernetes/pkg/scheduler/testing"
6263
tf "k8s.io/kubernetes/pkg/scheduler/testing/framework"
@@ -247,6 +248,7 @@ func TestSchedulerCreation(t *testing.T) {
247248
}
248249

249250
func TestFailureHandler(t *testing.T) {
251+
metrics.Register()
250252
testPod := st.MakePod().Name("test-pod").Namespace(v1.NamespaceDefault).Obj()
251253
testPodUpdated := testPod.DeepCopy()
252254
testPodUpdated.Labels = map[string]string{"foo": ""}
@@ -285,7 +287,8 @@ func TestFailureHandler(t *testing.T) {
285287
// Need to add/update/delete testPod to the store.
286288
podInformer.Informer().GetStore().Add(testPod)
287289

288-
queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())))
290+
recorder := metrics.NewMetricsAsyncRecorder(3, 20*time.Microsecond, ctx.Done())
291+
queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())), internalqueue.WithMetricsRecorder(*recorder))
289292
schedulerCache := internalcache.New(ctx, 30*time.Second)
290293

291294
queue.Add(logger, testPod)

test/featuregates_linter/test_data/versioned_feature_list.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,10 @@
10581058
lockToDefault: false
10591059
preRelease: Beta
10601060
version: "1.28"
1061+
- default: true
1062+
lockToDefault: false
1063+
preRelease: Beta
1064+
version: "1.32"
10611065
- name: SELinuxChangePolicy
10621066
versionedSpecs:
10631067
- default: false

0 commit comments

Comments
 (0)