Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
greedy52 committed Dec 5, 2024
1 parent 7ec9cd9 commit cac2a5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion api/types/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,13 @@ type EnrichedResource struct {
}

// EnrichedResources is a wrapper of []*EnrichedResource.
// A EnrichedResource is a [ResourceWithLabels] wrapped with additional
// user-specific information.
type EnrichedResources []*EnrichedResource

// ToResourcesWithLabels converts to ResourcesWithLabels.
func (r EnrichedResources) ToResourcesWithLabels() ResourcesWithLabels {
ret := make(ResourcesWithLabels, len(r))
ret := make(ResourcesWithLabels, 0, len(r))
for _, resource := range r {
ret = append(ret, resource.ResourceWithLabels)
}
Expand Down
5 changes: 2 additions & 3 deletions lib/services/unified_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestUnifiedResourceWatcher(t *testing.T) {

// we expect each of the resources above to exist
expectedRes := []types.ResourceWithLabels{node, app, samlapp, dbServer, win,
gitServer,gitServer2,
gitServer, gitServer2,
types.Resource153ToUnifiedResource(icAcct)}
assert.Eventually(t, func() bool {
res, err = w.GetUnifiedResources(ctx)
Expand Down Expand Up @@ -212,7 +212,7 @@ func TestUnifiedResourceWatcher(t *testing.T) {

// this should include the updated node, and shouldn't have any apps included
expectedRes = []types.ResourceWithLabels{nodeUpdated, samlapp, dbServer, win,
gitServer,gitServer2,
gitServer, gitServer2,
types.Resource153ToUnifiedResource(icAcct)}

assert.Eventually(t, func() bool {
Expand Down Expand Up @@ -387,7 +387,6 @@ func TestUnifiedResourceWatcher_DeleteEvent(t *testing.T) {

icAcct := newIdentityCenterAccount(t, ctx, clt)


// add git server
gitServer := newGitServer(t, "my-org")
_, err = clt.CreateGitServer(ctx, gitServer)
Expand Down

0 comments on commit cac2a5a

Please sign in to comment.