From e1604cbd7165769d6b7acc35db265f0d35bb0d04 Mon Sep 17 00:00:00 2001 From: Matt Magaldi Date: Mon, 23 Jul 2018 16:59:10 -0400 Subject: [PATCH] adding signal filters --- DEPENDENCIES.md | 1 + Gopkg.lock | 14 +- README.md | 1 - controller/Dockerfile | 4 +- controller/signal-filter.go | 155 ++++ controller/signal-filter_test.go | 316 +++++++ controller/signal.go | 66 +- docs/index.md | 2 +- docs/sensor-api.md | 189 ---- docs/signal-guide.md | 4 +- examples/context-filter-webhook.yaml | 35 + examples/data-filter-webhook.yaml | 35 + examples/time-filter-webhook.yaml | 34 + pkg/apis/sensor/v1alpha1/generated.pb.go | 835 ++++++++++++------ pkg/apis/sensor/v1alpha1/generated.proto | 42 +- pkg/apis/sensor/v1alpha1/types.go | 52 +- .../sensor/v1alpha1/zz_generated.deepcopy.go | 56 +- signals/artifact/s3.go | 8 +- 18 files changed, 1351 insertions(+), 498 deletions(-) create mode 100644 controller/signal-filter.go create mode 100644 controller/signal-filter_test.go delete mode 100644 docs/sensor-api.md create mode 100644 examples/context-filter-webhook.yaml create mode 100644 examples/data-filter-webhook.yaml create mode 100644 examples/time-filter-webhook.yaml diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index a8277691f6..65f726c8d9 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -18,3 +18,4 @@ | nats-io/gnatsd | Apache-2.0 | | Shopify/sarama | MIT | | stretchr/testify | https://github.com/stretchr/testify/blob/master/LICENSE | +| tidwall/gjson | MIT | diff --git a/Gopkg.lock b/Gopkg.lock index b7a23af6e5..0da2e2ac01 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -574,6 +574,18 @@ revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" +[[projects]] + name = "github.com/tidwall/gjson" + packages = ["."] + revision = "f123b340873a0084cb27267eddd8ff615115fbff" + version = "v1.1.2" + +[[projects]] + branch = "master" + name = "github.com/tidwall/match" + packages = ["."] + revision = "1731857f09b1f38450e2c12409748407822dc6be" + [[projects]] name = "go.uber.org/atomic" packages = ["."] @@ -963,6 +975,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "444489fe54d843be31d012830ae9c72c25e0c116de569adddd5e7287368d6170" + inputs-digest = "52356c07a7011f2d35e4e3ec2a64a04043afa82ba82df4ebc3617b40ff1543f8" solver-name = "gps-cdcl" solver-version = 1 diff --git a/README.md b/README.md index e2bffc5f48..6ebc40f11d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ Argo Events is an open source event-based dependency manager for Kubernetes. The Argo Events is a Kubernetes CRD which can manage dependencies using kubectl commands. - [Learn about signals](./docs/signal-guide.md) - [Learn about triggers](./docs/trigger-guide.md) -- [Review Sensor API](./docs/sensor-api.md) - [Getting started](./docs/quickstart.md) - [Want to contribute?](./CONTRIBUTING.md) - See where the project is headed in the [roadmap](./ROADMAP.md) diff --git a/controller/Dockerfile b/controller/Dockerfile index f3e930cabb..71a7dc4b6e 100644 --- a/controller/Dockerfile +++ b/controller/Dockerfile @@ -1,3 +1,3 @@ -FROM alpine:3.7 +FROM scratch COPY dist/sensor-controller / -CMD [ "/sensor-controller" ] +CMD [ "/sensor-controller" ] \ No newline at end of file diff --git a/controller/signal-filter.go b/controller/signal-filter.go new file mode 100644 index 0000000000..0e00a761b0 --- /dev/null +++ b/controller/signal-filter.go @@ -0,0 +1,155 @@ +package controller + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" + "strings" + + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" + "github.com/ghodss/yaml" + "github.com/tidwall/gjson" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// apply the signal filters to an event +func filterEvent(f v1alpha1.SignalFilter, event *v1alpha1.Event) (bool, error) { + dataRes, err := filterData(f.Data, event) + return filterTime(f.Time, &event.Context.EventTime) && filterContext(f.Context, &event.Context) && dataRes, err +} + +// applyTimeFilter checks the eventTime against the timeFilter: +// 1. the eventTime is greater than or equal to the start time +// 2. the eventTime is less than the end time +// returns true if 1 and 2 are true and false otherwise +func filterTime(timeFilter *v1alpha1.TimeFilter, eventTime *metav1.Time) bool { + if timeFilter != nil && eventTime != nil { + return (timeFilter.Start.Before(eventTime) || timeFilter.Start.Equal(eventTime)) && eventTime.Before(&timeFilter.Stop) + } + return true +} + +// applyContextFilter checks the expected EventContext against the actual EventContext +// values are only enforced if they are non-zero values +// map types check that the expected map is a subset of the actual map +func filterContext(expected *v1alpha1.EventContext, actual *v1alpha1.EventContext) bool { + res := true + if expected.EventType != "" { + res = res && expected.EventType == actual.EventType + } + if expected.EventTypeVersion != "" { + res = res && expected.EventTypeVersion == actual.EventTypeVersion + } + if expected.CloudEventsVersion != "" { + res = res && expected.CloudEventsVersion == actual.CloudEventsVersion + } + if expected.Source != nil { + res = res && reflect.DeepEqual(expected.Source, actual.Source) + } + if expected.SchemaURL != nil { + res = res && reflect.DeepEqual(expected.SchemaURL, actual.SchemaURL) + } + if expected.ContentType != "" { + res = res && expected.ContentType == actual.ContentType + } + eExtensionRes := mapIsSubset(expected.Extensions, actual.Extensions) + return res && eExtensionRes +} + +// various supported media types +// TODO: add support for XML +const ( + MediaTypeJSON string = "application/json" + //MediaTypeXML string = "application/xml" + MediaTypeYAML string = "application/yaml" +) + +// applyDataFilter runs the dataFilter against the event's data +// returns (true, nil) when data passes filters, false otherwise +// TODO: split this function up into smaller pieces +func filterData(dataFilters []*v1alpha1.DataFilter, event *v1alpha1.Event) (bool, error) { + // TODO: use the event.Context.SchemaURL to figure out correct data format to unmarshal to + // for now, let's just use a simple map[string]interface{} for arbitrary data + if event == nil { + return false, fmt.Errorf("nil event") + } + if event.Data == nil || len(event.Data) == 0 { + return true, nil + } + raw := event.Data + var data map[string]interface{} + // contentType is formatted as: '{type}; charset="xxx"' + contents := strings.Split(event.Context.ContentType, ";") + if len(contents) < 1 { + return false, fmt.Errorf("event context ContentType not found: %s", contents) + } + switch contents[0] { + case MediaTypeJSON: + if err := json.Unmarshal(raw, &data); err != nil { + return false, err + } + /* + case MediaTypeXML: + if err := xml.Unmarshal(raw, &data); err != nil { + return false, err + } + */ + case MediaTypeYAML: + if err := yaml.Unmarshal(raw, &data); err != nil { + return false, err + } + default: + return false, fmt.Errorf("unsupported event content type: %s", event.Context.ContentType) + } + // now let's marshal the data back into json in order to do gjson processing + json, err := json.Marshal(data) + if err != nil { + return false, err + } + for _, f := range dataFilters { + res := gjson.Get(string(json), f.Path) + if !res.Exists() { + return false, nil + } + switch f.Type { + case v1alpha1.JSONTypeBool: + val, err := strconv.ParseBool(f.Value) + if err != nil { + return false, err + } + if val != res.Bool() { + return false, nil + } + case v1alpha1.JSONTypeNumber: + val, err := strconv.ParseFloat(f.Value, 64) + if err != nil { + return false, err + } + if val != res.Float() { + return false, nil + } + case v1alpha1.JSONTypeString: + if f.Value != res.Str { + return false, nil + } + default: + return false, fmt.Errorf("unsupported JSON type %s", f.Type) + } + } + return true, nil +} + +// checks that m contains the k,v pairs of sub +func mapIsSubset(sub map[string]string, m map[string]string) bool { + for k, v := range sub { + val, ok := m[k] + if !ok { + return false + } + if v != val { + return false + } + } + return true +} diff --git a/controller/signal-filter_test.go b/controller/signal-filter_test.go new file mode 100644 index 0000000000..7807b2b4b9 --- /dev/null +++ b/controller/signal-filter_test.go @@ -0,0 +1,316 @@ +package controller + +import ( + "testing" + "time" + + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func Test_filterTime(t *testing.T) { + type args struct { + timeFilter *v1alpha1.TimeFilter + eventTime *metav1.Time + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "nil filter and time", + args: args{timeFilter: nil, eventTime: nil}, + want: true, + }, + { + name: "event > start && event > stop", + args: args{timeFilter: &v1alpha1.TimeFilter{ + Start: metav1.Time{ + Time: time.Date(2012, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + Stop: metav1.Time{ + Time: time.Date(2015, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + }, eventTime: &metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }}, + want: false, + }, + { + name: "event > start && event == stop", + args: args{timeFilter: &v1alpha1.TimeFilter{ + Start: metav1.Time{ + Time: time.Date(2012, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + Stop: metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + }, eventTime: &metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }}, + want: false, + }, + { + name: "event > start && event < stop", + args: args{timeFilter: &v1alpha1.TimeFilter{ + Start: metav1.Time{ + Time: time.Date(2012, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + Stop: metav1.Time{ + Time: time.Date(2017, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + }, eventTime: &metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }}, + want: true, + }, + { + name: "event == start && event < stop", + args: args{timeFilter: &v1alpha1.TimeFilter{ + Start: metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + Stop: metav1.Time{ + Time: time.Date(2017, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + }, eventTime: &metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }}, + want: true, + }, + { + name: "event < start && event < stop", + args: args{timeFilter: &v1alpha1.TimeFilter{ + Start: metav1.Time{ + Time: time.Date(2017, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + Stop: metav1.Time{ + Time: time.Date(2018, time.May, 10, 0, 0, 0, 0, time.UTC), + }, + }, eventTime: &metav1.Time{ + Time: time.Date(2016, time.May, 10, 0, 0, 0, 0, time.UTC), + }}, + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := filterTime(tt.args.timeFilter, tt.args.eventTime); got != tt.want { + t.Errorf("filterTime() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_filterContext(t *testing.T) { + type args struct { + expected *v1alpha1.EventContext + actual *v1alpha1.EventContext + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "eventType", + args: args{expected: &v1alpha1.EventContext{ + EventType: "argo.io.event", + }, actual: &v1alpha1.EventContext{ + EventType: "argo.io.event", + }}, + want: true, + }, + { + name: "eventTypeVersion", + args: args{expected: &v1alpha1.EventContext{ + EventTypeVersion: "v1", + }, actual: &v1alpha1.EventContext{ + EventTypeVersion: "v1", + }}, + want: true, + }, + { + name: "cloudEventsVersion", + args: args{expected: &v1alpha1.EventContext{ + CloudEventsVersion: "v1", + }, actual: &v1alpha1.EventContext{ + CloudEventsVersion: "v1", + }}, + want: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := filterContext(tt.args.expected, tt.args.actual); got != tt.want { + t.Errorf("filterContext() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_filterData(t *testing.T) { + type args struct { + dataFilters []*v1alpha1.DataFilter + event *v1alpha1.Event + } + tests := []struct { + name string + args args + want bool + wantErr bool + }{ + { + name: "nil event", + args: args{dataFilters: nil, event: nil}, + want: false, + wantErr: true, + }, + { + name: "unsupported content type", + args: args{dataFilters: nil, event: &v1alpha1.Event{Data: []byte("a")}}, + want: false, + wantErr: true, + }, + { + name: "empty data", + args: args{dataFilters: nil, event: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: "application/json", + }, + }}, + want: true, + wantErr: false, + }, + { + name: "nil filters, JSON data", + args: args{dataFilters: nil, event: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: "application/json", + }, + Data: []byte("{\"k\": \"v\"}"), + }}, + want: true, + wantErr: false, + }, + { + name: "string filter, JSON data", + args: args{dataFilters: []*v1alpha1.DataFilter{ + { + Path: "k", + Type: v1alpha1.JSONTypeString, + Value: "v", + }, + }, event: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: "application/json", + }, + Data: []byte("{\"k\": \"v\"}"), + }}, + want: true, + wantErr: false, + }, + { + name: "number filter, JSON data", + args: args{dataFilters: []*v1alpha1.DataFilter{ + { + Path: "k", + Type: v1alpha1.JSONTypeNumber, + Value: "1.0", + }, + }, event: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: "application/json", + }, + Data: []byte("{\"k\": \"1.0\"}"), + }}, + want: true, + wantErr: false, + }, + { + name: "multiple filters, nested JSON data", + args: args{dataFilters: []*v1alpha1.DataFilter{ + { + Path: "k", + Type: v1alpha1.JSONTypeBool, + Value: "true", + }, + { + Path: "k1.k", + Type: v1alpha1.JSONTypeNumber, + Value: "3.14", + }, + { + Path: "k1.k2", + Type: v1alpha1.JSONTypeString, + Value: "hello,world", + }, + }, event: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: "application/json", + }, + Data: []byte("{\"k\": true, \"k1\": {\"k\": 3.14, \"k2\": \"hello, world\"}}"), + }}, + want: false, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := filterData(tt.args.dataFilters, tt.args.event) + if (err != nil) != tt.wantErr { + t.Errorf("filterData() error = %v, wantErr %v", err, tt.wantErr) + return + } + if got != tt.want { + t.Errorf("filterData() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_mapIsSubset(t *testing.T) { + type args struct { + sub map[string]string + m map[string]string + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "nil sub, nil map", + args: args{sub: nil, m: nil}, + want: true, + }, + { + name: "empty sub, empty map", + args: args{sub: make(map[string]string), m: make(map[string]string)}, + want: true, + }, + { + name: "empty sub, non-empty map", + args: args{sub: make(map[string]string), m: map[string]string{"k": "v"}}, + want: true, + }, + { + name: "disjoint", + args: args{sub: map[string]string{"k1": "v1"}, m: map[string]string{"k": "v"}}, + want: false, + }, + { + name: "subset", + args: args{sub: map[string]string{"k1": "v1"}, m: map[string]string{"k": "v", "k1": "v1"}}, + want: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := mapIsSubset(tt.args.sub, tt.args.m); got != tt.want { + t.Errorf("mapIsSubset() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/controller/signal.go b/controller/signal.go index b5dc3b8c4c..e1cf9813b5 100644 --- a/controller/signal.go +++ b/controller/signal.go @@ -130,11 +130,21 @@ func (soc *sOperationCtx) watchSignal(signal *v1alpha1.Signal) error { return err } nodeID := soc.s.NodeID(signal.Name) + + streamCtx := streamCtx{ + ctx: ctx, + cancel: cancel, + sensor: soc.s.Name, + nodeID: nodeID, + signal: signal, + stream: stream, + } + soc.controller.signalMu.Lock() soc.controller.signalStreams[nodeID] = stream soc.controller.signalMu.Unlock() - go soc.controller.listenOnStream(soc.s.Name, signal.Name, nodeID, stream, cancel) + go soc.controller.listenOnStream(&streamCtx) return nil } @@ -159,66 +169,86 @@ func (c *SensorController) stopSignal(nodeID string) error { return nil } +// streamCtx contains the relevant context data for processing the signal event stream +type streamCtx struct { + ctx context.Context + cancel context.CancelFunc + sensor string + nodeID string + signal *v1alpha1.Signal + stream sdk.SignalService_ListenService +} + // listens for events on the event stream. meant to be run as a separate goroutine // this will terminate once the stream receives an EOF indicating it has completed or it encounters a stream error. // NOTE: this is a method on the controller -func (c *SensorController) listenOnStream(sensor, signal, nodeID string, stream sdk.SignalService_ListenService, cancel context.CancelFunc) { +func (c *SensorController) listenOnStream(streamCtx *streamCtx) { // TODO: possible context leak if we don't utilize cancel //defer cancel() sensors := c.sensorClientset.ArgoprojV1alpha1().Sensors(c.Config.Namespace) for { - in, streamErr := stream.Recv() + in, streamErr := streamCtx.stream.Recv() if streamErr == io.EOF { return } // retrieve the sensor & node as this will be needed to update accordingly - s, err := sensors.Get(sensor, metav1.GetOptions{}) + s, err := sensors.Get(streamCtx.sensor, metav1.GetOptions{}) if err != nil { // we can get here if the sensor was deleted and the stream was not closed // we should attempt to log a warning and stop & close the signal stream // TODO: why call stopSignal() when we have access to the stream within this func? - c.log.Warnf("sensor '%s' cannot be found due to: %s. Stopping signal '%s' event stream...", sensor, err, signal) - err := c.stopSignal(nodeID) + c.log.Warnf("Event Stream (%s/%s) Error: %s. Terminating event stream...", streamCtx.sensor, streamCtx.signal.Name, err) + err := c.stopSignal(streamCtx.nodeID) if err != nil { - c.log.Panicf("failed to stop signal stream '%s': %s", nodeID, err) + c.log.Panicf("failed to stop signal stream '%s': %s", streamCtx.nodeID, err) } } phase := s.Status.Phase msg := s.Status.Message - node, ok := s.Status.Nodes[nodeID] + node, ok := s.Status.Nodes[streamCtx.nodeID] if !ok { // TODO: should we re-initialize this node? - c.log.Panicf("'%s' node is missing from sensor's nodes", nodeID) + c.log.Panicf("Event Stream (%s/%s) Fatal: '%s' node is missing from sensor's nodes", streamCtx.sensor, streamCtx.signal.Name, streamCtx.nodeID) } if streamErr != nil { - c.log.Infof("ERROR: sensor '%s' signal '%s' stream failed: %s", sensor, signal, streamErr) + c.log.Infof("Event Stream (%s/%s) Error: removing & terminating stream due to: %s", streamCtx.sensor, streamCtx.signal.Name, streamErr) // error received from the stream // remove the stream from the signalStreams map c.signalMu.Lock() - c.signalStreams[nodeID] = nil - delete(c.signalStreams, nodeID) + c.signalStreams[streamCtx.nodeID] = nil + delete(c.signalStreams, streamCtx.nodeID) c.signalMu.Unlock() // mark the sensor & node as error phase phase = v1alpha1.NodePhaseError - msg = fmt.Sprintf("signal '%s' encountered stream err: %s", signal, streamErr) + msg = fmt.Sprintf("Event Stream encountered err: %s", streamErr) node.Phase = v1alpha1.NodePhaseError node.Message = streamErr.Error() } else { - c.log.Debugf("sensor '%s' received event for signal '%s'", sensor, signal) - node.LatestEvent = &v1alpha1.EventWrapper{Event: *in.Event} + ok, err := filterEvent(streamCtx.signal.Filters, in.Event) + if err != nil { + c.log.Infof("Event Stream (%s/%s) Msg: (Action:IGNORED) - Failed to filter event: %s", streamCtx.sensor, streamCtx.signal.Name, err) + continue + } + if ok { + c.log.Debugf("Event Stream (%s/%s) Msg: (Action:ACCEPTED) - Context: %s", streamCtx.sensor, streamCtx.signal.Name, in.Event.Context) + node.LatestEvent = &v1alpha1.EventWrapper{Event: *in.Event} + } else { + c.log.Debugf("Event Stream (%s/%s) Msg: (Action:FILTERED) - Context: %s", streamCtx.sensor, streamCtx.signal.Name, in.Event.Context) + continue + } } // TODO: perform a Patch here instead as the sensor could become stale // and this exponential backoff is slow err = wait.ExponentialBackoff(common.DefaultRetry, func() (bool, error) { - s, err := sensors.Get(sensor, metav1.GetOptions{}) + s, err := sensors.Get(streamCtx.sensor, metav1.GetOptions{}) if err != nil { return false, err } - s.Status.Nodes[nodeID] = node + s.Status.Nodes[streamCtx.nodeID] = node s.Status.Phase = phase s.Status.Message = msg _, err = sensors.Update(s) @@ -231,7 +261,7 @@ func (c *SensorController) listenOnStream(sensor, signal, nodeID string, stream return true, nil }) if err != nil { - c.log.Panicf("failed to update sensor: %s", err) + c.log.Panicf("Event Stream (%s/%s) Update Resource Failed: %s", streamCtx.sensor, streamCtx.signal.Name, err) } // finally check if there was a streamErr, we must return diff --git a/docs/index.md b/docs/index.md index 078f406cf7..4cf986d436 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,6 +17,6 @@ Argo Events is an open source event-based dependency manager for Kubernetes. The - Easily leverage Kubernetes native APIs to monitor dependencies ## Learn More +- [Quickstart](quickstart.md) - [Signals](signal-guide.md) - [Triggers](trigger-guide.md) -- [Sensor API](sensor-api.md) diff --git a/docs/sensor-api.md b/docs/sensor-api.md deleted file mode 100644 index 52f748f449..0000000000 --- a/docs/sensor-api.md +++ /dev/null @@ -1,189 +0,0 @@ -# Sensor API -The API specifications for Kubernetes Sensor CRDs. See the project's `examples` directory for applications of this API. - -## Sensor v1alpha1 event - -| Group | Version | Kind | -|:---------:|:-----------:|:--------:| -| `event` | `v1alpha1` | `Sensor` | - - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `apiVersion` | *string* | Defines the versioned schema of this object. For us, this is `event/v1alpha1`. More info [here](https://git.k8s.io/community/contributors/devel/api-conventions.md#resources) | -| `kind` | *string* | Represents the REST resource this object represents. For us, this is `Sensor`. More info [here](https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds) | -| `metadata` | *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#objectmeta-v1-meta)* | ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. | -| `spec` | *[SensorSpec](#sensorspec-v1alpha1-event)* | The specification for the sensor and its desired state | -| `status` | *[SensorStatus](#sensorstatus-v1alpha1-event)* | Information about the most recently observed status of the sensor | - - -### SensorSpec v1alpha1 event - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `signals` | *[Signal](#signal-v1alpha1-event)* array | List of signal dependencies | -| `triggers` | *[Trigger](#trigger-v1alpha1-event)* array | List of trigger actions | -| `escalation` | *[EscalationPolicy](#escalation-policy)* | Specify the policy for escalating signal failures | -| `repeat` | *bool* | Should repeat execution of signal resolution and action triggering | - - -### SensorStatus v1alpha1 event - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `phase` | *string* | Current condition of the sensor | -| `startedAt` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time at which the sensor started listening for events | -| `resolvedAt` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time at which the sensor successfully resolved all dependent signals | -| `message` | *string* | Human readable string indicating details about a sensor in its phase | -| `nodes` | map *string* -> *[NodeStatus](#node-status)* | Mapping between a node ID and the node's status | -| `escalated` | *bool* | Flag for whether the sensor was escalated | - - -### Signal v1alpha1 event - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `name` | *string* | Unique name for this dependencies | -| `deadline` | *int64* | Duration in seconds after the *startedAt* time in which the signal is terminated (currently not implemented) | -| `stream` | *[Stream](#stream-v1alpha1-event)* | An arbitrary message stream signal | -| `artifact` | *[ArtifactSignal](#artifact-signal)* | Artifact based signal. currently S3 is the only type supported | -| `calendar` | *[CalendarSignal](#calendar-signal)* | Time-based signal | -| `resource` | *[ResourceSignal](#resource-signal)* | Kubernetes resource based signal | -| `webhook` | *[WebhookSignal](#webhook-signal)* | HTTP notification dependency | -| `constraints`| *[SignalConstraints](#signal-constraints)* | Rules governing tolerations and accepted event-meta information | - - -### Trigger v1alpha1 event - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `name` | *string* | Unique name for this action | -| `message` | *[Message](#message)* | The message to send on a queue | -| `resource` | *[ResourceObject](#resourceobject)* | The K8s Object to create | -| `retryStrategy` | *[RetryStrategy](#retry-strategy)* | Defines a strategy to retry if the trigger fails (currently not yet implemented) | - -### Message - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `body` | *string* | The content of the message | -| `stream` | *[Stream](#stream-v1alpha1-event)* | The stream resource queue on which to send the message | - -### Stream v1alpha1 event - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `type` | *string* | The type of the stream | -| `url` | *string* | The url for client connections to the service | -| `attributes` | map *string* -> *string* | A map of the additional fields or properties specific to each service implementation | - -### ResourceObject - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `namespace` | *string* | The Kubernetes namespace to create this resource object | -| `group` | *string* | The API Group as specified in the REST path and in the `apiVersion` field of a Kubernetes object, e.g. `core`, `batch`, etc. | -| `version` | *string* | The version as part of the named group's REST path: `apis/$GROUP_NAME/$VERSION`, and `apiVersion: $GROUP_NAME/$VERSION` | -| `kind` | *string* | The kind of the Kubernetes resource, as specified in the `TypeMeta` of the object | -| `labels` | map *string* -> *string* | The labels to apply to this resource | -| `s3` | *[S3](#s3-artifact)* | The S3 Artifact location of the resource file | - - -### Artifact Signal - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `s3` | *[S3Artifact](#s3-artifact) | An S3 artifact | -| `stream` | *[Stream](#stream-v1alpha1-event) | The stream to listen for artifact notifications | - - -### Calendar Signal - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `schedule` | *string* | A [cron](https://en.wikipedia.org/wiki/Cron) | -| `interval` | *string* | A interval duration defined in Go. This is parsed using golang time library's [ParseDuration](https://golang.org/pkg/time/#ParseDuration) function | -| `recurrence` | *string* array | List of RRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. This feature is not yet implemented. | - - - -### Resource Signal -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `namespace` | *string* | The Kubernetes namespace to watch for these resources | -| `group` | *string* | The API Group as specified in the REST path and in the `apiVersion` field of a Kubernetes object, e.g. `core`, `batch`, etc. | -| `version` | *string* | The version as part of the named group's REST path: `apis/$GROUP_NAME/$VERSION`, and `apiVersion: $GROUP_NAME/$VERSION` | -| `kind` | *string* | The kind of the Kubernetes resource, as specified in the `TypeMeta` of the object | - - - -### Webhook Signal -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `endpoint` | *string* | REST API endpoint | -| `port` | *int* | HTTP server port to listen on | -| `method` | *string* | HTTP request method that indicates the desired action to be performed for a given resource. See RFC7231 | - - -### Signal Constraints - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `time` | *[TimeConstraints](#time-constraints)* | The time constraints for this dependency | - - -### Time Constraints - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `start` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time at which the sensor should start accepting events from the specified dependency | -| `stop` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time at which the sensor should stop accepting events from the specified dependency | - - -### Escalation Policy - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `level` | *string* | Degree of importance for this sensor | -| `trigger` | *[Trigger](#trigger-v1alpha1-event)* | The trigger (action) to fire to escalate this issue | - - -### Node Status - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `id` | *string* | Unique identifier for this sensor node | -| `name` | *string* | Name of the node (signal\trigger) used to generate the `id` | -| `displayName` | *string* | Human readable representation of the node | -| `type` | *string* | The type of the Node, e.g. `signal` or `trigger` | -| `phase` | *string* | The most current status of the node | -| `startedAt` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time at which the node started processing | -| `resolvedAt` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time at which the node finished processing | -| `message` | *string* | Human readable message indicating information and or explanation about the status of the node | - - -### S3 Artifact - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `endpoint` | *string* | The URL of the S3 object storage server | -| `key` | *string* | The name of the key of the object | -| `bucket` | *string* | The name of the S3 bucket | -| `event` | *string* | The type of the notification event, e.g. "s3:ObjectCreated:*", "s3:ObjectCreated:Put*, etc... | -| `filter` | *[S3Filter](#s3-filter) | An additional filter applied on S3 object notifications | - -### S3 Filter - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `prefix` | *string* | The string literal prefix to match for S3 objects | -| `suffix` | *string* | The string literal suffix to match for S3 objects | - -### Resource Filter - -| Field | Type | Description | -|--------------|------------------------------------------|-------------------------------| -| `prefix` | *string* | The string literal prefix to match for resource object meta name | -| `labels` | map *string* -> *string* | Labels is an unstructured key value map that is used as selectors in finding this resource | -| `annotations`| map *string* -> *string* | Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. | -| `createdBy` | *[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#time-v1-meta)* | RFC 3339 date and time after which this resource should have been created | \ No newline at end of file diff --git a/docs/signal-guide.md b/docs/signal-guide.md index 583a1ee15d..702ef19d0e 100644 --- a/docs/signal-guide.md +++ b/docs/signal-guide.md @@ -1,5 +1,5 @@ # Signal Guide -Signals are the sensor's dependencies. To take advantage of the certain signal sources, you can follow this guide to help you getting started installing these other services on your kubernetes cluster. If you need to reference the underlying sensor api, please use the [api-guide](sensor-api.md). +Signals are the sensor's dependencies. To take advantage of the certain signal sources, you can follow this guide to help you getting started installing these other services on your kubernetes cluster. ## What is a signal? A `signal` is a dependency, namely: @@ -18,7 +18,7 @@ The `sensor-controller` is responsible for managing the `Sensor` resources, list The following types of signals are supported: - Artifact signals which can include things like S3 Bucket Notifications etc.. - Stream signals which subscribe to messages on a queue or a topic - - Calendar signals which contain time constraints and calendar events + - Calendar signals which contain time schedules and calendar events - Resource signals watch changes to Kubernetes resources - Webhook signals which can include things like Git, JIRA, Trello etc. webhook notifications diff --git a/examples/context-filter-webhook.yaml b/examples/context-filter-webhook.yaml new file mode 100644 index 0000000000..37cb53b11d --- /dev/null +++ b/examples/context-filter-webhook.yaml @@ -0,0 +1,35 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Sensor +metadata: + name: webhook-example + labels: + sensors.argoproj.io/controller-instanceid: axis +spec: + signals: + - name: webhook + webhook: + endpoint: /app + method: POST + filters: + context: + source: + host: amazon.com + contentType: application/json + triggers: + - name: done-workflow + resource: + group: argoproj.io + version: v1alpha1 + kind: Workflow + artifactLocation: + s3: + bucket: workflows + key: hello-world.yaml + endpoint: minio-service.default:9000 + insecure: true + accessKey: + key: accesskey + name: artifacts-minio + secretKey: + key: secretkey + name: artifacts-minio diff --git a/examples/data-filter-webhook.yaml b/examples/data-filter-webhook.yaml new file mode 100644 index 0000000000..6f0690a466 --- /dev/null +++ b/examples/data-filter-webhook.yaml @@ -0,0 +1,35 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Sensor +metadata: + name: webhook-example + labels: + sensors.argoproj.io/controller-instanceid: axis +spec: + signals: + - name: webhook + webhook: + endpoint: /app + method: POST + filters: + data: + - path: bucket + type: string + value: argo-workflow-input + triggers: + - name: done-workflow + resource: + group: argoproj.io + version: v1alpha1 + kind: Workflow + artifactLocation: + s3: + bucket: workflows + key: hello-world.yaml + endpoint: minio-service.default:9000 + insecure: true + accessKey: + key: accesskey + name: artifacts-minio + secretKey: + key: secretkey + name: artifacts-minio diff --git a/examples/time-filter-webhook.yaml b/examples/time-filter-webhook.yaml new file mode 100644 index 0000000000..9a5623ca21 --- /dev/null +++ b/examples/time-filter-webhook.yaml @@ -0,0 +1,34 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Sensor +metadata: + name: webhook-example + labels: + sensors.argoproj.io/controller-instanceid: axis +spec: + signals: + - name: webhook + webhook: + endpoint: /app + method: POST + filters: + time: + start: "2016-05-10T15:04:05Z07:00" + stop: "2020-01-02T15:04:05Z07:00" + triggers: + - name: done-workflow + resource: + group: argoproj.io + version: v1alpha1 + kind: Workflow + artifactLocation: + s3: + bucket: workflows + key: hello-world.yaml + endpoint: minio-service.default:9000 + insecure: true + accessKey: + key: accesskey + name: artifacts-minio + secretKey: + key: secretkey + name: artifacts-minio diff --git a/pkg/apis/sensor/v1alpha1/generated.pb.go b/pkg/apis/sensor/v1alpha1/generated.pb.go index f27244bc27..f5c2d43f40 100644 --- a/pkg/apis/sensor/v1alpha1/generated.pb.go +++ b/pkg/apis/sensor/v1alpha1/generated.pb.go @@ -44,7 +44,7 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package func (m *ArtifactLocation) Reset() { *m = ArtifactLocation{} } func (*ArtifactLocation) ProtoMessage() {} func (*ArtifactLocation) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{0} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{0} } func (m *ArtifactLocation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,7 +72,7 @@ var xxx_messageInfo_ArtifactLocation proto.InternalMessageInfo func (m *ArtifactSignal) Reset() { *m = ArtifactSignal{} } func (*ArtifactSignal) ProtoMessage() {} func (*ArtifactSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{1} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{1} } func (m *ArtifactSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -100,7 +100,7 @@ var xxx_messageInfo_ArtifactSignal proto.InternalMessageInfo func (m *CalendarSignal) Reset() { *m = CalendarSignal{} } func (*CalendarSignal) ProtoMessage() {} func (*CalendarSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{2} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{2} } func (m *CalendarSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -125,10 +125,38 @@ func (m *CalendarSignal) XXX_DiscardUnknown() { var xxx_messageInfo_CalendarSignal proto.InternalMessageInfo +func (m *DataFilter) Reset() { *m = DataFilter{} } +func (*DataFilter) ProtoMessage() {} +func (*DataFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_generated_122c2bb8f9413e3d, []int{3} +} +func (m *DataFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DataFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (dst *DataFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_DataFilter.Merge(dst, src) +} +func (m *DataFilter) XXX_Size() int { + return m.Size() +} +func (m *DataFilter) XXX_DiscardUnknown() { + xxx_messageInfo_DataFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_DataFilter proto.InternalMessageInfo + func (m *EscalationPolicy) Reset() { *m = EscalationPolicy{} } func (*EscalationPolicy) ProtoMessage() {} func (*EscalationPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{3} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{4} } func (m *EscalationPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,7 +184,7 @@ var xxx_messageInfo_EscalationPolicy proto.InternalMessageInfo func (m *Event) Reset() { *m = Event{} } func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{4} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{5} } func (m *Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -184,7 +212,7 @@ var xxx_messageInfo_Event proto.InternalMessageInfo func (m *EventContext) Reset() { *m = EventContext{} } func (*EventContext) ProtoMessage() {} func (*EventContext) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{5} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{6} } func (m *EventContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,7 +240,7 @@ var xxx_messageInfo_EventContext proto.InternalMessageInfo func (m *EventWrapper) Reset() { *m = EventWrapper{} } func (*EventWrapper) ProtoMessage() {} func (*EventWrapper) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{6} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{7} } func (m *EventWrapper) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +268,7 @@ var xxx_messageInfo_EventWrapper proto.InternalMessageInfo func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} } func (*GroupVersionKind) ProtoMessage() {} func (*GroupVersionKind) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{7} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{8} } func (m *GroupVersionKind) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -268,7 +296,7 @@ var xxx_messageInfo_GroupVersionKind proto.InternalMessageInfo func (m *Message) Reset() { *m = Message{} } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{8} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{9} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -296,7 +324,7 @@ var xxx_messageInfo_Message proto.InternalMessageInfo func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (*NodeStatus) ProtoMessage() {} func (*NodeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{9} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{10} } func (m *NodeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -324,7 +352,7 @@ var xxx_messageInfo_NodeStatus proto.InternalMessageInfo func (m *ResourceFilter) Reset() { *m = ResourceFilter{} } func (*ResourceFilter) ProtoMessage() {} func (*ResourceFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{10} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{11} } func (m *ResourceFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -352,7 +380,7 @@ var xxx_messageInfo_ResourceFilter proto.InternalMessageInfo func (m *ResourceObject) Reset() { *m = ResourceObject{} } func (*ResourceObject) ProtoMessage() {} func (*ResourceObject) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{11} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{12} } func (m *ResourceObject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -380,7 +408,7 @@ var xxx_messageInfo_ResourceObject proto.InternalMessageInfo func (m *ResourceSignal) Reset() { *m = ResourceSignal{} } func (*ResourceSignal) ProtoMessage() {} func (*ResourceSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{12} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{13} } func (m *ResourceSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +436,7 @@ var xxx_messageInfo_ResourceSignal proto.InternalMessageInfo func (m *RetryStrategy) Reset() { *m = RetryStrategy{} } func (*RetryStrategy) ProtoMessage() {} func (*RetryStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{13} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{14} } func (m *RetryStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,7 +464,7 @@ var xxx_messageInfo_RetryStrategy proto.InternalMessageInfo func (m *S3Artifact) Reset() { *m = S3Artifact{} } func (*S3Artifact) ProtoMessage() {} func (*S3Artifact) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{14} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{15} } func (m *S3Artifact) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +492,7 @@ var xxx_messageInfo_S3Artifact proto.InternalMessageInfo func (m *S3Bucket) Reset() { *m = S3Bucket{} } func (*S3Bucket) ProtoMessage() {} func (*S3Bucket) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{15} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{16} } func (m *S3Bucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -492,7 +520,7 @@ var xxx_messageInfo_S3Bucket proto.InternalMessageInfo func (m *S3Filter) Reset() { *m = S3Filter{} } func (*S3Filter) ProtoMessage() {} func (*S3Filter) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{16} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{17} } func (m *S3Filter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -520,7 +548,7 @@ var xxx_messageInfo_S3Filter proto.InternalMessageInfo func (m *Sensor) Reset() { *m = Sensor{} } func (*Sensor) ProtoMessage() {} func (*Sensor) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{17} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{18} } func (m *Sensor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -548,7 +576,7 @@ var xxx_messageInfo_Sensor proto.InternalMessageInfo func (m *SensorList) Reset() { *m = SensorList{} } func (*SensorList) ProtoMessage() {} func (*SensorList) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{18} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{19} } func (m *SensorList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -576,7 +604,7 @@ var xxx_messageInfo_SensorList proto.InternalMessageInfo func (m *SensorSpec) Reset() { *m = SensorSpec{} } func (*SensorSpec) ProtoMessage() {} func (*SensorSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{19} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{20} } func (m *SensorSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -604,7 +632,7 @@ var xxx_messageInfo_SensorSpec proto.InternalMessageInfo func (m *SensorStatus) Reset() { *m = SensorStatus{} } func (*SensorStatus) ProtoMessage() {} func (*SensorStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{20} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{21} } func (m *SensorStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -632,7 +660,7 @@ var xxx_messageInfo_SensorStatus proto.InternalMessageInfo func (m *Signal) Reset() { *m = Signal{} } func (*Signal) ProtoMessage() {} func (*Signal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{21} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{22} } func (m *Signal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -657,15 +685,15 @@ func (m *Signal) XXX_DiscardUnknown() { var xxx_messageInfo_Signal proto.InternalMessageInfo -func (m *SignalConstraints) Reset() { *m = SignalConstraints{} } -func (*SignalConstraints) ProtoMessage() {} -func (*SignalConstraints) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{22} +func (m *SignalFilter) Reset() { *m = SignalFilter{} } +func (*SignalFilter) ProtoMessage() {} +func (*SignalFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_generated_122c2bb8f9413e3d, []int{23} } -func (m *SignalConstraints) XXX_Unmarshal(b []byte) error { +func (m *SignalFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SignalConstraints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SignalFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalTo(b) if err != nil { @@ -673,22 +701,22 @@ func (m *SignalConstraints) XXX_Marshal(b []byte, deterministic bool) ([]byte, e } return b[:n], nil } -func (dst *SignalConstraints) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignalConstraints.Merge(dst, src) +func (dst *SignalFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalFilter.Merge(dst, src) } -func (m *SignalConstraints) XXX_Size() int { +func (m *SignalFilter) XXX_Size() int { return m.Size() } -func (m *SignalConstraints) XXX_DiscardUnknown() { - xxx_messageInfo_SignalConstraints.DiscardUnknown(m) +func (m *SignalFilter) XXX_DiscardUnknown() { + xxx_messageInfo_SignalFilter.DiscardUnknown(m) } -var xxx_messageInfo_SignalConstraints proto.InternalMessageInfo +var xxx_messageInfo_SignalFilter proto.InternalMessageInfo func (m *Stream) Reset() { *m = Stream{} } func (*Stream) ProtoMessage() {} func (*Stream) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{23} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{24} } func (m *Stream) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -713,15 +741,15 @@ func (m *Stream) XXX_DiscardUnknown() { var xxx_messageInfo_Stream proto.InternalMessageInfo -func (m *TimeConstraints) Reset() { *m = TimeConstraints{} } -func (*TimeConstraints) ProtoMessage() {} -func (*TimeConstraints) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{24} +func (m *TimeFilter) Reset() { *m = TimeFilter{} } +func (*TimeFilter) ProtoMessage() {} +func (*TimeFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_generated_122c2bb8f9413e3d, []int{25} } -func (m *TimeConstraints) XXX_Unmarshal(b []byte) error { +func (m *TimeFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TimeConstraints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TimeFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalTo(b) if err != nil { @@ -729,22 +757,22 @@ func (m *TimeConstraints) XXX_Marshal(b []byte, deterministic bool) ([]byte, err } return b[:n], nil } -func (dst *TimeConstraints) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeConstraints.Merge(dst, src) +func (dst *TimeFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeFilter.Merge(dst, src) } -func (m *TimeConstraints) XXX_Size() int { +func (m *TimeFilter) XXX_Size() int { return m.Size() } -func (m *TimeConstraints) XXX_DiscardUnknown() { - xxx_messageInfo_TimeConstraints.DiscardUnknown(m) +func (m *TimeFilter) XXX_DiscardUnknown() { + xxx_messageInfo_TimeFilter.DiscardUnknown(m) } -var xxx_messageInfo_TimeConstraints proto.InternalMessageInfo +var xxx_messageInfo_TimeFilter proto.InternalMessageInfo func (m *Trigger) Reset() { *m = Trigger{} } func (*Trigger) ProtoMessage() {} func (*Trigger) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{25} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{26} } func (m *Trigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -772,7 +800,7 @@ var xxx_messageInfo_Trigger proto.InternalMessageInfo func (m *URI) Reset() { *m = URI{} } func (*URI) ProtoMessage() {} func (*URI) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{26} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{27} } func (m *URI) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -800,7 +828,7 @@ var xxx_messageInfo_URI proto.InternalMessageInfo func (m *WebhookSignal) Reset() { *m = WebhookSignal{} } func (*WebhookSignal) ProtoMessage() {} func (*WebhookSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_3fbfa6ccbf9879ef, []int{27} + return fileDescriptor_generated_122c2bb8f9413e3d, []int{28} } func (m *WebhookSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -829,6 +857,7 @@ func init() { proto.RegisterType((*ArtifactLocation)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ArtifactLocation") proto.RegisterType((*ArtifactSignal)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ArtifactSignal") proto.RegisterType((*CalendarSignal)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.CalendarSignal") + proto.RegisterType((*DataFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.DataFilter") proto.RegisterType((*EscalationPolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.EscalationPolicy") proto.RegisterType((*Event)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.Event") proto.RegisterType((*EventContext)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.EventContext") @@ -853,10 +882,10 @@ func init() { proto.RegisterType((*SensorStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.SensorStatus") proto.RegisterMapType((map[string]NodeStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.SensorStatus.NodesEntry") proto.RegisterType((*Signal)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.Signal") - proto.RegisterType((*SignalConstraints)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.SignalConstraints") + proto.RegisterType((*SignalFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.SignalFilter") proto.RegisterType((*Stream)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.Stream") proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.Stream.AttributesEntry") - proto.RegisterType((*TimeConstraints)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.TimeConstraints") + proto.RegisterType((*TimeFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.TimeFilter") proto.RegisterType((*Trigger)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.Trigger") proto.RegisterType((*URI)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.URI") proto.RegisterType((*WebhookSignal)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.WebhookSignal") @@ -968,6 +997,36 @@ func (m *CalendarSignal) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *DataFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DataFilter) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i += copy(dAtA[i:], m.Path) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i += copy(dAtA[i:], m.Type) + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) + return i, nil +} + func (m *EscalationPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1883,8 +1942,8 @@ func (m *Signal) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x42 i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Constraints.Size())) - n36, err := m.Constraints.MarshalTo(dAtA[i:]) + i = encodeVarintGenerated(dAtA, i, uint64(m.Filters.Size())) + n36, err := m.Filters.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -1892,7 +1951,7 @@ func (m *Signal) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *SignalConstraints) Marshal() (dAtA []byte, err error) { +func (m *SignalFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -1902,19 +1961,43 @@ func (m *SignalConstraints) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SignalConstraints) MarshalTo(dAtA []byte) (int, error) { +func (m *SignalFilter) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Time.Size())) - n37, err := m.Time.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Time != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Time.Size())) + n37, err := m.Time.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n37 + } + if m.Context != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Context.Size())) + n38, err := m.Context.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n38 + } + if len(m.Data) > 0 { + for _, msg := range m.Data { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - i += n37 return i, nil } @@ -1966,7 +2049,7 @@ func (m *Stream) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *TimeConstraints) Marshal() (dAtA []byte, err error) { +func (m *TimeFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -1976,7 +2059,7 @@ func (m *TimeConstraints) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TimeConstraints) MarshalTo(dAtA []byte) (int, error) { +func (m *TimeFilter) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -1984,19 +2067,19 @@ func (m *TimeConstraints) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Start.Size())) - n38, err := m.Start.MarshalTo(dAtA[i:]) + n39, err := m.Start.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n39 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Stop.Size())) - n39, err := m.Stop.MarshalTo(dAtA[i:]) + n40, err := m.Stop.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n40 return i, nil } @@ -2023,31 +2106,31 @@ func (m *Trigger) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n40, err := m.Resource.MarshalTo(dAtA[i:]) + n41, err := m.Resource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n40 + i += n41 } if m.Message != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Message.Size())) - n41, err := m.Message.MarshalTo(dAtA[i:]) + n42, err := m.Message.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n41 + i += n42 } if m.RetryStrategy != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.RetryStrategy.Size())) - n42, err := m.RetryStrategy.MarshalTo(dAtA[i:]) + n43, err := m.RetryStrategy.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n42 + i += n43 } return i, nil } @@ -2177,6 +2260,18 @@ func (m *CalendarSignal) Size() (n int) { return n } +func (m *DataFilter) Size() (n int) { + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *EscalationPolicy) Size() (n int) { var l int _ = l @@ -2497,16 +2592,28 @@ func (m *Signal) Size() (n int) { l = m.Webhook.Size() n += 1 + l + sovGenerated(uint64(l)) } - l = m.Constraints.Size() + l = m.Filters.Size() n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *SignalConstraints) Size() (n int) { +func (m *SignalFilter) Size() (n int) { var l int _ = l - l = m.Time.Size() - n += 1 + l + sovGenerated(uint64(l)) + if m.Time != nil { + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Data) > 0 { + for _, e := range m.Data { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -2528,7 +2635,7 @@ func (m *Stream) Size() (n int) { return n } -func (m *TimeConstraints) Size() (n int) { +func (m *TimeFilter) Size() (n int) { var l int _ = l l = m.Start.Size() @@ -2637,6 +2744,18 @@ func (this *CalendarSignal) String() string { }, "") return s } +func (this *DataFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DataFilter{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} func (this *EscalationPolicy) String() string { if this == nil { return "nil" @@ -2927,17 +3046,19 @@ func (this *Signal) String() string { `Calendar:` + strings.Replace(fmt.Sprintf("%v", this.Calendar), "CalendarSignal", "CalendarSignal", 1) + `,`, `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceSignal", "ResourceSignal", 1) + `,`, `Webhook:` + strings.Replace(fmt.Sprintf("%v", this.Webhook), "WebhookSignal", "WebhookSignal", 1) + `,`, - `Constraints:` + strings.Replace(strings.Replace(this.Constraints.String(), "SignalConstraints", "SignalConstraints", 1), `&`, ``, 1) + `,`, + `Filters:` + strings.Replace(strings.Replace(this.Filters.String(), "SignalFilter", "SignalFilter", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } -func (this *SignalConstraints) String() string { +func (this *SignalFilter) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&SignalConstraints{`, - `Time:` + strings.Replace(strings.Replace(this.Time.String(), "TimeConstraints", "TimeConstraints", 1), `&`, ``, 1) + `,`, + s := strings.Join([]string{`&SignalFilter{`, + `Time:` + strings.Replace(fmt.Sprintf("%v", this.Time), "TimeFilter", "TimeFilter", 1) + `,`, + `Context:` + strings.Replace(fmt.Sprintf("%v", this.Context), "EventContext", "EventContext", 1) + `,`, + `Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "DataFilter", "DataFilter", 1) + `,`, `}`, }, "") return s @@ -2964,11 +3085,11 @@ func (this *Stream) String() string { }, "") return s } -func (this *TimeConstraints) String() string { +func (this *TimeFilter) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&TimeConstraints{`, + s := strings.Join([]string{`&TimeFilter{`, `Start:` + strings.Replace(strings.Replace(this.Start.String(), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, `Stop:` + strings.Replace(strings.Replace(this.Stop.String(), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, `}`, @@ -3384,6 +3505,143 @@ func (m *CalendarSignal) Unmarshal(dAtA []byte) error { } return nil } +func (m *DataFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DataFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DataFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = JSONType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EscalationPolicy) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6917,7 +7175,7 @@ func (m *Signal) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6941,7 +7199,7 @@ func (m *Signal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Constraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6966,7 +7224,7 @@ func (m *Signal) Unmarshal(dAtA []byte) error { } return nil } -func (m *SignalConstraints) Unmarshal(dAtA []byte) error { +func (m *SignalFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6989,10 +7247,10 @@ func (m *SignalConstraints) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SignalConstraints: wiretype end group for non-group") + return fmt.Errorf("proto: SignalFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SignalConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignalFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7021,10 +7279,77 @@ func (m *SignalConstraints) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Time == nil { + m.Time = &TimeFilter{} + } if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &EventContext{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, &DataFilter{}) + if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7272,7 +7597,7 @@ func (m *Stream) Unmarshal(dAtA []byte) error { } return nil } -func (m *TimeConstraints) Unmarshal(dAtA []byte) error { +func (m *TimeFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7295,10 +7620,10 @@ func (m *TimeConstraints) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TimeConstraints: wiretype end group for non-group") + return fmt.Errorf("proto: TimeFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TimeConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TimeFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -8065,164 +8390,166 @@ var ( ) func init() { - proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1/generated.proto", fileDescriptor_generated_3fbfa6ccbf9879ef) -} - -var fileDescriptor_generated_3fbfa6ccbf9879ef = []byte{ - // 2476 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x19, 0x4d, 0x6f, 0x1c, 0x49, - 0x35, 0x3d, 0x5f, 0x1e, 0xd7, 0x24, 0xb1, 0xb7, 0xd8, 0xc3, 0xc8, 0x62, 0xed, 0xa8, 0x57, 0xac, - 0x02, 0x4a, 0x7a, 0x36, 0x36, 0xa0, 0x80, 0x14, 0x88, 0xc7, 0x76, 0x12, 0x6f, 0x9c, 0xac, 0xf7, - 0x4d, 0x92, 0x15, 0x61, 0x25, 0x28, 0x77, 0x97, 0x67, 0x3a, 0xee, 0xe9, 0xee, 0xad, 0xaa, 0xf1, - 0x66, 0x24, 0xb4, 0x8a, 0xd0, 0x4a, 0x48, 0x68, 0xd1, 0xae, 0x90, 0x40, 0x1c, 0xf6, 0xc2, 0x81, - 0x13, 0x17, 0x4e, 0xfc, 0x00, 0x2e, 0xe4, 0xb8, 0x48, 0x1c, 0xf6, 0x82, 0x45, 0x8c, 0xc4, 0x8f, - 0xc8, 0x09, 0xd5, 0x47, 0x77, 0xb5, 0x67, 0x62, 0x36, 0xf6, 0xcc, 0xc2, 0xc5, 0x72, 0xbf, 0xf7, - 0xea, 0xbd, 0x57, 0xaf, 0xde, 0xf7, 0xa0, 0x5b, 0xdd, 0x50, 0xf4, 0x06, 0x3b, 0x9e, 0x9f, 0xf4,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a, - 0x08, 0x19, 0x37, 0x95, 0x23, 0xb9, 0xb1, 0x22, 0x63, 0xe4, 0xf9, 0xc1, 0x52, 0x5d, 0xaa, 0xa7, - 0x82, 0x47, 0x51, 0xe1, 0x37, 0x51, 0x35, 0xed, 0x11, 0x4e, 0x4d, 0x7a, 0xc9, 0x52, 0x60, 0x75, - 0x5b, 0x02, 0x9f, 0x1f, 0x2c, 0xcd, 0x4a, 0x7a, 0xf5, 0x01, 0x9a, 0x50, 0xe6, 0x19, 0x2e, 0x08, - 0x13, 0x34, 0x58, 0x15, 0x93, 0xe4, 0x99, 0x4e, 0xc6, 0x04, 0x2c, 0x3f, 0x4c, 0x64, 0xec, 0xf7, - 0xd3, 0x88, 0x6a, 0xf6, 0x33, 0x27, 0x66, 0x5f, 0xc8, 0x13, 0x39, 0x1b, 0x28, 0xf2, 0x94, 0x8e, - 0x98, 0x95, 0xe4, 0xfa, 0x51, 0x47, 0x1c, 0xad, 0xa7, 0x78, 0x88, 0x1a, 0x11, 0x11, 0x94, 0x0b, - 0x15, 0x25, 0xcd, 0xd9, 0xa9, 0x54, 0x52, 0x13, 0xd2, 0xed, 0x39, 0xa9, 0xe5, 0x96, 0x65, 0x0f, - 0x45, 0x59, 0xee, 0xef, 0x2b, 0xe8, 0x3c, 0x50, 0x5d, 0x05, 0x6e, 0x84, 0x91, 0xa0, 0x4c, 0x36, - 0x97, 0x29, 0xa3, 0xbb, 0xe1, 0x63, 0xe3, 0x51, 0xb9, 0x13, 0x6e, 0x2b, 0x28, 0x18, 0x2c, 0xfe, - 0x19, 0xaa, 0x45, 0x64, 0x87, 0x46, 0xbc, 0x59, 0x52, 0x39, 0xf0, 0xde, 0xe9, 0x15, 0x3e, 0xaa, - 0x81, 0xb7, 0xa5, 0xd8, 0xea, 0x0c, 0x98, 0x4b, 0xd7, 0x40, 0x30, 0x32, 0x65, 0x77, 0xd9, 0x20, - 0x71, 0x9c, 0x08, 0xd5, 0x2b, 0x71, 0xd5, 0x5d, 0x35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, 0x4a, 0xb8, 0x00, 0x85, 0x91, 0x14, 0x69, 0xc2, 0x84, 0xaa, 0x28, 0x55, 0x4b, 0xb1, 0x9d, - 0x30, 0x01, 0x0a, 0xa3, 0x28, 0x88, 0xe8, 0xa9, 0xfc, 0x5f, 0xe0, 0xb1, 0x4d, 0x44, 0x0f, 0x14, - 0x06, 0xbf, 0x8e, 0xaa, 0xef, 0x0f, 0x28, 0x1b, 0xaa, 0x7c, 0x5d, 0xf8, 0x95, 0xe7, 0x1d, 0x09, - 0x04, 0x8d, 0x93, 0x8a, 0xef, 0x32, 0xd2, 0xed, 0xd3, 0x58, 0x98, 0xed, 0x7a, 0xae, 0xf8, 0x0d, - 0x03, 0x87, 0x9c, 0xc2, 0xfd, 0x85, 0x83, 0xce, 0x1d, 0x49, 0xde, 0x27, 0x1c, 0xf8, 0xb3, 0x6b, - 0x95, 0x8e, 0xbd, 0xd6, 0x1b, 0xa8, 0xd6, 0xa7, 0xa2, 0x97, 0x04, 0xa3, 0xa3, 0xfe, 0x1d, 0x05, - 0x05, 0x83, 0x6d, 0x7b, 0x4f, 0x9f, 0x2d, 0x9e, 0xf9, 0xfc, 0xd9, 0xe2, 0x99, 0x2f, 0x9e, 0x2d, - 0x9e, 0x79, 0x72, 0xb8, 0xe8, 0x3c, 0x3d, 0x5c, 0x74, 0x3e, 0x3f, 0x5c, 0x74, 0xbe, 0x38, 0x5c, - 0x74, 0xfe, 0x79, 0xb8, 0xe8, 0x7c, 0xfa, 0xaf, 0xc5, 0x33, 0x0f, 0xeb, 0x99, 0x8b, 0xfc, 0x27, - 0x00, 0x00, 0xff, 0xff, 0x03, 0x59, 0xdb, 0x2c, 0x07, 0x24, 0x00, 0x00, + proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1/generated.proto", fileDescriptor_generated_122c2bb8f9413e3d) +} + +var fileDescriptor_generated_122c2bb8f9413e3d = []byte{ + // 2505 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdf, 0x6b, 0x1c, 0xc9, + 0xf1, 0xf7, 0xec, 0x2f, 0xad, 0x6a, 0x65, 0x5b, 0xd7, 0xdf, 0x7b, 0x58, 0xc4, 0xf7, 0x24, 0x33, + 0x47, 0x0e, 0x27, 0xd8, 0xbb, 0x67, 0x2b, 0x09, 0x4e, 0xc0, 0x89, 0xb5, 0x96, 0x6c, 0xcb, 0x96, + 0x6d, 0x5d, 0xaf, 0xed, 0x23, 0xce, 0x41, 0xd2, 0x9a, 0x6d, 0xed, 0x8e, 0x35, 0x3b, 0x33, 0xee, + 0xee, 0xd5, 0x79, 0x21, 0x1c, 0x17, 0x38, 0x08, 0x84, 0x0b, 0x39, 0x02, 0x09, 0x79, 0xb8, 0x97, + 0x10, 0xf2, 0x74, 0xef, 0xf9, 0x03, 0x02, 0x21, 0x7e, 0xbc, 0xbc, 0xdd, 0x4b, 0x44, 0xac, 0x40, + 0xfe, 0x08, 0x43, 0x20, 0xf4, 0xcf, 0x19, 0xed, 0x4a, 0x39, 0x4b, 0xbb, 0x97, 0xbc, 0x2c, 0x3b, + 0x55, 0xdd, 0x9f, 0xaa, 0xae, 0xae, 0xae, 0xaa, 0xae, 0x86, 0x5b, 0xdd, 0x50, 0xf4, 0x06, 0x5b, + 0x8d, 0x20, 0xe9, 0x37, 0x09, 0xeb, 0x26, 0x29, 0x4b, 0x9e, 0xa8, 0x3f, 0x17, 0xe9, 0x2e, 0x8d, + 0x05, 0x6f, 0xa6, 0x3b, 0xdd, 0x26, 0x49, 0x43, 0xde, 0xe4, 0x34, 0xe6, 0x09, 0x6b, 0xee, 0x5e, + 0x22, 0x51, 0xda, 0x23, 0x97, 0x9a, 0x5d, 0x1a, 0x53, 0x46, 0x04, 0xed, 0x34, 0x52, 0x96, 0x88, + 0x04, 0x5d, 0xc9, 0x90, 0x1a, 0x16, 0x49, 0xfd, 0xf9, 0x91, 0x46, 0x6a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 0x1f, 0x6c, + 0xcb, 0x71, 0x23, 0x16, 0x6e, 0x2b, 0x2a, 0x36, 0x5c, 0x19, 0x7a, 0x2a, 0x6d, 0xb5, 0xfb, 0xe8, + 0xc7, 0x50, 0x95, 0xd9, 0x54, 0xb5, 0x06, 0xf4, 0xe5, 0xe5, 0xed, 0x57, 0xcb, 0xbd, 0x3a, 0x6e, + 0xdf, 0xa5, 0x82, 0x64, 0xb7, 0xad, 0x8c, 0x86, 0x1d, 0x2a, 0xda, 0x86, 0x12, 0x4f, 0x69, 0x60, + 0x22, 0xd4, 0x24, 0x0d, 0x43, 0xf5, 0xdd, 0x4e, 0x69, 0x90, 0xbb, 0xfb, 0xa4, 0x34, 0xc0, 0x0a, + 0x1f, 0xc5, 0xf2, 0x1a, 0x21, 0xeb, 0x7a, 0x73, 0xe6, 0x6e, 0x4c, 0x2c, 0x49, 0xa1, 0xe5, 0x2f, + 0x13, 0xf2, 0x1b, 0x1b, 0x29, 0xfe, 0x5f, 0x3d, 0x00, 0x3d, 0x70, 0x23, 0xe4, 0x02, 0xbd, 0x37, + 0x66, 0xc8, 0xc6, 0xab, 0x19, 0x52, 0xce, 0x56, 0x66, 0x74, 0xde, 0x6b, 0x29, 0x39, 0x23, 0x52, + 0x28, 0x87, 0x82, 0xf6, 0x6d, 0xcd, 0x78, 0x6d, 0xd2, 0xb5, 0x65, 0xb7, 0xc0, 0x75, 0x09, 0x8b, + 0x35, 0xba, 0xff, 0xab, 0xa2, 0x5d, 0x93, 0x34, 0x2c, 0xda, 0x81, 0x19, 0xae, 0x32, 0x13, 0xaf, + 0x7b, 0x13, 0xcb, 0x55, 0x40, 0x59, 0x35, 0xaf, 0xbf, 0x39, 0xb6, 0x12, 0x50, 0x02, 0x55, 0xc1, + 0xc2, 0x6e, 0x97, 0x32, 0xbb, 0xca, 0x09, 0x9a, 0x71, 0x0f, 0x34, 0x52, 0x66, 0x53, 0x43, 0xe0, + 0xd8, 0x09, 0x41, 0x1f, 0x00, 0x50,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, 0xf9, 0xa8, 0xff, 0x26, 0x94, + 0x9f, 0x0e, 0x28, 0x1b, 0xaa, 0xec, 0x92, 0x7b, 0x62, 0x7a, 0x47, 0x12, 0xb1, 0xe6, 0x49, 0xc5, + 0xb7, 0x19, 0xe9, 0xf6, 0x69, 0x2c, 0x4c, 0x6b, 0xdf, 0x29, 0x7e, 0xc3, 0xd0, 0xb1, 0x1b, 0xe1, + 0xff, 0xcc, 0x83, 0xd3, 0x07, 0x52, 0xcd, 0x31, 0xbb, 0x0d, 0x76, 0x59, 0x85, 0x23, 0x97, 0xf5, + 0x16, 0x54, 0xfa, 0x54, 0xf4, 0x92, 0xce, 0x68, 0x9f, 0xe1, 0xae, 0xa2, 0x62, 0xc3, 0x6d, 0x35, + 0x9e, 0xbf, 0x58, 0x3c, 0xf5, 0xf9, 0x8b, 0xc5, 0x53, 0x5f, 0xbc, 0x58, 0x3c, 0xf5, 0xe1, 0xfe, + 0xa2, 0xf7, 0x7c, 0x7f, 0xd1, 0xfb, 0x7c, 0x7f, 0xd1, 0xfb, 0x62, 0x7f, 0xd1, 0xfb, 0xfb, 0xfe, + 0xa2, 0xf7, 0xc9, 0x3f, 0x16, 0x4f, 0x3d, 0xae, 0x5a, 0x17, 0xf9, 0x77, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x45, 0xed, 0x09, 0x5c, 0xdf, 0x24, 0x00, 0x00, } diff --git a/pkg/apis/sensor/v1alpha1/generated.proto b/pkg/apis/sensor/v1alpha1/generated.proto index da19d878dc..31f43de61e 100644 --- a/pkg/apis/sensor/v1alpha1/generated.proto +++ b/pkg/apis/sensor/v1alpha1/generated.proto @@ -61,6 +61,26 @@ message CalendarSignal { repeated string recurrence = 3; } +// DataFilter describes constraints and filters for event data +// Regular Expressions are purposefully not a feature as they are overkill for our uses here +// See Rob Pike's Post: https://commandcenter.blogspot.com/2011/08/regular-expressions-in-lexing-and.html +message DataFilter { + // Path is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. + // To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\'. + // See https://github.com/tidwall/gjson#path-syntax for more information on how to use this. + optional string path = 1; + + // Type contains the JSON type of the data + optional string type = 2; + + // Value is the expected string value for this key + // Booleans are pased using strconv.ParseBool() + // Numbers are parsed using as float64 using strconv.ParseFloat() + // Strings are taken as is + // Nils this value is ignored + optional string value = 3; +} + // EscalationPolicy describes the policy for escalating sensors in an Error state. // NOTE: this functionality is currently experimental, but we believe serves as an // important future enhancement around handling lifecycle error conditions of a sensor. @@ -338,14 +358,20 @@ message Signal { // Webhook defines a HTTP notification dependency optional WebhookSignal webhook = 7; - // Constraints and rules governing tolerations of success and overrides - optional SignalConstraints constraints = 8; + // Filters and rules governing tolerations of success and constraints on the context and data of an event + optional SignalFilter filters = 8; } -// SignalConstraints defines constraints for a dependent signal. -message SignalConstraints { - // Time constraints on the signal - optional TimeConstraints time = 1; +// SignalFilter defines filters and constraints for a signal. +message SignalFilter { + // Time filter on the signal + optional TimeFilter time = 1; + + // Context filter constraints + optional EventContext context = 2; + + // Data filter constraints + repeated DataFilter data = 3; } // Stream describes a queue stream resource @@ -360,8 +386,8 @@ message Stream { map attributes = 3; } -// TimeConstraints describes constraints in time -message TimeConstraints { +// TimeFilter describes a window in time +message TimeFilter { optional k8s.io.apimachinery.pkg.apis.meta.v1.Time start = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.Time stop = 2; diff --git a/pkg/apis/sensor/v1alpha1/types.go b/pkg/apis/sensor/v1alpha1/types.go index 2125af616d..ac780f8981 100644 --- a/pkg/apis/sensor/v1alpha1/types.go +++ b/pkg/apis/sensor/v1alpha1/types.go @@ -120,8 +120,8 @@ type Signal struct { // Webhook defines a HTTP notification dependency Webhook *WebhookSignal `json:"webhook,omitempty" protobuf:"bytes,7,opt,name=webhook"` - // Constraints and rules governing tolerations of success and overrides - Constraints SignalConstraints `json:"constraints,omitempty" protobuf:"bytes,8,opt,name=constraints"` + // Filters and rules governing tolerations of success and constraints on the context and data of an event + Filters SignalFilter `json:"filters,omitempty" protobuf:"bytes,8,opt,name=filters"` } // ArtifactSignal describes an external object dependency @@ -165,18 +165,54 @@ type ResourceSignal struct { Filter *ResourceFilter `json:"filter,omitempty" protobuf:"bytes,2,opt,name=filter"` } -// SignalConstraints defines constraints for a dependent signal. -type SignalConstraints struct { - // Time constraints on the signal - Time TimeConstraints `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"` +// SignalFilter defines filters and constraints for a signal. +type SignalFilter struct { + // Time filter on the signal + Time *TimeFilter `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"` + + // Context filter constraints + Context *EventContext `json:"context,omitempty" protobuf:"bytes,2,opt,name=context"` + + // Data filter constraints + Data []*DataFilter `json:"data,omitempty" protobuf:"bytes,3,rep,name=data"` } -// TimeConstraints describes constraints in time -type TimeConstraints struct { +// TimeFilter describes a window in time +type TimeFilter struct { Start v1.Time `json:"start" protobuf:"bytes,1,opt,name=start"` Stop v1.Time `json:"stop" protobuf:"bytes,2,opt,name=stop"` } +// JSONType contains the supported JSON types for data filtering +type JSONType string + +// the various supported JSONTypes +const ( + JSONTypeBool JSONType = "bool" + JSONTypeNumber JSONType = "number" + JSONTypeString JSONType = "string" +) + +// DataFilter describes constraints and filters for event data +// Regular Expressions are purposefully not a feature as they are overkill for our uses here +// See Rob Pike's Post: https://commandcenter.blogspot.com/2011/08/regular-expressions-in-lexing-and.html +type DataFilter struct { + // Path is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. + // To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\'. + // See https://github.com/tidwall/gjson#path-syntax for more information on how to use this. + Path string `json:"path" protobuf:"bytes,1,opt,name=path"` + + // Type contains the JSON type of the data + Type JSONType `json:"type" protobuf:"bytes,2,opt,name=type"` + + // Value is the expected string value for this key + // Booleans are pased using strconv.ParseBool() + // Numbers are parsed using as float64 using strconv.ParseFloat() + // Strings are taken as is + // Nils this value is ignored + Value string `json:"value" protobuf:"bytes,3,opt,name=value"` +} + // Trigger is an action taken, output produced, an event created, a message sent type Trigger struct { // Name is a unique name of the action to take diff --git a/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go index 52ec71179c..09005ea990 100644 --- a/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go @@ -83,6 +83,22 @@ func (in *CalendarSignal) DeepCopy() *CalendarSignal { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFilter) DeepCopyInto(out *DataFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFilter. +func (in *DataFilter) DeepCopy() *DataFilter { + if in == nil { + return nil + } + out := new(DataFilter) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EscalationPolicy) DeepCopyInto(out *EscalationPolicy) { *out = *in @@ -528,7 +544,7 @@ func (in *Signal) DeepCopyInto(out *Signal) { *out = new(WebhookSignal) **out = **in } - in.Constraints.DeepCopyInto(&out.Constraints) + in.Filters.DeepCopyInto(&out.Filters) return } @@ -543,18 +559,38 @@ func (in *Signal) DeepCopy() *Signal { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SignalConstraints) DeepCopyInto(out *SignalConstraints) { +func (in *SignalFilter) DeepCopyInto(out *SignalFilter) { *out = *in - in.Time.DeepCopyInto(&out.Time) + if in.Time != nil { + in, out := &in.Time, &out.Time + *out = new(TimeFilter) + (*in).DeepCopyInto(*out) + } + if in.Context != nil { + in, out := &in.Context, &out.Context + *out = new(EventContext) + (*in).DeepCopyInto(*out) + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make([]*DataFilter, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DataFilter) + **out = **in + } + } + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SignalConstraints. -func (in *SignalConstraints) DeepCopy() *SignalConstraints { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SignalFilter. +func (in *SignalFilter) DeepCopy() *SignalFilter { if in == nil { return nil } - out := new(SignalConstraints) + out := new(SignalFilter) in.DeepCopyInto(out) return out } @@ -583,19 +619,19 @@ func (in *Stream) DeepCopy() *Stream { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TimeConstraints) DeepCopyInto(out *TimeConstraints) { +func (in *TimeFilter) DeepCopyInto(out *TimeFilter) { *out = *in in.Start.DeepCopyInto(&out.Start) in.Stop.DeepCopyInto(&out.Stop) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeConstraints. -func (in *TimeConstraints) DeepCopy() *TimeConstraints { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeFilter. +func (in *TimeFilter) DeepCopy() *TimeFilter { if in == nil { return nil } - out := new(TimeConstraints) + out := new(TimeFilter) in.DeepCopyInto(out) return out } diff --git a/signals/artifact/s3.go b/signals/artifact/s3.go index 9709f9c4fc..ad60169db6 100644 --- a/signals/artifact/s3.go +++ b/signals/artifact/s3.go @@ -165,10 +165,10 @@ func extractAndCreateStreamSignal(artifactSignal *v1alpha1.Signal) (*v1alpha1.Si return nil, errors.New("undefined artifact signal") } return &v1alpha1.Signal{ - Name: fmt.Sprintf("%s-artifact-stream", artifactSignal.Name), - Deadline: artifactSignal.Deadline, - Stream: &artifactSignal.Artifact.Target, - Constraints: artifactSignal.Constraints, + Name: fmt.Sprintf("%s-artifact-stream", artifactSignal.Name), + Deadline: artifactSignal.Deadline, + Stream: &artifactSignal.Artifact.Target, + Filters: artifactSignal.Filters, }, nil }