Skip to content

Commit

Permalink
Merge pull request #1103 from squeed/fix-gc-key-name
Browse files Browse the repository at this point in the history
SPEC, libcni: harmonize GC valid-attachment key
  • Loading branch information
squeed committed Jul 22, 2024
2 parents d5c71ad + 692efbd commit 309b6bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ The runtime MUST NOT use GC as a substitute for DEL. Plugins may be unable to cl

The runtime must provide a JSON-serialized plugin configuration object (defined below) on standard in. It contains an additional key;

- `cni.dev/attachments` (array of objects): The list of **still valid** attachments to this network:
- `cni.dev/valid-attachments` (array of objects): The list of **still valid** attachments to this network:
- `containerID` (string): the value of CNI_CONTAINERID as provided during the CNI ADD operation
- `ifname` (string): the value of CNI_IFNAME as provided during the CNI ADD operation

Expand Down Expand Up @@ -496,7 +496,7 @@ For attachment-specific operations (ADD, DEL, CHECK), additional field requireme
- `capabilities`: must not be set

For GC operations:
- `cni.dev/attachments`: as specified in section 2.
- `cni.dev/valid-attachments`: as specified in section 2.

All other fields not prefixed with `cni.dev/` should be passed through unaltered.

Expand Down
2 changes: 2 additions & 0 deletions libcni/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,8 @@ func (c *CNIConfig) GCNetworkList(ctx context.Context, list *NetworkConfigList,
}
if args != nil {
inject["cni.dev/valid-attachments"] = args.ValidAttachments
// #1101: spec used incorrect variable name
inject["cni.dev/attachments"] = args.ValidAttachments
}

for _, plugin := range list.Plugins {
Expand Down

0 comments on commit 309b6bb

Please sign in to comment.