From 2c926b5f17c5a876d38fd094a9e97ffb1175a891 Mon Sep 17 00:00:00 2001 From: Casey Callendrello Date: Mon, 10 Jun 2024 18:06:29 +0200 Subject: [PATCH] SPEC: add warning about preserving shared resources for GC For plugins that may share resources or resource pools across networks, we should make it explicitly clear that GC must only clean up resources known to be owned by the calling network. Signed-off-by: Casey Callendrello --- SPEC.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SPEC.md b/SPEC.md index 0384d616..71d35dd7 100644 --- a/SPEC.md +++ b/SPEC.md @@ -375,6 +375,8 @@ Resources may, for example, include: A plugin SHOULD remove as many stale resources as possible. For example, a plugin should remove any IPAM reservations associated with attachments not in the provided list. The plugin MAY assume that the isolation domain (e.g. network namespace) has been deleted, and thus any resources (e.g. network interfaces) therein have been removed. +Garbage collection is a per-network operation. If a plugin manages resources shared across multiple networks, it must only remove stale resources known to belong to the network provided in the `GC `action. + Plugins should generally complete a `GC` action without error. If an error is encountered, a plugin should continue; removing as many resources as possible, and report the errors back to the runtime. Plugins MUST, additionally, forward any GC calls to delegated plugins they are configured to use (see section 4).