mirror of
https://github.com/rancher/steve.git
synced 2025-09-01 15:37:31 +00:00
Fixed errors in obtaining object relationships
Issue: https://github.com/harvester/harvester/issues/1857
This commit is contained in:
@@ -80,11 +80,10 @@ func (s *SummaryCache) OnInboundRelationshipChange(ctx context.Context, schema *
|
||||
s.cbs[id] = cb
|
||||
|
||||
go func() {
|
||||
defer close(ret)
|
||||
for rel := range cb {
|
||||
if rel.Kind == kind &&
|
||||
rel.APIVersion == apiVersion &&
|
||||
rel.Namespace == namespace {
|
||||
(namespace == "" || namespace == rel.Namespace) {
|
||||
ret <- rel
|
||||
}
|
||||
}
|
||||
@@ -95,10 +94,11 @@ func (s *SummaryCache) OnInboundRelationshipChange(ctx context.Context, schema *
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
close(cb)
|
||||
defer close(ret)
|
||||
delete(s.cbs, id)
|
||||
}()
|
||||
|
||||
return cb
|
||||
return ret
|
||||
}
|
||||
|
||||
func (s *SummaryCache) SummaryAndRelationship(obj runtime.Object) (*summary.SummarizedObject, []Relationship) {
|
||||
|
Reference in New Issue
Block a user