Files
containerd/api/services/events/v1/container.proto
Stephen J Day c857ba2d0b events: autogenerate fieldpath filters
To ensure consistent fieldpath matching for events, we generate the
fieldpath matching using protobuf definitions. This is done through a
plugin called "fieldpath" that defines a `Field` method for each type
with the plugin enabled. Generated code handles top-level envelope
fields, as well as deferred serialization for matching any types.

In practice, this means that we can cheaply match events on `topic` and
`namespace`. If we want to match on attributes within the event, we can
use the `event` prefix to address these fields. For example, the
following will match all envelopes that have a field named
`container_id` that has the value `testing`:

```
ctr events "event.container_id==testing"
```

The above will decode the underlying event and check that particular
field. Accordingly, if only `topic` or `namespace` is used, the event
will not be decoded and only match on the envelope.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-08-01 14:09:38 -07:00

32 lines
699 B
Protocol Buffer

syntax = "proto3";
package containerd.services.events.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
option (containerd.plugin.fieldpath_all) = true;
message ContainerCreate {
string id = 1;
string image = 2;
message Runtime {
string name = 1;
google.protobuf.Any options = 2;
}
Runtime runtime = 3;
}
message ContainerUpdate {
string id = 1;
string image = 2;
map<string, string> labels = 3;
string rootfs = 4 [(gogoproto.customname) = "RootFS"];
}
message ContainerDelete {
string id = 1;
}