mirror of
https://github.com/rancher/steve.git
synced 2025-09-03 00:15:27 +00:00
Revert part of steve PR 633 (#708)
Specifically, recomment a test that was uncommented in this PR, and revert the underlying code that made this test pass. That code change causes user-based integration tests to fail, so something is not correct in that code. This was actually unrelated to the reason for PR 633, to fix a problem when sorting on a label that dropped objects that didn't have that label. That part remains untouched.
This commit is contained in:
@@ -683,10 +683,8 @@ func (l *ListOptionIndexer) constructQuery(lo *sqltypes.ListOptions, partitions
|
|||||||
names := thisPartition.Names
|
names := thisPartition.Names
|
||||||
|
|
||||||
if len(names) == 0 {
|
if len(names) == 0 {
|
||||||
if len(singlePartitionClauses) == 0 {
|
|
||||||
// degenerate case, there will be no results
|
// degenerate case, there will be no results
|
||||||
singlePartitionClauses = append(singlePartitionClauses, "FALSE")
|
singlePartitionClauses = append(singlePartitionClauses, "FALSE")
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
singlePartitionClauses = append(singlePartitionClauses, fmt.Sprintf(`f."metadata.name" IN (?%s)`, strings.Repeat(", ?", len(thisPartition.Names)-1)))
|
singlePartitionClauses = append(singlePartitionClauses, fmt.Sprintf(`f."metadata.name" IN (?%s)`, strings.Repeat(", ?", len(thisPartition.Names)-1)))
|
||||||
// sort for reproducibility
|
// sort for reproducibility
|
||||||
|
@@ -977,20 +977,20 @@ func TestNewListOptionIndexerEasy(t *testing.T) {
|
|||||||
expectedContToken: "",
|
expectedContToken: "",
|
||||||
expectedErr: nil,
|
expectedErr: nil,
|
||||||
})
|
})
|
||||||
tests = append(tests, testCase{
|
//tests = append(tests, testCase{
|
||||||
description: "ListByOptions with a Namespace Partition should select only items where metadata.namespace is equal to Namespace and all other conditions are met",
|
// description: "ListByOptions with a Namespace Partition should select only items where metadata.namespace is equal to Namespace and all other conditions are met",
|
||||||
partitions: []partition.Partition{
|
// partitions: []partition.Partition{
|
||||||
{
|
// {
|
||||||
Namespace: "ns-b",
|
// Namespace: "ns-b",
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
// XXX: Why do I need to specify the namespace here too?
|
// // XXX: Why do I need to specify the namespace here too?
|
||||||
ns: "ns-b",
|
// ns: "ns-b",
|
||||||
expectedList: makeList(t, obj05__guard_lodgepole),
|
// expectedList: makeList(t, obj05__guard_lodgepole),
|
||||||
expectedTotal: 1,
|
// expectedTotal: 1,
|
||||||
expectedContToken: "",
|
// expectedContToken: "",
|
||||||
expectedErr: nil,
|
// expectedErr: nil,
|
||||||
})
|
//})
|
||||||
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user