diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 65f726c8d9..3a31d383ad 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -19,3 +19,4 @@ | Shopify/sarama | MIT | | stretchr/testify | https://github.com/stretchr/testify/blob/master/LICENSE | | tidwall/gjson | MIT | +| tidwall/sjson | MIT | \ No newline at end of file diff --git a/Gopkg.lock b/Gopkg.lock index 0da2e2ac01..db5377a949 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -175,6 +175,7 @@ "ptypes", "ptypes/any", "ptypes/duration", + "ptypes/empty", "ptypes/timestamp" ] revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" @@ -586,6 +587,12 @@ packages = ["."] revision = "1731857f09b1f38450e2c12409748407822dc6be" +[[projects]] + name = "github.com/tidwall/sjson" + packages = ["."] + revision = "6a22caf2fd45d5e2119bfc3717e984f15a7eb7ee" + version = "v1.0.0" + [[projects]] name = "go.uber.org/atomic" packages = ["."] @@ -975,6 +982,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "52356c07a7011f2d35e4e3ec2a64a04043afa82ba82df4ebc3617b40ff1543f8" + inputs-digest = "8692f9aee4010e6206dd5691045029e82652f0b95faa8313ddd6aba1211fc7cd" solver-name = "gps-cdcl" solver-version = 1 diff --git a/controller/operator_test.go b/controller/operator_test.go index 116b842cd6..c320bf00f5 100644 --- a/controller/operator_test.go +++ b/controller/operator_test.go @@ -71,7 +71,7 @@ var sampleSensor = v1alpha1.Sensor{ Version: "v1alpha1", Kind: "workflow", }, - ArtifactLocation: &v1alpha1.ArtifactLocation{ + Source: v1alpha1.ArtifactLocation{ S3: &v1alpha1.S3Artifact{}, }, Labels: map[string]string{"test-label": "test-value"}, diff --git a/controller/signal-filter.go b/controller/signal-filter.go index 0e00a761b0..79e412fb98 100644 --- a/controller/signal-filter.go +++ b/controller/signal-filter.go @@ -1,14 +1,27 @@ +/* +Copyright 2018 BlackRock, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + 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" ) @@ -34,6 +47,12 @@ func filterTime(timeFilter *v1alpha1.TimeFilter, eventTime *metav1.Time) bool { // 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 { + if expected == nil { + return true + } + if actual == nil { + return false + } res := true if expected.EventType != "" { res = res && expected.EventType == actual.EventType @@ -57,14 +76,6 @@ func filterContext(expected *v1alpha1.EventContext, actual *v1alpha1.EventContex 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 @@ -77,38 +88,12 @@ func filterData(dataFilters []*v1alpha1.DataFilter, event *v1alpha1.Event) (bool 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) + js, err := renderEventDataAsJSON(event) if err != nil { return false, err } for _, f := range dataFilters { - res := gjson.Get(string(json), f.Path) + res := gjson.GetBytes(js, f.Path) if !res.Exists() { return false, nil } diff --git a/controller/signal-filter_test.go b/controller/signal-filter_test.go index 7807b2b4b9..de58524fda 100644 --- a/controller/signal-filter_test.go +++ b/controller/signal-filter_test.go @@ -1,3 +1,18 @@ +/* +Copyright 2018 BlackRock, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package controller import ( @@ -113,6 +128,26 @@ func Test_filterContext(t *testing.T) { args args want bool }{ + { + name: "nil expected", + args: args{ + expected: nil, + actual: &v1alpha1.EventContext{ + EventType: "argo.io.event", + }, + }, + want: true, + }, + { + name: "nil actual, non-nil expected", + args: args{ + expected: &v1alpha1.EventContext{ + EventType: "argo.io.event", + }, + actual: nil, + }, + want: false, + }, { name: "eventType", args: args{expected: &v1alpha1.EventContext{ diff --git a/controller/trigger-params.go b/controller/trigger-params.go new file mode 100644 index 0000000000..f5f9236c82 --- /dev/null +++ b/controller/trigger-params.go @@ -0,0 +1,67 @@ +/* +Copyright 2018 BlackRock, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package controller + +import ( + "fmt" + + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" + "github.com/tidwall/gjson" + "github.com/tidwall/sjson" +) + +// apply the params to the resource json object +func applyParams(jsonObj []byte, params []v1alpha1.ResourceParameter, events map[string]v1alpha1.Event) ([]byte, error) { + tmp := make([]byte, len(jsonObj)) + for _, param := range params { + // let's grab the param value + v, err := resolveParamValue(param.Src, events) + if err != nil { + return nil, err + } + + // now let's set the value + tmp, err = sjson.SetBytes(jsonObj, param.Dest, v) + if err != nil { + return nil, err + } + jsonObj = tmp + } + return jsonObj, nil +} + +// helper method to resolve the parameter's value from the src +// returns an error if the Path is invalid/not found and the default value is nil OR if the signal event doesn't exist and default value is nil +func resolveParamValue(src *v1alpha1.ResourceParameterSource, events map[string]v1alpha1.Event) (string, error) { + if e, ok := events[src.Signal]; ok { + js, err := renderEventDataAsJSON(&e) + if err != nil { + if src.Value != nil { + return *src.Value, nil + } + return "", err + } + res := gjson.GetBytes(js, src.Path) + if res.Exists() { + return res.String(), nil + } + } + if src.Value != nil { + return *src.Value, nil + } + return "", fmt.Errorf("unable to resolve '%s' parameter value. verify the path: '%s' is valid and/or set a default value for this param", src.Signal, src.Path) +} diff --git a/controller/trigger-params_test.go b/controller/trigger-params_test.go new file mode 100644 index 0000000000..d24d6e342d --- /dev/null +++ b/controller/trigger-params_test.go @@ -0,0 +1,187 @@ +/* +Copyright 2018 BlackRock, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package controller + +import ( + "reflect" + "testing" + + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" +) + +func Test_applyParams(t *testing.T) { + defaultValue := "default" + events := map[string]v1alpha1.Event{ + "simpleJSON": v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: MediaTypeJSON, + }, + Data: []byte(`{"name":{"first":"matt","last":"magaldi"},"age":24}`), + }, + "invalidJSON": v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: MediaTypeJSON, + }, + Data: []byte(`apiVersion: v1alpha1`), + }, + } + type args struct { + jsonObj []byte + params []v1alpha1.ResourceParameter + events map[string]v1alpha1.Event + } + tests := []struct { + name string + args args + want []byte + wantErr bool + }{ + { + name: "no event and missing default -> error", + args: args{ + jsonObj: []byte(""), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "missing", + }, + }, + }, + events: events, + }, + want: nil, + wantErr: true, + }, + { + name: "no event with default -> success", + args: args{ + jsonObj: []byte(""), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "missing", + Value: &defaultValue, + }, + Dest: "x", + }, + }, + events: events, + }, + want: []byte(`{"x":"default"}`), + wantErr: false, + }, + { + name: "no event with default, but missing dest -> error", + args: args{ + jsonObj: []byte(""), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "missing", + Value: &defaultValue, + }, + }, + }, + events: events, + }, + want: nil, + wantErr: true, + }, + { + name: "simpleJSON (new field) -> success", + args: args{ + jsonObj: []byte(``), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "simpleJSON", + Path: "name.last", + }, + Dest: "x", + }, + }, + events: events, + }, + want: []byte(`{"x":"magaldi"}`), + wantErr: false, + }, + { + name: "simpleJSON (updated field) -> success", + args: args{ + jsonObj: []byte(`{"x":"before"}`), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "simpleJSON", + Path: "name.last", + }, + Dest: "x", + }, + }, + events: events, + }, + want: []byte(`{"x":"magaldi"}`), + wantErr: false, + }, + { + name: "invalidJSON, no default -> error", + args: args{ + jsonObj: []byte(``), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "invalidJSON", + }, + Dest: "x", + }, + }, + events: events, + }, + want: nil, + wantErr: true, + }, + { + name: "invalidJSON, default set -> success", + args: args{ + jsonObj: []byte(``), + params: []v1alpha1.ResourceParameter{ + v1alpha1.ResourceParameter{ + Src: &v1alpha1.ResourceParameterSource{ + Signal: "invalidJSON", + Value: &defaultValue, + }, + Dest: "x", + }, + }, + events: events, + }, + want: []byte(`{"x":"default"}`), + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := applyParams(tt.args.jsonObj, tt.args.params, tt.args.events) + if (err != nil) != tt.wantErr { + t.Errorf("applyParams() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("applyParams() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/controller/trigger.go b/controller/trigger.go index 862ab3b98a..c95d462f94 100644 --- a/controller/trigger.go +++ b/controller/trigger.go @@ -63,11 +63,11 @@ func (soc *sOperationCtx) executeTrigger(trigger v1alpha1.Trigger) error { } } if trigger.Resource != nil { - creds, err := store.GetCredentials(soc.controller.kubeClientset, soc.controller.Config.Namespace, trigger.Resource.ArtifactLocation) + creds, err := store.GetCredentials(soc.controller.kubeClientset, soc.controller.Config.Namespace, &trigger.Resource.Source) if err != nil { return err } - reader, err := store.GetArtifactReader(trigger.Resource.ArtifactLocation, creds) + reader, err := store.GetArtifactReader(&trigger.Resource.Source, creds) if err != nil { return err } @@ -115,6 +115,27 @@ func (soc *sOperationCtx) createResourceObject(resource *v1alpha1.ResourceObject obj.SetLabels(resource.Labels) } + // passing parameters to the resource object requires 4 steps + // 1. marshaling the obj to JSON + // 2. extract the appropriate signal events based on the resource params + // 3. apply the params to the JSON object + // 4. unmarshal the obj from the updated JSON + if len(resource.Parameters) > 0 { + jObj, err := obj.MarshalJSON() + if err != nil { + return err + } + events := soc.extractSignalEvents(resource.Parameters) + jUpdatedObj, err := applyParams(jObj, resource.Parameters, events) + if err != nil { + return err + } + err = obj.UnmarshalJSON(jUpdatedObj) + if err != nil { + return err + } + } + gvk := obj.GroupVersionKind() clientPool := dynamic.NewDynamicClientPool(soc.controller.kubeConfig) disco, err := discovery.NewDiscoveryClientForConfig(soc.controller.kubeConfig) @@ -149,3 +170,24 @@ func (soc *sOperationCtx) createResourceObject(resource *v1alpha1.ResourceObject soc.log.Info("%s '%s' already exists", liveObj.GetKind(), liveObj.GetName()) return nil } + +// helper method to extract the events from the signals associated with the resource params +// returns a map of the events keyed by the signal name +func (soc *sOperationCtx) extractSignalEvents(params []v1alpha1.ResourceParameter) map[string]v1alpha1.Event { + events := make(map[string]v1alpha1.Event) + for _, param := range params { + if param.Src != nil { + node := soc.getNodeByName(param.Src.Signal) + if node == nil { + soc.log.Warnf("WARNING: signal node for '%s' does not exist, cannot apply parameter '%s'", param.Src.Signal, param.Dest) + continue + } + if node.LatestEvent == nil { + soc.log.Warnf("WARNING: signal node for '%s' contains nil Event. cannot apply parameter '%s'", param.Src.Signal, param.Dest) + continue + } + events[param.Src.Signal] = node.LatestEvent.Event + } + } + return events +} diff --git a/controller/trigger_test.go b/controller/trigger_test.go index a6d9e59146..86fae0e0f7 100644 --- a/controller/trigger_test.go +++ b/controller/trigger_test.go @@ -38,7 +38,7 @@ var sampleTrigger = v1alpha1.Trigger{ Version: "v1alpha1", Kind: "workflow", }, - ArtifactLocation: &v1alpha1.ArtifactLocation{ + Source: v1alpha1.ArtifactLocation{ S3: &v1alpha1.S3Artifact{}, }, Labels: map[string]string{"test-label": "test-value"}, diff --git a/controller/utils.go b/controller/utils.go index fc9040eb93..4256fcaaa7 100644 --- a/controller/utils.go +++ b/controller/utils.go @@ -17,7 +17,20 @@ limitations under the License. package controller import ( + "encoding/json" + "fmt" + "strings" + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" + "github.com/ghodss/yaml" +) + +// various supported media types +// TODO: add support for XML +const ( + MediaTypeJSON string = "application/json" + //MediaTypeXML string = "application/xml" + MediaTypeYAML string = "application/yaml" ) // getNodeByName returns a copy of the node from this sensor for the nodename @@ -39,3 +52,34 @@ func contains(s []string, e string) bool { } return false } + +// util method to render an event's data as a JSON []byte +// json is a subset of yaml so this should work... +func renderEventDataAsJSON(e *v1alpha1.Event) ([]byte, error) { + if e == nil { + return nil, fmt.Errorf("event is nil") + } + raw := e.Data + // contentType is formatted as: '{type}; charset="xxx"' + contents := strings.Split(e.Context.ContentType, ";") + switch contents[0] { + case MediaTypeJSON: + if isJSON(raw) { + return raw, nil + } + return nil, fmt.Errorf("event data is not valid JSON") + case MediaTypeYAML: + data, err := yaml.YAMLToJSON(raw) + if err != nil { + return nil, fmt.Errorf("failed converting yaml event data to JSON: %s", err) + } + return data, nil + default: + return nil, fmt.Errorf("unsupported event content type: %s", e.Context.ContentType) + } +} + +func isJSON(b []byte) bool { + var js json.RawMessage + return json.Unmarshal(b, &js) == nil +} diff --git a/controller/utils_test.go b/controller/utils_test.go new file mode 100644 index 0000000000..85a2667bde --- /dev/null +++ b/controller/utils_test.go @@ -0,0 +1,105 @@ +/* +Copyright 2018 BlackRock, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package controller + +import ( + "reflect" + "testing" + + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" +) + +// this test is meant to cover the missing cases for those not covered in signal-filter_test.go and trigger-params_test.go +func Test_renderEventDataAsJSON(t *testing.T) { + type args struct { + e *v1alpha1.Event + } + tests := []struct { + name string + args args + want []byte + wantErr bool + }{ + { + name: "nil event", + args: args{e: nil}, + want: nil, + wantErr: true, + }, + { + name: "missing content type", + args: args{e: &v1alpha1.Event{}}, + want: nil, + wantErr: true, + }, + { + name: "valid yaml content", + args: args{e: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: MediaTypeYAML, + }, + Data: []byte(`apiVersion: v1alpha1`), + }}, + want: []byte(`{"apiVersion":"v1alpha1"}`), + wantErr: false, + }, + { + name: "json content marked as yaml", + args: args{e: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: MediaTypeYAML, + }, + Data: []byte(`{"apiVersion":5}`), + }}, + want: []byte(`{"apiVersion":5}`), + wantErr: false, + }, + { + name: "invalid json content", + args: args{e: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: MediaTypeJSON, + }, + Data: []byte(`{5:"numberkey"}`), + }}, + want: nil, + wantErr: true, + }, + { + name: "invalid yaml content", + args: args{e: &v1alpha1.Event{ + Context: v1alpha1.EventContext{ + ContentType: MediaTypeYAML, + }, + Data: []byte(`%\x786`), + }}, + want: nil, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := renderEventDataAsJSON(tt.args.e) + if (err != nil) != tt.wantErr { + t.Errorf("renderEventDataAsJSON() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("renderEventDataAsJSON() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/docs/quickstart.md b/docs/quickstart.md index df627a991c..98e11b34f4 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -56,7 +56,7 @@ Follow instructions from https://github.com/argoproj/argo/blob/master/demo.md ## 9. Create a webhook sensor ``` -$ k apply -f examples/webhook-sensor.yaml +$ k apply -f examples/webhook-with-resource-param.yaml ``` Verify that the sensor was created. @@ -67,20 +67,29 @@ $ kubectl get sensors -n default Verify that the signal microservice is listening for signals and the sensor is active. ``` $ kubectl logs signal-webhook-xxx -f -$ kubectl get sensor webhook-example -n default -o yaml +$ kubectl get sensor webhook-with-resource-param -n default -o yaml ``` ## 10. Trigger the webhook & corresponding Argo workflow -Trigger the webhook using [Postman](https://www.getpostman.com/) or curl by send a POST request to the webhook service. +Trigger the webhook via sending a POST with a JSON with a "message" key and value. +Ensure that you set the header "Content-Type" to "application/json" or this event will be ignored. +``` +$ curl -d '{"message":"this is my first webhook"}' -H "Content-Type: application/json" -X POST $(minikube service --url webhook) +``` Verify that the Argo workflow was run when the trigger was executed. ``` $ argo list ``` -Verify that the sensor was updated correctly +Verify that the sensor was updated correctly and moved to a "Complete" phase +``` +$ kubectl get sensor webhook-with-resource-param -n default -o yaml +``` + +Check the logs of the Argo workflow pod for the message you posted. ``` -$ kubectl get sensor webhook-example -n default -o yaml +$ k logs arguments-via-webhook-event main ``` Check the logs of the sensor-controller pod or the associated signal microservice if there are problems. \ No newline at end of file diff --git a/examples/calendar-sensor.yaml b/examples/calendar-sensor.yaml index 522ebce102..4a052cd617 100644 --- a/examples/calendar-sensor.yaml +++ b/examples/calendar-sensor.yaml @@ -16,7 +16,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: s3: bucket: workflows key: hello-world.yaml diff --git a/examples/context-filter-webhook.yaml b/examples/context-filter-webhook.yaml index 37cb53b11d..55945f9639 100644 --- a/examples/context-filter-webhook.yaml +++ b/examples/context-filter-webhook.yaml @@ -9,6 +9,7 @@ spec: - name: webhook webhook: endpoint: /app + port: 7070 method: POST filters: context: @@ -21,7 +22,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: s3: bucket: workflows key: hello-world.yaml diff --git a/examples/data-filter-webhook.yaml b/examples/data-filter-webhook.yaml index 6f0690a466..ce136b6219 100644 --- a/examples/data-filter-webhook.yaml +++ b/examples/data-filter-webhook.yaml @@ -9,6 +9,7 @@ spec: - name: webhook webhook: endpoint: /app + port: 7070 method: POST filters: data: @@ -21,7 +22,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: s3: bucket: workflows key: hello-world.yaml diff --git a/examples/inline-sensor.yaml b/examples/inline-sensor.yaml index a3ff8040f7..606bc3736b 100644 --- a/examples/inline-sensor.yaml +++ b/examples/inline-sensor.yaml @@ -16,7 +16,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: inline: | apiVersion: argoproj.io/v1alpha1 kind: Workflow diff --git a/examples/multi-trigger-sensor.yaml b/examples/multi-trigger-sensor.yaml index a002e9dfe4..dd6fe81941 100644 --- a/examples/multi-trigger-sensor.yaml +++ b/examples/multi-trigger-sensor.yaml @@ -17,7 +17,7 @@ spec: resource: version: v1 kind: Pod - artifactLocation: + source: s3: bucket: workflows key: hello-world.yaml diff --git a/examples/resource-sensor.yaml b/examples/resource-sensor.yaml index 688863dece..70e9c51078 100644 --- a/examples/resource-sensor.yaml +++ b/examples/resource-sensor.yaml @@ -23,7 +23,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: s3: bucket: workflows key: hello-world.yaml diff --git a/examples/time-filter-webhook.yaml b/examples/time-filter-webhook.yaml index 9a5623ca21..908fd0a4f1 100644 --- a/examples/time-filter-webhook.yaml +++ b/examples/time-filter-webhook.yaml @@ -20,7 +20,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: s3: bucket: workflows key: hello-world.yaml diff --git a/examples/webhook-sensor.yaml b/examples/webhook-sensor.yaml index 71a8edfc32..10608f31d2 100644 --- a/examples/webhook-sensor.yaml +++ b/examples/webhook-sensor.yaml @@ -9,6 +9,7 @@ spec: - name: webhook webhook: endpoint: /app + port: 7070 method: POST triggers: - name: hello-world-workflow-trigger @@ -17,7 +18,7 @@ spec: group: argoproj.io version: v1alpha1 kind: Workflow - artifactLocation: + source: inline: | apiVersion: argoproj.io/v1alpha1 kind: Workflow diff --git a/examples/webhook-with-resource-param.yaml b/examples/webhook-with-resource-param.yaml new file mode 100644 index 0000000000..5dc74d9687 --- /dev/null +++ b/examples/webhook-with-resource-param.yaml @@ -0,0 +1,49 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Sensor +metadata: + name: webhook-with-resource-param + labels: + sensors.argoproj.io/controller-instanceid: axis +spec: + signals: + - name: webhook + webhook: + endpoint: /hello + port: 7070 + method: POST + triggers: + - name: argo-workflow + resource: + namespace: default + group: argoproj.io + version: v1alpha1 + kind: Workflow + # The parameters from the workflow are overridden by the webhook's message + parameters: + - src: + signal: webhook + path: message + value: hello default + dest: spec.arguments.parameters.0.value + source: + inline: | + apiVersion: argoproj.io/v1alpha1 + kind: Workflow + metadata: + name: arguments-via-webhook-event + spec: + entrypoint: whalesay + arguments: + parameters: + - name: message + # this is the value that should be overridden + value: hello world + templates: + - name: whalesay + inputs: + parameters: + - name: message + container: + image: docker/whalesay:latest + command: [cowsay] + args: ["{{inputs.parameters.message}}"] diff --git a/pkg/apis/sensor/v1alpha1/generated.pb.go b/pkg/apis/sensor/v1alpha1/generated.pb.go index 69a9752b42..37fbfb37e8 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_122c2bb8f9413e3d, []int{0} + return fileDescriptor_generated_1921ec7d297a9a4b, []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_122c2bb8f9413e3d, []int{1} + return fileDescriptor_generated_1921ec7d297a9a4b, []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_122c2bb8f9413e3d, []int{2} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{2} } func (m *CalendarSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -128,7 +128,7 @@ 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} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{3} } func (m *DataFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,7 +156,7 @@ var xxx_messageInfo_DataFilter proto.InternalMessageInfo func (m *EscalationPolicy) Reset() { *m = EscalationPolicy{} } func (*EscalationPolicy) ProtoMessage() {} func (*EscalationPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{4} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{4} } func (m *EscalationPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -184,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_122c2bb8f9413e3d, []int{5} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{5} } func (m *Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,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_122c2bb8f9413e3d, []int{6} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{6} } func (m *EventContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,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_122c2bb8f9413e3d, []int{7} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{7} } func (m *EventWrapper) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -268,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_122c2bb8f9413e3d, []int{8} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{8} } func (m *GroupVersionKind) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -296,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_122c2bb8f9413e3d, []int{9} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{9} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -324,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_122c2bb8f9413e3d, []int{10} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{10} } func (m *NodeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -352,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_122c2bb8f9413e3d, []int{11} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{11} } func (m *ResourceFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -380,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_122c2bb8f9413e3d, []int{12} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{12} } func (m *ResourceObject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,10 +405,66 @@ func (m *ResourceObject) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceObject proto.InternalMessageInfo +func (m *ResourceParameter) Reset() { *m = ResourceParameter{} } +func (*ResourceParameter) ProtoMessage() {} +func (*ResourceParameter) Descriptor() ([]byte, []int) { + return fileDescriptor_generated_1921ec7d297a9a4b, []int{13} +} +func (m *ResourceParameter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceParameter) 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 *ResourceParameter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceParameter.Merge(dst, src) +} +func (m *ResourceParameter) XXX_Size() int { + return m.Size() +} +func (m *ResourceParameter) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceParameter.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceParameter proto.InternalMessageInfo + +func (m *ResourceParameterSource) Reset() { *m = ResourceParameterSource{} } +func (*ResourceParameterSource) ProtoMessage() {} +func (*ResourceParameterSource) Descriptor() ([]byte, []int) { + return fileDescriptor_generated_1921ec7d297a9a4b, []int{14} +} +func (m *ResourceParameterSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceParameterSource) 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 *ResourceParameterSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceParameterSource.Merge(dst, src) +} +func (m *ResourceParameterSource) XXX_Size() int { + return m.Size() +} +func (m *ResourceParameterSource) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceParameterSource.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceParameterSource proto.InternalMessageInfo + func (m *ResourceSignal) Reset() { *m = ResourceSignal{} } func (*ResourceSignal) ProtoMessage() {} func (*ResourceSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{13} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{15} } func (m *ResourceSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,7 +492,7 @@ var xxx_messageInfo_ResourceSignal proto.InternalMessageInfo func (m *RetryStrategy) Reset() { *m = RetryStrategy{} } func (*RetryStrategy) ProtoMessage() {} func (*RetryStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{14} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{16} } func (m *RetryStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +520,7 @@ var xxx_messageInfo_RetryStrategy proto.InternalMessageInfo func (m *S3Artifact) Reset() { *m = S3Artifact{} } func (*S3Artifact) ProtoMessage() {} func (*S3Artifact) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{15} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{17} } func (m *S3Artifact) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -492,7 +548,7 @@ var xxx_messageInfo_S3Artifact proto.InternalMessageInfo func (m *S3Bucket) Reset() { *m = S3Bucket{} } func (*S3Bucket) ProtoMessage() {} func (*S3Bucket) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{16} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{18} } func (m *S3Bucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -520,7 +576,7 @@ var xxx_messageInfo_S3Bucket proto.InternalMessageInfo func (m *S3Filter) Reset() { *m = S3Filter{} } func (*S3Filter) ProtoMessage() {} func (*S3Filter) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{17} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{19} } func (m *S3Filter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -548,7 +604,7 @@ var xxx_messageInfo_S3Filter proto.InternalMessageInfo func (m *Sensor) Reset() { *m = Sensor{} } func (*Sensor) ProtoMessage() {} func (*Sensor) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{18} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{20} } func (m *Sensor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -576,7 +632,7 @@ var xxx_messageInfo_Sensor proto.InternalMessageInfo func (m *SensorList) Reset() { *m = SensorList{} } func (*SensorList) ProtoMessage() {} func (*SensorList) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{19} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{21} } func (m *SensorList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -604,7 +660,7 @@ var xxx_messageInfo_SensorList proto.InternalMessageInfo func (m *SensorSpec) Reset() { *m = SensorSpec{} } func (*SensorSpec) ProtoMessage() {} func (*SensorSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{20} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{22} } func (m *SensorSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -632,7 +688,7 @@ var xxx_messageInfo_SensorSpec proto.InternalMessageInfo func (m *SensorStatus) Reset() { *m = SensorStatus{} } func (*SensorStatus) ProtoMessage() {} func (*SensorStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{21} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{23} } func (m *SensorStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -660,7 +716,7 @@ var xxx_messageInfo_SensorStatus proto.InternalMessageInfo func (m *Signal) Reset() { *m = Signal{} } func (*Signal) ProtoMessage() {} func (*Signal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{22} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{24} } func (m *Signal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -688,7 +744,7 @@ var xxx_messageInfo_Signal proto.InternalMessageInfo func (m *SignalFilter) Reset() { *m = SignalFilter{} } func (*SignalFilter) ProtoMessage() {} func (*SignalFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{23} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{25} } func (m *SignalFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -716,7 +772,7 @@ var xxx_messageInfo_SignalFilter proto.InternalMessageInfo func (m *Stream) Reset() { *m = Stream{} } func (*Stream) ProtoMessage() {} func (*Stream) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{24} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{26} } func (m *Stream) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -744,7 +800,7 @@ var xxx_messageInfo_Stream proto.InternalMessageInfo func (m *TimeFilter) Reset() { *m = TimeFilter{} } func (*TimeFilter) ProtoMessage() {} func (*TimeFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{25} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{27} } func (m *TimeFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -772,7 +828,7 @@ var xxx_messageInfo_TimeFilter proto.InternalMessageInfo func (m *Trigger) Reset() { *m = Trigger{} } func (*Trigger) ProtoMessage() {} func (*Trigger) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{26} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{28} } func (m *Trigger) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -800,7 +856,7 @@ var xxx_messageInfo_Trigger proto.InternalMessageInfo func (m *URI) Reset() { *m = URI{} } func (*URI) ProtoMessage() {} func (*URI) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{27} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{29} } func (m *URI) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -828,7 +884,7 @@ var xxx_messageInfo_URI proto.InternalMessageInfo func (m *WebhookSignal) Reset() { *m = WebhookSignal{} } func (*WebhookSignal) ProtoMessage() {} func (*WebhookSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_122c2bb8f9413e3d, []int{28} + return fileDescriptor_generated_1921ec7d297a9a4b, []int{30} } func (m *WebhookSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -871,6 +927,8 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ResourceFilter.LabelsEntry") proto.RegisterType((*ResourceObject)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ResourceObject") proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ResourceObject.LabelsEntry") + proto.RegisterType((*ResourceParameter)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ResourceParameter") + proto.RegisterType((*ResourceParameterSource)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ResourceParameterSource") proto.RegisterType((*ResourceSignal)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.ResourceSignal") proto.RegisterType((*RetryStrategy)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.RetryStrategy") proto.RegisterType((*S3Artifact)(nil), "github.com.argoproj.argo_events.pkg.apis.sensor.v1alpha1.S3Artifact") @@ -1432,16 +1490,6 @@ func (m *ResourceObject) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) i += copy(dAtA[i:], m.Namespace) - if m.ArtifactLocation != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.ArtifactLocation.Size())) - n15, err := m.ArtifactLocation.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } if len(m.Labels) > 0 { keysForLabels := make([]string, 0, len(m.Labels)) for k := range m.Labels { @@ -1464,10 +1512,30 @@ func (m *ResourceObject) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], v) } } - dAtA[i] = 0x22 + if len(m.Parameters) > 0 { + for _, msg := range m.Parameters { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.GroupVersionKind.Size())) - n16, err := m.GroupVersionKind.MarshalTo(dAtA[i:]) + n15, err := m.GroupVersionKind.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n15 + dAtA[i] = 0x32 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Source.Size())) + n16, err := m.Source.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -1475,6 +1543,70 @@ func (m *ResourceObject) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ResourceParameter) 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 *ResourceParameter) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Src != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Src.Size())) + n17, err := m.Src.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n17 + } + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Dest))) + i += copy(dAtA[i:], m.Dest) + return i, nil +} + +func (m *ResourceParameterSource) 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 *ResourceParameterSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Signal))) + i += copy(dAtA[i:], m.Signal) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i += copy(dAtA[i:], m.Path) + if m.Value != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Value))) + i += copy(dAtA[i:], *m.Value) + } + return i, nil +} + func (m *ResourceSignal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1498,20 +1630,20 @@ func (m *ResourceSignal) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Filter.Size())) - n17, err := m.Filter.MarshalTo(dAtA[i:]) + n18, err := m.Filter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n17 + i += n18 } dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.GroupVersionKind.Size())) - n18, err := m.GroupVersionKind.MarshalTo(dAtA[i:]) + n19, err := m.GroupVersionKind.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n18 + i += n19 return i, nil } @@ -1560,20 +1692,20 @@ func (m *S3Artifact) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Filter.Size())) - n19, err := m.Filter.MarshalTo(dAtA[i:]) + n20, err := m.Filter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n19 + i += n20 } dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.S3Bucket.Size())) - n20, err := m.S3Bucket.MarshalTo(dAtA[i:]) + n21, err := m.S3Bucket.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n20 + i += n21 return i, nil } @@ -1615,19 +1747,19 @@ func (m *S3Bucket) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AccessKey.Size())) - n21, err := m.AccessKey.MarshalTo(dAtA[i:]) + n22, err := m.AccessKey.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n21 + i += n22 dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretKey.Size())) - n22, err := m.SecretKey.MarshalTo(dAtA[i:]) + n23, err := m.SecretKey.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n22 + i += n23 return i, nil } @@ -1675,27 +1807,27 @@ func (m *Sensor) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n23, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n24, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n23 + i += n24 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n24, err := m.Spec.MarshalTo(dAtA[i:]) + n25, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n24 + i += n25 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n25, err := m.Status.MarshalTo(dAtA[i:]) + n26, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n25 + i += n26 return i, nil } @@ -1717,11 +1849,11 @@ func (m *SensorList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n26, err := m.ListMeta.MarshalTo(dAtA[i:]) + n27, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n26 + i += n27 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -1779,11 +1911,11 @@ func (m *SensorSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Escalation.Size())) - n27, err := m.Escalation.MarshalTo(dAtA[i:]) + n28, err := m.Escalation.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n27 + i += n28 dAtA[i] = 0x20 i++ if m.Repeat { @@ -1817,19 +1949,19 @@ func (m *SensorStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.StartedAt.Size())) - n28, err := m.StartedAt.MarshalTo(dAtA[i:]) + n29, err := m.StartedAt.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n28 + i += n29 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CompletedAt.Size())) - n29, err := m.CompletedAt.MarshalTo(dAtA[i:]) + n30, err := m.CompletedAt.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n29 + i += n30 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) @@ -1858,11 +1990,11 @@ func (m *SensorStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n30, err := (&v).MarshalTo(dAtA[i:]) + n31, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n31 } } return i, nil @@ -1894,60 +2026,60 @@ func (m *Signal) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Stream.Size())) - n31, err := m.Stream.MarshalTo(dAtA[i:]) + n32, err := m.Stream.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n32 } if m.Artifact != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Artifact.Size())) - n32, err := m.Artifact.MarshalTo(dAtA[i:]) + n33, err := m.Artifact.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n33 } if m.Calendar != nil { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Calendar.Size())) - n33, err := m.Calendar.MarshalTo(dAtA[i:]) + n34, err := m.Calendar.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n34 } if m.Resource != nil { dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n34, err := m.Resource.MarshalTo(dAtA[i:]) + n35, err := m.Resource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n35 } if m.Webhook != nil { dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Webhook.Size())) - n35, err := m.Webhook.MarshalTo(dAtA[i:]) + n36, err := m.Webhook.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n36 } dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Filters.Size())) - n36, err := m.Filters.MarshalTo(dAtA[i:]) + n37, err := m.Filters.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n37 return i, nil } @@ -1970,21 +2102,21 @@ func (m *SignalFilter) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Time.Size())) - n37, err := m.Time.MarshalTo(dAtA[i:]) + n38, err := m.Time.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n38 } if m.Context != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Context.Size())) - n38, err := m.Context.MarshalTo(dAtA[i:]) + n39, err := m.Context.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n39 } if len(m.Data) > 0 { for _, msg := range m.Data { @@ -2067,19 +2199,19 @@ func (m *TimeFilter) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Start.Size())) - n39, err := m.Start.MarshalTo(dAtA[i:]) + n40, err := m.Start.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n40 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Stop.Size())) - n40, err := m.Stop.MarshalTo(dAtA[i:]) + n41, err := m.Stop.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n40 + i += n41 return i, nil } @@ -2106,31 +2238,31 @@ func (m *Trigger) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n41, err := m.Resource.MarshalTo(dAtA[i:]) + n42, err := m.Resource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n41 + i += n42 } if m.Message != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Message.Size())) - n42, err := m.Message.MarshalTo(dAtA[i:]) + n43, err := m.Message.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n42 + i += n43 } if m.RetryStrategy != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.RetryStrategy.Size())) - n43, err := m.RetryStrategy.MarshalTo(dAtA[i:]) + n44, err := m.RetryStrategy.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n43 + i += n44 } return i, nil } @@ -2416,10 +2548,6 @@ func (m *ResourceObject) Size() (n int) { _ = l l = len(m.Namespace) n += 1 + l + sovGenerated(uint64(l)) - if m.ArtifactLocation != nil { - l = m.ArtifactLocation.Size() - n += 1 + l + sovGenerated(uint64(l)) - } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k @@ -2428,8 +2556,42 @@ func (m *ResourceObject) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } l = m.GroupVersionKind.Size() n += 1 + l + sovGenerated(uint64(l)) + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ResourceParameter) Size() (n int) { + var l int + _ = l + if m.Src != nil { + l = m.Src.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Dest) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ResourceParameterSource) Size() (n int) { + var l int + _ = l + l = len(m.Signal) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -2907,9 +3069,33 @@ func (this *ResourceObject) String() string { mapStringForLabels += "}" s := strings.Join([]string{`&ResourceObject{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `ArtifactLocation:` + strings.Replace(fmt.Sprintf("%v", this.ArtifactLocation), "ArtifactLocation", "ArtifactLocation", 1) + `,`, `Labels:` + mapStringForLabels + `,`, + `Parameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Parameters), "ResourceParameter", "ResourceParameter", 1), `&`, ``, 1) + `,`, `GroupVersionKind:` + strings.Replace(strings.Replace(this.GroupVersionKind.String(), "GroupVersionKind", "GroupVersionKind", 1), `&`, ``, 1) + `,`, + `Source:` + strings.Replace(strings.Replace(this.Source.String(), "ArtifactLocation", "ArtifactLocation", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceParameter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResourceParameter{`, + `Src:` + strings.Replace(fmt.Sprintf("%v", this.Src), "ResourceParameterSource", "ResourceParameterSource", 1) + `,`, + `Dest:` + fmt.Sprintf("%v", this.Dest) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceParameterSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResourceParameterSource{`, + `Signal:` + fmt.Sprintf("%v", this.Signal) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Value:` + valueToStringGenerated(this.Value) + `,`, `}`, }, "") return s @@ -5337,39 +5523,6 @@ func (m *ResourceObject) Unmarshal(dAtA []byte) error { } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ArtifactLocation", 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.ArtifactLocation == nil { - m.ArtifactLocation = &ArtifactLocation{} - } - if err := m.ArtifactLocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) @@ -5489,6 +5642,37 @@ func (m *ResourceObject) Unmarshal(dAtA []byte) error { m.Labels[mapkey] = mapvalue iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", 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.Parameters = append(m.Parameters, ResourceParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GroupVersionKind", wireType) } @@ -5518,6 +5702,286 @@ func (m *ResourceObject) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", 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 err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *ResourceParameter) 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: ResourceParameter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceParameter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Src", 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.Src == nil { + m.Src = &ResourceParameterSource{} + } + if err := m.Src.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dest", 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.Dest = 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 *ResourceParameterSource) 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: ResourceParameterSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceParameterSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signal", 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.Signal = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 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 + } + s := string(dAtA[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -8390,166 +8854,173 @@ var ( ) func init() { - 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, 0xa4, 0x3b, 0xdd, 0x86, - 0x44, 0x6a, 0x68, 0xa4, 0x86, 0x45, 0x5a, 0xb8, 0x98, 0xd3, 0xa1, 0x9b, 0x74, 0x93, 0xa6, 0x02, - 0xdc, 0x1a, 0x6c, 0xab, 0x2f, 0xf5, 0xa1, 0xfe, 0x69, 0x41, 0x0b, 0xfe, 0xce, 0x15, 0xde, 0x08, - 0x13, 0xa9, 0x55, 0x33, 0x48, 0x18, 0x6d, 0xee, 0x8e, 0x29, 0xb3, 0xf0, 0xcd, 0x6c, 0x4c, 0x9f, - 0x04, 0xbd, 0x30, 0xa6, 0x6c, 0x98, 0x2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x69, 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, 0xd7, 0x35, 0x9c, 0x3c, 0x8f, 0x8d, 0x76, 0x20, 0x73, 0x4d, - 0x08, 0xc7, 0xc1, 0x39, 0x89, 0x3a, 0xce, 0xa5, 0x94, 0x08, 0x13, 0xbd, 0x72, 0x71, 0x4e, 0x52, - 0xb1, 0xe1, 0xfa, 0xbf, 0x2f, 0xc1, 0x5c, 0xde, 0x23, 0xb3, 0x4b, 0xa1, 0x77, 0xa2, 0x4b, 0x61, - 0xe1, 0xab, 0xbd, 0x14, 0x16, 0xbf, 0xda, 0x4b, 0x61, 0xe9, 0x4b, 0x2e, 0x85, 0xbb, 0x50, 0x8e, - 0x93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, 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, + proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1/generated.proto", fileDescriptor_generated_1921ec7d297a9a4b) +} + +var fileDescriptor_generated_1921ec7d297a9a4b = []byte{ + // 2622 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x5b, 0x6f, 0x1c, 0x49, + 0xf5, 0x4f, 0xcf, 0xcd, 0xe3, 0x33, 0x4e, 0xe2, 0xad, 0xff, 0x5f, 0x62, 0x64, 0xb1, 0xb6, 0xd5, + 0x2b, 0xa2, 0x80, 0x92, 0x9e, 0x4d, 0x0c, 0x28, 0x20, 0x05, 0xe2, 0x89, 0x9d, 0xc4, 0x89, 0x93, + 0x38, 0x35, 0x49, 0x56, 0x84, 0x95, 0xa0, 0xdc, 0x53, 0x9e, 0xe9, 0xb8, 0xa7, 0xbb, 0x53, 0x55, + 0xe3, 0xcd, 0x48, 0x68, 0x59, 0xd0, 0x4a, 0x48, 0x08, 0xc4, 0x0a, 0x09, 0xc4, 0x03, 0x2f, 0x68, + 0xc5, 0xd3, 0xbe, 0xf3, 0x01, 0x90, 0x10, 0x79, 0x5c, 0xde, 0xf6, 0x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7, 0x17, 0x41, 0xd8, 0x08, 0x22, 0xc1, 0x05, 0x1b, 0x9d, 0xe4, 0xfe, 0xce, 0x81, + 0xf9, 0x55, 0x26, 0x82, 0x1d, 0xe2, 0x8b, 0xcd, 0xd8, 0x27, 0x22, 0x88, 0x23, 0xf4, 0x2e, 0x14, + 0xf8, 0x4a, 0xdd, 0x59, 0x76, 0xce, 0xd7, 0x2e, 0xaf, 0x79, 0x27, 0x3d, 0x02, 0xaf, 0xb5, 0x92, + 0x22, 0x37, 0x2b, 0x07, 0xfb, 0x4b, 0x85, 0xd6, 0x0a, 0x2e, 0xf0, 0x15, 0x74, 0x0e, 0x2a, 0x41, + 0x14, 0x06, 0x11, 0xad, 0x17, 0x96, 0x9d, 0xf3, 0xb3, 0xcd, 0x33, 0x2f, 0xf6, 0x97, 0x4e, 0x1d, + 0xec, 0x2f, 0x55, 0x36, 0x14, 0x15, 0x1b, 0xae, 0xfb, 0xcb, 0x02, 0x9c, 0x49, 0x01, 0x5a, 0x41, + 0x27, 0x22, 0x21, 0xea, 0x42, 0x45, 0x10, 0xd6, 0xa1, 0xc2, 0x28, 0x77, 0x6d, 0x02, 0xe5, 0x04, + 0xa3, 0xa4, 0x97, 0x09, 0x7f, 0xa8, 0x70, 0xb1, 0xc1, 0x47, 0x1f, 0x39, 0x30, 0x4f, 0x46, 0xf6, + 0x45, 0xe9, 0x5b, 0xbb, 0x7c, 0xfb, 0xe4, 0x42, 0x47, 0x77, 0xba, 0x59, 0x37, 0xe2, 0xc7, 0xce, + 0x00, 0x8f, 0x49, 0x77, 0x7f, 0xef, 0xc0, 0x99, 0xeb, 0x24, 0xa4, 0x51, 0x9b, 0x30, 0xb3, 0x1f, + 0x17, 0xa0, 0x2a, 0x2f, 0x43, 0xbb, 0x1f, 0x52, 0xb5, 0x23, 0xb3, 0xcd, 0x79, 0x03, 0x58, 0x6d, + 0x19, 0x3a, 0xb6, 0x23, 0xe4, 0xe8, 0x20, 0x12, 0x94, 0xed, 0x91, 0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 0x00, 0x44, 0x08, 0x16, 0x6c, 0xf7, 0x05, 0x4d, + 0xbb, 0x4a, 0x5b, 0x93, 0x7a, 0x0f, 0x6f, 0xd5, 0x42, 0x8e, 0x3c, 0xc0, 0x64, 0x0c, 0x9c, 0x93, + 0xbb, 0x70, 0x15, 0xce, 0x8e, 0x4c, 0x39, 0x56, 0x57, 0xe3, 0x13, 0x07, 0x20, 0xbb, 0x03, 0xe8, + 0x3e, 0x94, 0x55, 0xec, 0x33, 0x17, 0xeb, 0x38, 0x81, 0xce, 0x46, 0x0e, 0x15, 0x47, 0xb1, 0xc6, + 0x41, 0x9b, 0x50, 0xe2, 0x22, 0x4e, 0x4e, 0x10, 0x97, 0xb3, 0x34, 0x58, 0xc4, 0x09, 0x56, 0x28, + 0xee, 0x2f, 0x8a, 0x30, 0x63, 0x92, 0x9d, 0xd7, 0x08, 0x04, 0x79, 0x67, 0x34, 0xb5, 0x16, 0x82, + 0x2e, 0x03, 0x8e, 0x74, 0x46, 0xdd, 0x2c, 0x98, 0x17, 0xa7, 0xf5, 0x0e, 0x5e, 0x3b, 0x34, 0x17, + 0xf8, 0xc0, 0x81, 0xd3, 0x8c, 0x26, 0xa1, 0x6d, 0x0f, 0x98, 0xc0, 0x72, 0x73, 0x92, 0x35, 0xe6, + 0xba, 0x0d, 0xcd, 0x37, 0x0e, 0xf6, 0x97, 0x86, 0x1b, 0x10, 0x78, 0x58, 0xa0, 0xfb, 0xa7, 0x02, + 0x14, 0x1f, 0xe1, 0x0d, 0x55, 0x9a, 0xf9, 0x5d, 0x6a, 0x0f, 0x23, 0xab, 0x2a, 0x14, 0x15, 0x1b, + 0xae, 0x3c, 0xb2, 0x3e, 0x37, 0xfd, 0x9c, 0xdc, 0x91, 0x3d, 0xe2, 0x94, 0x61, 0xc5, 0x91, 0xb1, + 0x3b, 0x21, 0x9c, 0xbf, 0x17, 0xb3, 0xf4, 0x55, 0xcc, 0xc6, 0xee, 0x2d, 0x43, 0xc7, 0x76, 0x84, + 0xc4, 0xeb, 0xc6, 0x5c, 0x98, 0xb4, 0xc9, 0xe2, 0xdd, 0x8a, 0xb9, 0xc0, 0x8a, 0xa3, 0x5a, 0x59, + 0x31, 0x13, 0x2a, 0xfe, 0x95, 0x73, 0xad, 0xac, 0x98, 0x09, 0xac, 0x38, 0xb6, 0xd9, 0x55, 0x39, + 0xb2, 0xd9, 0xf5, 0x16, 0x94, 0x9f, 0xf5, 0x29, 0x1b, 0xa8, 0xe8, 0x92, 0x7b, 0xf5, 0x7b, 0x20, + 0x89, 0x58, 0xf3, 0xa4, 0xe2, 0x3b, 0x8c, 0x74, 0x7a, 0x34, 0x12, 0xe6, 0xb5, 0xc5, 0x2a, 0x7e, + 0xc3, 0xd0, 0xb1, 0x1d, 0xe1, 0xfe, 0xcc, 0x81, 0xd3, 0x43, 0xa1, 0xe6, 0x98, 0xdd, 0x86, 0x74, + 0x59, 0x85, 0x23, 0x97, 0x75, 0x0e, 0x2a, 0x3d, 0x2a, 0xba, 0x71, 0x7b, 0xb4, 0xcf, 0x70, 0x57, + 0x51, 0xb1, 0xe1, 0x36, 0xbd, 0x17, 0x2f, 0x17, 0x4f, 0x7d, 0xfa, 0x72, 0xf1, 0xd4, 0x67, 0x2f, + 0x17, 0x4f, 0x7d, 0x70, 0xb0, 0xe8, 0xbc, 0x38, 0x58, 0x74, 0x3e, 0x3d, 0x58, 0x74, 0x3e, 0x3b, + 0x58, 0x74, 0xfe, 0x71, 0xb0, 0xe8, 0x7c, 0xf4, 0xcf, 0xc5, 0x53, 0x4f, 0xaa, 0xe9, 0x15, 0xf9, + 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x20, 0x0f, 0xce, 0x9b, 0x26, 0x00, 0x00, } diff --git a/pkg/apis/sensor/v1alpha1/generated.proto b/pkg/apis/sensor/v1alpha1/generated.proto index ce85d6870d..807c360c61 100644 --- a/pkg/apis/sensor/v1alpha1/generated.proto +++ b/pkg/apis/sensor/v1alpha1/generated.proto @@ -28,7 +28,7 @@ import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". option go_package = "v1alpha1"; -// ArtifactLocation describes the location for an external artifact +// ArtifactLocation describes the source location for an external artifact message ArtifactLocation { optional S3Artifact s3 = 1; @@ -65,6 +65,7 @@ message CalendarSignal { // 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 the JSONPath of the event's (JSON decoded) data key // 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. @@ -213,19 +214,51 @@ message ResourceFilter { // ResourceObject is the resource object to create on kubernetes message ResourceObject { // The unambiguous kind of this object - used in order to retrieve the appropriate kubernetes api client for this resource - optional GroupVersionKind groupVersionKind = 4; + optional GroupVersionKind groupVersionKind = 5; // Namespace in which to create this object // optional + // defaults to the service account namespace optional string namespace = 1; - // Location in which the K8 resource file(s) are stored. - // If omitted, will attempt to use the default artifact location configured in the controller. - optional ArtifactLocation artifactLocation = 2; + // Source of the K8 resource file(s) + optional ArtifactLocation source = 6; // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. This overrides any labels in the unstructured object with the same key. map labels = 3; + + // Parameters is the list of resource parameters to pass in the object + repeated ResourceParameter parameters = 4; +} + +// ResourceParameter indicates a passed parameter to a service template +message ResourceParameter { + // Src contains a source reference to the value of the resource parameter from a signal event + optional ResourceParameterSource src = 1; + + // Dest is the JSONPath of a resource key. + // A path is a series of keys separated by a dot. The colon character can be escaped with '.' + // The -1 key can be used to append a value to an existing array. + // See https://github.com/tidwall/sjson#path-syntax for more information about how this is used. + optional string dest = 2; +} + +// ResourceParameterSource defines the source for a resource parameter from a signal event +message ResourceParameterSource { + // Signal is the name of the signal for which to retrieve this event + optional string signal = 1; + + // Path is the JSONPath of the event's (JSON decoded) data key + // 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 = 2; + + // Value is the default literal value to use for this parameter source + // This is only used if the path is invalid. + // If the path is invalid and this is not defined, this param source will produce an error. + optional string value = 3; } // ResourceSignal refers to a dependency on a k8s resource. diff --git a/pkg/apis/sensor/v1alpha1/types.go b/pkg/apis/sensor/v1alpha1/types.go index ac780f8981..14eeea6e37 100644 --- a/pkg/apis/sensor/v1alpha1/types.go +++ b/pkg/apis/sensor/v1alpha1/types.go @@ -197,6 +197,7 @@ const ( // 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 the JSONPath of the event's (JSON decoded) data key // 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. @@ -228,22 +229,54 @@ type Trigger struct { RetryStrategy *RetryStrategy `json:"retryStrategy" protobuf:"bytes,4,opt,name=replyStrategy"` } +// ResourceParameter indicates a passed parameter to a service template +type ResourceParameter struct { + // Src contains a source reference to the value of the resource parameter from a signal event + Src *ResourceParameterSource `json:"src" protobuf:"bytes,1,opt,name=src"` + + // Dest is the JSONPath of a resource key. + // A path is a series of keys separated by a dot. The colon character can be escaped with '.' + // The -1 key can be used to append a value to an existing array. + // See https://github.com/tidwall/sjson#path-syntax for more information about how this is used. + Dest string `json:"dest" protobuf:"bytes,2,opt,name=dest"` +} + +// ResourceParameterSource defines the source for a resource parameter from a signal event +type ResourceParameterSource struct { + // Signal is the name of the signal for which to retrieve this event + Signal string `json:"signal" protobuf:"bytes,1,opt,name=signal"` + + // Path is the JSONPath of the event's (JSON decoded) data key + // 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,2,opt,name=path"` + + // Value is the default literal value to use for this parameter source + // This is only used if the path is invalid. + // If the path is invalid and this is not defined, this param source will produce an error. + Value *string `json:"default,omitempty" protobuf:"bytes,3,opt,name=value"` +} + // ResourceObject is the resource object to create on kubernetes type ResourceObject struct { // The unambiguous kind of this object - used in order to retrieve the appropriate kubernetes api client for this resource - GroupVersionKind `json:",inline" protobuf:"bytes,4,opt,name=groupVersionKind"` + GroupVersionKind `json:",inline" protobuf:"bytes,5,opt,name=groupVersionKind"` // Namespace in which to create this object // optional - Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"` + // defaults to the service account namespace + Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` - // Location in which the K8 resource file(s) are stored. - // If omitted, will attempt to use the default artifact location configured in the controller. - ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty" protobuf:"bytes,2,opt,name=artifactLocation"` + // Source of the K8 resource file(s) + Source ArtifactLocation `json:"source" protobuf:"bytes,6,opt,name=source"` // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. This overrides any labels in the unstructured object with the same key. Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,3,rep,name=labels"` + + // Parameters is the list of resource parameters to pass in the object + Parameters []ResourceParameter `json:"parameters" protobuf:"bytes,4,rep,name=parameters"` } // Stream describes a queue stream resource @@ -413,7 +446,7 @@ type URI struct { Fragment string `json:"fragment" protobuf:"bytes,8,opt,name=fragment"` } -// ArtifactLocation describes the location for an external artifact +// ArtifactLocation describes the source location for an external artifact type ArtifactLocation struct { S3 *S3Artifact `json:"s3,omitempty" protobuf:"bytes,1,opt,name=s3"` Inline string `json:"inline,omitempty" protobuf:"bytes,2,opt,name=inline"` diff --git a/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go index 09005ea990..8ff1808432 100644 --- a/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/sensor/v1alpha1/zz_generated.deepcopy.go @@ -280,11 +280,7 @@ func (in *ResourceFilter) DeepCopy() *ResourceFilter { func (in *ResourceObject) DeepCopyInto(out *ResourceObject) { *out = *in out.GroupVersionKind = in.GroupVersionKind - if in.ArtifactLocation != nil { - in, out := &in.ArtifactLocation, &out.ArtifactLocation - *out = new(ArtifactLocation) - (*in).DeepCopyInto(*out) - } + in.Source.DeepCopyInto(&out.Source) if in.Labels != nil { in, out := &in.Labels, &out.Labels *out = make(map[string]string, len(*in)) @@ -292,6 +288,13 @@ func (in *ResourceObject) DeepCopyInto(out *ResourceObject) { (*out)[key] = val } } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]ResourceParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -305,6 +308,48 @@ func (in *ResourceObject) DeepCopy() *ResourceObject { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceParameter) DeepCopyInto(out *ResourceParameter) { + *out = *in + if in.Src != nil { + in, out := &in.Src, &out.Src + *out = new(ResourceParameterSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceParameter. +func (in *ResourceParameter) DeepCopy() *ResourceParameter { + if in == nil { + return nil + } + out := new(ResourceParameter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceParameterSource) DeepCopyInto(out *ResourceParameterSource) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceParameterSource. +func (in *ResourceParameterSource) DeepCopy() *ResourceParameterSource { + if in == nil { + return nil + } + out := new(ResourceParameterSource) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceSignal) DeepCopyInto(out *ResourceSignal) { *out = *in diff --git a/shared/micro.go b/shared/micro.go index 96b696cf4c..9c05ce6195 100644 --- a/shared/micro.go +++ b/shared/micro.go @@ -48,9 +48,11 @@ func (m *MicroSignalClient) DiscoverSignals() ([]string, error) { } svcNames := make([]string, 0) for _, svc := range svcs { - if val := svc.Metadata[sdk.MetadataKey]; val == sdk.MetadataValue { - svcNames = append(svcNames, svc.Name) - } + // Due to https://github.com/micro/go-plugins/issues/206, we can't use the metadata to filter services + //if svc.Metadata[sdk.MetadataKey] == sdk.MetadataValue { + // svcNames = append(svcNames, svc.Name) + //} + svcNames = append(svcNames, svc.Name) } return svcNames, nil } diff --git a/signals/webhook/micro/client/main.go b/signals/webhook/micro/client/main.go index c3f01aeaad..a190beb42c 100644 --- a/signals/webhook/micro/client/main.go +++ b/signals/webhook/micro/client/main.go @@ -34,7 +34,7 @@ func main() { signal := &v1alpha1.Signal{ Name: "webhook-1", Webhook: &v1alpha1.WebhookSignal{ - Endpoint: "/app", + Endpoint: "/hello", Port: 7070, Method: "POST", }, @@ -61,7 +61,7 @@ func main() { }() client := &http.Client{} - req, _ := http.NewRequest("POST", "http://webhook:7070/app", bytes.NewBuffer([]byte(`{"title":"Buy cheese and bread for breakfast."}`))) + req, _ := http.NewRequest("POST", "http://webhook:7070/hello", bytes.NewBuffer([]byte(`{"message":"Buy cheese and bread for breakfast"}`))) _, err = client.Do(req) if err != nil { log.Panicf("failed to post http: %s", err) diff --git a/signals/webhook/webhook.go b/signals/webhook/webhook.go index 6ea02bdf8e..ca82869d76 100644 --- a/signals/webhook/webhook.go +++ b/signals/webhook/webhook.go @@ -32,7 +32,8 @@ import ( ) const ( - EventType = "Webhook" + EventType string = "Webhook" + HeaderKeyContentType string = "Content-Type" ) // Note: micro requires stateless operation so the Listen() method should not use the @@ -69,7 +70,8 @@ func (*webhook) Listen(signal *v1alpha1.Signal, done <-chan struct{}) (<-chan *v Scheme: req.RequestURI, Host: req.Host, }, - EventTime: metav1.Time{Time: time.Now().UTC()}, + ContentType: req.Header.Get(HeaderKeyContentType), + EventTime: metav1.Time{Time: time.Now().UTC()}, }, Data: payload, } diff --git a/store/store.go b/store/store.go index 24a0af3e28..f9b7c654b8 100644 --- a/store/store.go +++ b/store/store.go @@ -68,21 +68,11 @@ func decodeAndUnstructure(b []byte, gvk ss_v1alpha1.GroupVersionKind) (*unstruct Kind: gvk.Kind, } - object, _, err := scheme.Codecs.UniversalDeserializer().Decode(b, gvk1, nil) + obj, _, err := scheme.Codecs.UniversalDeserializer().Decode(b, gvk1, nil) if err != nil { return nil, err } - var obj interface{} - switch object.GetObjectKind().GroupVersionKind() { - case ss_v1alpha1.SchemaGroupVersionKind: - obj = object.(*ss_v1alpha1.Sensor) - case wf_v1alpha1.SchemaGroupVersionKind: - obj = object.(*wf_v1alpha1.Workflow) - default: - return nil, fmt.Errorf("unsupported object kind %s", object.GetObjectKind()) - } - uObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) if err != nil { return nil, err diff --git a/store/store_test.go b/store/store_test.go index 74bf95d7f8..22d9784c3d 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -57,6 +57,9 @@ func TestGetArtifactReader(t *testing.T) { func TestDecodeAndUnstructure(t *testing.T) { t.Run("sensor", decodeSensor) t.Run("workflow", decodeWorkflow) + // Note that since #16 - Restrict ResourceObject creation via RBAC roles + // decoding&converting to unstructure objects should pass fine for any valid objects + // the store no longer should control restrictions around object creation t.Run("unsupported", decodeUnsupported) t.Run("unknown", decodeUnknown) } @@ -188,7 +191,7 @@ func decodeUnsupported(t *testing.T) { Kind: "Job", } _, err := decodeAndUnstructure([]byte(unsupportedType), gvk) - assert.NotNil(t, err) + assert.Nil(t, err) } var unsupportedType = ` @@ -225,5 +228,5 @@ func decodeUnknown(t *testing.T) { Kind: "What??", } _, err := decodeAndUnstructure([]byte(unsupportedType), gvk) - assert.NotNil(t, err) + assert.Nil(t, err, "expected nil error but got", err) }