From 2b26a543885d55600e2289c90d58d8a4b47dd0a3 Mon Sep 17 00:00:00 2001 From: Enrique Llorente Date: Wed, 9 Jul 2025 16:34:08 +0200 Subject: [PATCH] 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. Signed-off-by: Enrique Llorente --- libcni/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcni/api.go b/libcni/api.go index 6ac26949..3c50535e 100644 --- a/libcni/api.go +++ b/libcni/api.go @@ -776,7 +776,7 @@ func (c *CNIConfig) GCNetworkList(ctx context.Context, list *NetworkConfigList, // First, get the list of cached attachments cachedAttachments, err := c.GetCachedAttachments("") if err != nil { - return nil + return err } var validAttachments map[types.GCAttachment]interface{}