Skip to content

Commit

Permalink
Add sandbox labels
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crosby <michael@thepasture.io>
  • Loading branch information
crosbymichael committed Aug 20, 2020
1 parent 0072507 commit 0afc7f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions types/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down

0 comments on commit 0afc7f0

Please sign in to comment.