diff --git a/SPEC.md b/SPEC.md index dcd10783..f38657db 100644 --- a/SPEC.md +++ b/SPEC.md @@ -570,6 +570,7 @@ Plugins must output a JSON object with the following keys upon a successful `ADD - `sandbox` (string): The isolation domain reference (e.g. path to network namespace) for the interface, or empty if on the host. For interfaces created inside the container, this should be the value passed via `CNI_NETNS`. - `socketPath` (string, optional): An absolute path to a socket file corresponding to this interface, if applicable. - `pciID` (string, optional): The platform-specific identifier of the PCI device corresponding to this interface, if applicable. + - `metadata`: a dictionary consisting of interface configurion information. - `ips`: IPs assigned by this attachment. Plugins may include IPs assigned external to the container. - `address` (string): an IP address in CIDR notation (eg "192.168.1.3/24"). - `gateway` (string): the default gateway for this subnet, if one exists. diff --git a/pkg/types/100/types.go b/pkg/types/100/types.go index c1392571..524753e3 100644 --- a/pkg/types/100/types.go +++ b/pkg/types/100/types.go @@ -273,6 +273,7 @@ type Interface struct { Sandbox string `json:"sandbox,omitempty"` SocketPath string `json:"socketPath,omitempty"` PciID string `json:"pciID,omitempty"` + Metadata map[string]string `json:"metadata,omitempty"` } func (i *Interface) String() string { diff --git a/pkg/types/100/types_test.go b/pkg/types/100/types_test.go index e74060c6..3a3d1571 100644 --- a/pkg/types/100/types_test.go +++ b/pkg/types/100/types_test.go @@ -55,6 +55,7 @@ func testResult() *current.Result { Sandbox: "/proc/3553/ns/net", PciID: "8086:9a01", SocketPath: "/path/to/vhost/fd", + Metadata: make(map[string]string), }, }, IPs: []*current.IPConfig{ diff --git a/pkg/types/types_test.go b/pkg/types/types_test.go index 73cd9ec6..c12ad815 100644 --- a/pkg/types/types_test.go +++ b/pkg/types/types_test.go @@ -169,6 +169,7 @@ var _ = Describe("Types", func() { Sandbox: "/proc/3553/ns/net", PciID: "8086:9a01", SocketPath: "/path/to/vhost/fd", + Metadata: make(map[string]string), }, }, IPs: []*current.IPConfig{