From 9e5889396b02b689310ac6c07215482fbd8508aa Mon Sep 17 00:00:00 2001 From: Michael Zappa Date: Tue, 12 Dec 2023 15:37:13 -0700 Subject: [PATCH] Update libcni to add metadata to interface Signed-off-by: Michael Zappa --- pkg/types/100/types.go | 7 ++++--- pkg/types/100/types_test.go | 1 + pkg/types/types_test.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/types/100/types.go b/pkg/types/100/types.go index 6c138568..b1bc87be 100644 --- a/pkg/types/100/types.go +++ b/pkg/types/100/types.go @@ -245,9 +245,10 @@ func (r *Result) PrintTo(writer io.Writer) error { // Interface contains values about the created interfaces type Interface struct { - Name string `json:"name"` - Mac string `json:"mac,omitempty"` - Sandbox string `json:"sandbox,omitempty"` + Name string `json:"name"` + Mac string `json:"mac,omitempty"` + Sandbox string `json:"sandbox,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 3bd50bd7..bd0106ea 100644 --- a/pkg/types/100/types_test.go +++ b/pkg/types/100/types_test.go @@ -54,6 +54,7 @@ func testResult() *current.Result { Name: "eth0", Mac: "00:11:22:33:44:55", Sandbox: "/proc/3553/ns/net", + Metadata: make(map[string]string), }, }, IPs: []*current.IPConfig{ diff --git a/pkg/types/types_test.go b/pkg/types/types_test.go index 4fed4a67..7d01db70 100644 --- a/pkg/types/types_test.go +++ b/pkg/types/types_test.go @@ -162,6 +162,7 @@ var _ = Describe("Types", func() { Name: "eth0", Mac: "00:11:22:33:44:55", Sandbox: "/proc/3553/ns/net", + Metadata: make(map[string]string), }, }, IPs: []*current.IPConfig{