Update server with nri injection points

This allows development with container to be done for NRI without the need for
custom builds.

This is an experimental feature and is not enabled unless a user has a global
`/etc/nri/conf.json` config setup with plugins on the system.  No NRI code will
be executed if this config file does not exist.

Signed-off-by: Michael Crosby <michael@thepasture.io>
This commit is contained in:
Michael Crosby
2020-08-04 04:51:08 -04:00
parent b777982928
commit 63f89eb954
7 changed files with 91 additions and 5 deletions

View File

@@ -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

View File

@@ -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"`
}