mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 02:37:11 +00:00
Merge pull request #1473 from marquiz/devel/fix-api-unit-test
Reproducible output from expression matching
This commit is contained in:
commit
ec9d649654
1 changed files with 4 additions and 0 deletions
|
@ -308,6 +308,8 @@ func (m *MatchExpressionSet) MatchGetKeys(keys map[string]Nil) (bool, []MatchedE
|
|||
}
|
||||
ret = append(ret, MatchedElement{"Name": n})
|
||||
}
|
||||
// Sort for reproducible output
|
||||
sort.Slice(ret, func(i, j int) bool { return ret[i]["Name"] < ret[j]["Name"] })
|
||||
return true, ret, nil
|
||||
}
|
||||
|
||||
|
@ -333,6 +335,8 @@ func (m *MatchExpressionSet) MatchGetValues(values map[string]string) (bool, []M
|
|||
}
|
||||
ret = append(ret, MatchedElement{"Name": n, "Value": values[n]})
|
||||
}
|
||||
// Sort for reproducible output
|
||||
sort.Slice(ret, func(i, j int) bool { return ret[i]["Name"] < ret[j]["Name"] })
|
||||
return true, ret, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue