Skip to content

Commit 309b6bb

Browse files
authored
Merge pull request #1103 from squeed/fix-gc-key-name
SPEC, libcni: harmonize GC valid-attachment key
2 parents d5c71ad + 692efbd commit 309b6bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: SPEC.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ The runtime MUST NOT use GC as a substitute for DEL. Plugins may be unable to cl
387387

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

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

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

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

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

Diff for: libcni/api.go

+2
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,8 @@ func (c *CNIConfig) GCNetworkList(ctx context.Context, list *NetworkConfigList,
817817
}
818818
if args != nil {
819819
inject["cni.dev/valid-attachments"] = args.ValidAttachments
820+
// #1101: spec used incorrect variable name
821+
inject["cni.dev/attachments"] = args.ValidAttachments
820822
}
821823

822824
for _, plugin := range list.Plugins {

0 commit comments

Comments
 (0)