Skip to content

Commit

Permalink
Add more fields to index when sql-caching is on.
Browse files Browse the repository at this point in the history
Misc changes:
- Use the builtin Event class, not events.k8s.io (by looking at the dashboard client code)
- Specify full path to the management.cattle.io fields.
- Map `Event.type` to `Event._type` for indexing.

Use a compound transform-func to first check for a "signal",
and then to run all the relevant transformers until either
one fails or the list is exhausted.

- Includes moving the fakeSummaryCache type into a common area.

Use a simpler way of running transforms.
  • Loading branch information
ericpromislow committed Oct 18, 2024
1 parent 06c2eb5 commit a9de94a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/resources/virtual/common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/rancher/steve/pkg/resources/virtual/common"
"github.com/rancher/steve/pkg/resources/virtual/testutil"
"github.com/rancher/steve/pkg/summarycache"
"github.com/rancher/wrangler/v3/pkg/summary"
"github.com/stretchr/testify/require"
Expand All @@ -12,7 +13,7 @@ import (
"k8s.io/client-go/tools/cache"
)

func TestTransformCommonObjects(t *testing.T) {
func TestTransformCommon(t *testing.T) {
tests := []struct {
name string
input any
Expand Down Expand Up @@ -159,7 +160,7 @@ func TestTransformCommonObjects(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
fakeCache := common.FakeSummaryCache{
fakeCache := testutil.FakeSummaryCache{
SummarizedObject: test.hasSummary,
Relationships: test.hasRelationships,
}
Expand Down

0 comments on commit a9de94a

Please sign in to comment.