Skip to content

Commit

Permalink
Return error from object finder (#323)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Aug 23, 2024
1 parent 2548d66 commit b7af20d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/graph/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (finder ObjectFinder) ListConnectedResources(src *unstructured.Unstructured

for dstGVR, e := range edges {
objects, err := finder.ResourcesFor(src, e)
if kerr.IsNotFound(err) || len(objects) == 0 {
if kerr.IsNotFound(err) || meta.IsNoMatchError(err) || (err == nil && len(objects) == 0) {
continue
} else if err != nil {
return nil, err
Expand All @@ -110,7 +110,7 @@ func (finder ObjectFinder) ListConnectedPartials(src *unstructured.Unstructured,

for dstGVR, e := range edges {
objects, err := finder.ResourcesFor(src, e)
if kerr.IsNotFound(err) || len(objects) == 0 {
if kerr.IsNotFound(err) || meta.IsNoMatchError(err) || (err == nil && len(objects) == 0) {
continue
} else if err != nil {
return nil, err
Expand Down

0 comments on commit b7af20d

Please sign in to comment.