From 0afc7f031eaf9c7d9c1a381b7ab5462e89c998fc Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 20 Aug 2020 08:04:01 -0400 Subject: [PATCH] Add sandbox labels Signed-off-by: Michael Crosby --- client.go | 3 +++ types/v1/types.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/client.go b/client.go index 07f43e3f..6b6c6e40 100644 --- a/client.go +++ b/client.go @@ -46,6 +46,8 @@ type Client struct { type Sandbox struct { // ID of the sandbox ID string + // Labels of the sandbox + Labels map[string]string } // Invoke the ConfList of nri plugins @@ -75,6 +77,7 @@ func (c *Client) InvokeWithSandbox(ctx context.Context, task containerd.Task, st } if sandbox != nil { r.SandboxID = sandbox.ID + r.Labels = sandbox.Labels } for _, p := range c.conf.Plugins { r.Conf = p.Conf diff --git a/types/v1/types.go b/types/v1/types.go index 412075ee..e0703f5a 100644 --- a/types/v1/types.go +++ b/types/v1/types.go @@ -75,6 +75,8 @@ type Request struct { Pid int `json:"pid,omitempty"` // Spec generated from the OCI runtime specification Spec *Spec `json:"spec"` + // Labels of a sandbox + Labels map[string]string `json:"labels,omitempty"` // Results from previous plugins in the chain Results []*Result `json:"results,omitempty"` }