Skip to content

Commit f09423c

Browse files
committed
libcni: Fix error handling in GCNetworkList
Return actual error from GetCachedAttachments instead of nil to properly propagate errors and avoid silent failures when getting cached attachments fails during garbage collection.
1 parent ee7c96f commit f09423c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcni/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ func (c *CNIConfig) GCNetworkList(ctx context.Context, list *NetworkConfigList,
776776
// First, get the list of cached attachments
777777
cachedAttachments, err := c.GetCachedAttachments("")
778778
if err != nil {
779-
return nil
779+
return err
780780
}
781781

782782
var validAttachments map[types.GCAttachment]interface{}

0 commit comments

Comments
 (0)