Skip to content

Commit 6ee57f5

Browse files
authored
Merge pull request #550 from ffromani/nrt-bump-deps
nodetopologymatch: bump deps
2 parents 69b95c6 + c7347b5 commit 6ee57f5

File tree

7 files changed

+126
-21
lines changed

7 files changed

+126
-21
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ require (
88
github.com/dustin/go-humanize v1.0.0
99
github.com/go-logr/logr v1.2.3
1010
github.com/google/go-cmp v0.5.9
11-
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.0
12-
github.com/k8stopologyawareschedwg/podfingerprint v0.1.2
11+
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.1
12+
github.com/k8stopologyawareschedwg/podfingerprint v0.2.0
1313
github.com/patrickmn/go-cache v2.1.0+incompatible
1414
github.com/paypal/load-watcher v0.2.2
1515
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
295295
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
296296
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
297297
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
298-
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.0 h1:2uCRJbv+A+fmaUaO0wLZ8oYd6cLE1dRzBQcFNxggH3s=
299-
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.0/go.mod h1:AkACMQGiTgCt0lQw3m7TTU8PLH9lYKNK5e9DqFf5VuM=
300-
github.com/k8stopologyawareschedwg/podfingerprint v0.1.2 h1:Db5KLJjPg2mKaCoeEliMlea+JMyDMWdbNPXnWbPNDyM=
301-
github.com/k8stopologyawareschedwg/podfingerprint v0.1.2/go.mod h1:C23pM15t06dXg/OihGlqBvnYzLr+MXDXJ7zMfbNAyXI=
298+
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.1 h1:BI3L7hNqRvXtB42FO4NI/0ZjDDVRPOMBDFLShhFtf28=
299+
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.1/go.mod h1:AkACMQGiTgCt0lQw3m7TTU8PLH9lYKNK5e9DqFf5VuM=
300+
github.com/k8stopologyawareschedwg/podfingerprint v0.2.0 h1:3Wc58WPBqG0yry0noEARZIAljBOU7TQZDg1L7dQTyw0=
301+
github.com/k8stopologyawareschedwg/podfingerprint v0.2.0/go.mod h1:C23pM15t06dXg/OihGlqBvnYzLr+MXDXJ7zMfbNAyXI=
302302
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
303303
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
304304
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=

pkg/noderesourcetopology/cache/store.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"k8s.io/klog/v2"
2525

2626
topologyv1alpha2 "github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha2"
27+
topologyv1alpha2attr "github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha2/helper/attribute"
2728

2829
"sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology/stringify"
2930
"sigs.k8s.io/scheduler-plugins/pkg/util"
@@ -195,8 +196,8 @@ func (cnt counter) Len() int {
195196
// podFingerprintForNodeTopology extracts without recomputing the pods fingerprint from
196197
// the provided Node Resource Topology object.
197198
func podFingerprintForNodeTopology(nrt *topologyv1alpha2.NodeResourceTopology) string {
198-
if attrValue, ok := findAttribute(nrt.Attributes, podfingerprint.Attribute); ok {
199-
return attrValue
199+
if attr, ok := topologyv1alpha2attr.Get(nrt.Attributes, podfingerprint.Attribute); ok {
200+
return attr.Value
200201
}
201202
if nrt.Annotations != nil {
202203
return nrt.Annotations[podfingerprint.Annotation]
@@ -213,7 +214,7 @@ func checkPodFingerprintForNode(logID string, indexer NodeIndexer, nodeName, pfp
213214
return err
214215
}
215216

216-
var st podfingerprint.Status
217+
st := podfingerprint.MakeStatus(nodeName)
217218
pfp := podfingerprint.NewTracingFingerprint(len(objs), &st)
218219
for _, obj := range objs {
219220
pfp.Add(obj.Namespace, obj.Name)
@@ -225,12 +226,3 @@ func checkPodFingerprintForNode(logID string, indexer NodeIndexer, nodeName, pfp
225226

226227
return pfp.Check(pfpExpected)
227228
}
228-
229-
func findAttribute(attrs topologyv1alpha2.AttributeList, name string) (string, bool) {
230-
for _, attr := range attrs {
231-
if attr.Name == name {
232-
return attr.Value, true
233-
}
234-
}
235-
return "", false
236-
}

test/integration/noderesourcetopology_cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ func podMatchesExpectedNode(podNamespace, podName, nodeName, expectedNode string
680680
}
681681

682682
func mkPFP(nodeName string, pods ...*corev1.Pod) string {
683-
var st podfingerprint.Status
683+
st := podfingerprint.MakeStatus(nodeName)
684684
fp := podfingerprint.NewTracingFingerprint(len(pods), &st)
685685
for _, pod := range pods {
686686
fp.AddPod(pod)

vendor/github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha2/helper/attribute/attribute.go

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/k8stopologyawareschedwg/podfingerprint/tracing.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ github.com/jpillora/backoff
185185
# github.com/json-iterator/go v1.1.12
186186
## explicit; go 1.12
187187
github.com/json-iterator/go
188-
# github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.0
188+
# github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.1
189189
## explicit; go 1.16
190190
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology
191191
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha1
192192
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha2
193+
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/topology/v1alpha2/helper/attribute
193194
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/clientset/versioned
194195
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/clientset/versioned/fake
195196
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/clientset/versioned/scheme
@@ -204,7 +205,7 @@ github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/inform
204205
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/informers/externalversions/topology/v1alpha2
205206
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/listers/topology/v1alpha1
206207
github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/listers/topology/v1alpha2
207-
# github.com/k8stopologyawareschedwg/podfingerprint v0.1.2
208+
# github.com/k8stopologyawareschedwg/podfingerprint v0.2.0
208209
## explicit; go 1.17
209210
github.com/k8stopologyawareschedwg/podfingerprint
210211
# github.com/mailru/easyjson v0.7.6

0 commit comments

Comments
 (0)