Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPEC, libcni: harmonize GC valid-attachment key #1103

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
squeed marked this conversation as resolved.
Show resolved Hide resolved
- `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
squeed marked this conversation as resolved.
Show resolved Hide resolved
}

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