1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-11 12:19:53 +00:00

#50914 - Changed ParseQuery projectornamespace Handling (#718)

* changed ParseQuery projectornamespace handling

* addressed comments from eric/chad and tom

* fixing lint error

* added resourceVersion to list

* updated mocks

* updated tests

* Update tests after rebase

---------

Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>
This commit is contained in:
Felipe Gehrke
2025-07-17 14:51:13 -03:00
committed by GitHub
parent 0c2c554c8c
commit b556256ed3
8 changed files with 67 additions and 20 deletions

View File

@@ -260,6 +260,7 @@ func TestListByPartitions(t *testing.T) {
cg := NewMockClientGetter(gomock.NewController(t))
cf := NewMockCacheFactory(gomock.NewController(t))
tb := NewMockTransformBuilder(gomock.NewController(t))
ri := NewMockResourceInterface(gomock.NewController(t))
s := &Store{
ctx: context.Background(),
@@ -313,6 +314,9 @@ func TestListByPartitions(t *testing.T) {
copy(listToReturn.Items, expectedItems)
nsi.EXPECT().ListByOptions(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, 0, "", fmt.Errorf("error")).Times(2)
cg.EXPECT().TableAdminClient(req, schema, "", &WarningBuffer{}).Return(ri, nil)
tb.EXPECT().GetTransformFunc(attributes.GVK(schema), gomock.Any(), false).Return(func(obj interface{}) (interface{}, error) { return obj, nil })
cf.EXPECT().CacheFor(context.Background(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), &tablelistconvert.Client{ResourceInterface: ri}, attributes.GVK(schema), attributes.Namespaced(schema), true)
_, err := listprocessor.ParseQuery(req, nsi)
assert.NotNil(t, err)