Skip to content

Proposal: Add metadata map field to Interface object in CNI Result #1050

@MikeZappa87

Description

@MikeZappa87

CNI spec should be allowed to pass arbitrary data in CNI result from the container runtime to the OCI runtime. Currently, there is an ability to influence the inputs to the CNI network configuration via runtime configuration. In a similar way, the CNI can add a metadata field to interface to pass down additional data to OCI runtime. The metadata field will be added to the Interface struct as a map[string]string and be optional. We can standardize specific keys similar to our conventions. The NRI plugin system may also benefit from this additional metadata. Our main use case for this is to support virtual runtimes and possibly advanced networking scenarios. This has been requested several times however no one has completed the work.

Current:

type Interface struct { 
    Name        string `json:"name"` 
    Mac         string `json:"mac,omitempty"` 
    Sandbox     string `json:"sandbox,omitempty"` 
} 

Proposal:

type Interface struct { 
    Name         string `json:"name"` 
    Mac          string `json:"mac,omitempty"` 
    Sandbox      string `json:"sandbox,omitempty"` 
    Metadata     map[string]string `json:"metadata,omitempty"` 
} 

Work Involved:

  1. Create proposal as a Github Issue in the CNI repo
  2. Create a PR for the specification updates
  3. Create a PR for libcni
  4. Update community plugins
  5. Update go-cni/ocicni to support latest types
  6. Update containerd/cri-o to use latest go-cni/ocicni

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions