Skip to content

Commit d62d904

Browse files
committed
Fix unit tests
Signed-off-by: Antonin Stefanutti <[email protected]>
1 parent 3b45cdc commit d62d904

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

apis/config/scheme/scheme_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ package scheme
1919
import (
2020
"bytes"
2121
"testing"
22+
"time"
2223

2324
"github.com/google/go-cmp/cmp"
2425
corev1 "k8s.io/api/core/v1"
2526
"k8s.io/apimachinery/pkg/api/resource"
27+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2628
"k8s.io/apimachinery/pkg/runtime"
2729
"k8s.io/apimachinery/pkg/runtime/schema"
2830
schedconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
2931
"k8s.io/kubernetes/pkg/scheduler/apis/config/testing/defaults"
32+
"k8s.io/utils/ptr"
3033

3134
"sigs.k8s.io/scheduler-plugins/apis/config"
3235
v1 "sigs.k8s.io/scheduler-plugins/apis/config/v1"
@@ -114,6 +117,12 @@ profiles:
114117
Name: "DefaultPreemption",
115118
Args: &schedconfig.DefaultPreemptionArgs{MinCandidateNodesPercentage: 10, MinCandidateNodesAbsolute: 100},
116119
},
120+
{
121+
Name: "DynamicResources",
122+
Args: &schedconfig.DynamicResourcesArgs{
123+
FilterTimeout: ptr.To(metav1.Duration{Duration: 10 * time.Second}),
124+
},
125+
},
117126
{
118127
Name: "InterPodAffinity",
119128
Args: &schedconfig.InterPodAffinityArgs{HardPodAffinityWeight: 1},
@@ -183,6 +192,12 @@ profiles:
183192
Name: "DefaultPreemption",
184193
Args: &schedconfig.DefaultPreemptionArgs{MinCandidateNodesPercentage: 10, MinCandidateNodesAbsolute: 100},
185194
},
195+
{
196+
Name: "DynamicResources",
197+
Args: &schedconfig.DynamicResourcesArgs{
198+
FilterTimeout: ptr.To(metav1.Duration{Duration: 10 * time.Second}),
199+
},
200+
},
186201
{
187202
Name: "InterPodAffinity",
188203
Args: &schedconfig.InterPodAffinityArgs{HardPodAffinityWeight: 1},

pkg/noderesourcetopology/cache/cache_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ func checkGetCachedNRTCopy(t *testing.T, makeCache func(client ctrlclient.WithWa
123123

124124
func makeTestNRT(nodeName string) *topologyv1alpha2.NodeResourceTopology {
125125
return &topologyv1alpha2.NodeResourceTopology{
126-
TypeMeta: metav1.TypeMeta{
127-
Kind: "NodeResourceTopology",
128-
APIVersion: "topology.node.k8s.io/v1alpha2",
129-
},
130126
ObjectMeta: metav1.ObjectMeta{
131127
Name: nodeName,
132128
},

0 commit comments

Comments
 (0)