mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
fix index test: multi index check for empty list
Signed-off-by: pacoxu <paco.xu@daocloud.io>
This commit is contained in:
parent
c678434623
commit
ae6360f6c7
@ -76,7 +76,7 @@ func TestMultiIndexKeys(t *testing.T) {
|
|||||||
expected["bert"] = sets.NewString("one", "two")
|
expected["bert"] = sets.NewString("one", "two")
|
||||||
expected["elmo"] = sets.NewString("tre")
|
expected["elmo"] = sets.NewString("tre")
|
||||||
expected["oscar"] = sets.NewString("two")
|
expected["oscar"] = sets.NewString("two")
|
||||||
expected["elmo"] = sets.NewString() // let's just make sure we don't get anything back in this case
|
expected["elmo1"] = sets.NewString()
|
||||||
{
|
{
|
||||||
for k, v := range expected {
|
for k, v := range expected {
|
||||||
found := sets.String{}
|
found := sets.String{}
|
||||||
@ -87,9 +87,8 @@ func TestMultiIndexKeys(t *testing.T) {
|
|||||||
for _, item := range indexResults {
|
for _, item := range indexResults {
|
||||||
found.Insert(item.(*v1.Pod).Name)
|
found.Insert(item.(*v1.Pod).Name)
|
||||||
}
|
}
|
||||||
items := v.List()
|
if !found.Equal(v) {
|
||||||
if !found.HasAll(items...) {
|
t.Errorf("missing items, index %s, expected %v but found %v", k, v.List(), found.List())
|
||||||
t.Errorf("missing items, index %s, expected %v but found %v", k, items, found.List())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user