diff --git a/SPEC.md b/SPEC.md index eee34ee4..47d1550d 100644 --- a/SPEC.md +++ b/SPEC.md @@ -567,6 +567,7 @@ Plugins must output a JSON object with the following keys upon a successful `ADD - `interfaces`: An array of all interfaces created by the attachment, including any host-level interfaces: - `name`: The name of the interface. - `mac`: The hardware address of the interface (if applicable). + - `mtu`: The MTU of the interface (if applicable). - `sandbox`: 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`. - `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"). diff --git a/pkg/types/100/types.go b/pkg/types/100/types.go index d6d069f5..d03ac67e 100644 --- a/pkg/types/100/types.go +++ b/pkg/types/100/types.go @@ -270,6 +270,7 @@ func (r *Result) PrintTo(writer io.Writer) error { type Interface struct { Name string `json:"name"` Mac string `json:"mac,omitempty"` + Mtu int `json:"mtu,omitempty"` Sandbox string `json:"sandbox,omitempty"` } diff --git a/pkg/types/100/types_test.go b/pkg/types/100/types_test.go index 3bd50bd7..965cf7ea 100644 --- a/pkg/types/100/types_test.go +++ b/pkg/types/100/types_test.go @@ -53,6 +53,7 @@ func testResult() *current.Result { { Name: "eth0", Mac: "00:11:22:33:44:55", + Mtu: 1500, Sandbox: "/proc/3553/ns/net", }, }, @@ -106,6 +107,7 @@ var _ = Describe("Current types operations", func() { { "name": "eth0", "mac": "00:11:22:33:44:55", + "mtu": 1500, "sandbox": "/proc/3553/ns/net" } ],