Skip to content

Commit

Permalink
add clone for cached resources
Browse files Browse the repository at this point in the history
Signed-off-by: denis-tingaikin <[email protected]>
  • Loading branch information
denis-tingaikin committed Oct 17, 2024
1 parent 18c9ceb commit 3591697
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/registry/common/querycache/ns_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (q *queryCacheNSClient) Find(ctx context.Context, query *registry.NetworkSe
}
list = registry.ReadNetworkServiceList(streamClient)
for _, item := range list {
q.cache.Add(item.GetName(), []*registry.NetworkService{item})
q.cache.Add(item.GetName(), []*registry.NetworkService{item.Clone()})
}
}
var resultStreamChannel = make(chan *registry.NetworkServiceResponse, len(list))
Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/common/querycache/nse_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (q *queryCacheNSEClient) Find(ctx context.Context, query *registry.NetworkS
}
list = registry.ReadNetworkServiceEndpointList(streamClient)
for _, item := range list {
q.cache.Add(item.GetName(), []*registry.NetworkServiceEndpoint{item})
q.cache.Add(item.GetName(), []*registry.NetworkServiceEndpoint{item.Clone()})
}
}
var resultStreamChannel = make(chan *registry.NetworkServiceEndpointResponse, len(list))
Expand Down

0 comments on commit 3591697

Please sign in to comment.