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:
3
vendor/github.com/containerd/nri/client.go
generated
vendored
3
vendor/github.com/containerd/nri/client.go
generated
vendored
@@ -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
|
||||
|
||||
2
vendor/github.com/containerd/nri/types/v1/types.go
generated
vendored
2
vendor/github.com/containerd/nri/types/v1/types.go
generated
vendored
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user