Add utility to send events#49
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: inlined The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/assign @eobrain |
|
|
||
| var untyped map[string]interface{} | ||
| if err := json.Unmarshal([]byte(data), &untyped); err != nil { | ||
| fmt.Println("Currenlty sendevent only supports JSON event data") |
| } | ||
|
|
||
| if ctx.Source == "" { | ||
| var err error |
There was a problem hiding this comment.
Can't you just use := on the next line?
There was a problem hiding this comment.
No. ctx.Source already exists.
| flag.Parse() | ||
|
|
||
| if flag.NArg() != 1 { | ||
| fmt.Println("Missing webhook address") |
There was a problem hiding this comment.
Maybe print usage example. For example:
fmt.Println("Missing webhook address. For example:\n go run cmd/sendevent/main.go http://httpbin.org/post")
There was a problem hiding this comment.
Added something in the same vein
| flag.StringVar(&context.EventID, "event-id", "", "Event ID to use. Defaults to a UUID") | ||
| flag.StringVar(&context.EventType, "event-type", "google.events.action.demo", "The Event Type to use.") | ||
| flag.StringVar(&context.Source, "source", "", "Source URI to use. Defaults to the current machine's hostname") | ||
| flag.StringVar(&data, "data", `{"hello": "world!"}`, "Event data") |
There was a problem hiding this comment.
Suggest naming the flag something that ends with "json", and specifying in the description it should be JSON.
(You could add flags for other formats later.)
There was a problem hiding this comment.
Yeah, I still don't really feel like I know how this tool is going to grow. I've also been considering adding a --file version of the data, and don't want to do a cross-product of {literal or by-file data} x {content-type}. I might do a content-type flag or just limit the tool to JSON.
|
/lgtm |
Includes the following changes 1e7c2e7 Update static_watcher.go d688349 Include note about embedding the ManualWatcher in the InformedWatcher 767d6a5 Few changes to the configmap package 0122abd The test logger will now log the correct caller (knative#63) e7a4b0d Dont call flag.parse in pkg/test (knative#62) b213523 Update test-infra dependency (knative#61) 382a2bf Make kube_checks generic so that it can be used in serving (knative#58) 760afb6 cleanup (knative#57) eedc0a9 Make verify-codegen.sh compatible with OS X (knative#54) 6eff182 Remove docker repo from e2e flags (knative#53) 4be5c07 Vendor the test-infra scripts (knative#52) 8c687df Update WaitForEndpointState to return response (knative#51) 8f6a3be Update knative/pkg/test (knative#50) 3ca4270 Add a logkey for the reconcile key. (knative#49) 62d2560 Add Istio DestinationRule and Policy into Istio apis and clients (knative#43) f4a77d7 Add a common test clients file (knative#46) 450739d Add common test logging module (knative#45)
Includes the following changes: 8fc80de Few changes to the configmap package (knative#59) 0122abd The test logger will now log the correct caller (knative#63) e7a4b0d Dont call flag.parse in pkg/test (knative#62) b213523 Update test-infra dependency (knative#61) 382a2bf Make kube_checks generic so that it can be used in serving (knative#58) 760afb6 cleanup (knative#57) eedc0a9 Make verify-codegen.sh compatible with OS X (knative#54) 6eff182 Remove docker repo from e2e flags (knative#53) 4be5c07 Vendor the test-infra scripts (knative#52) 8c687df Update WaitForEndpointState to return response (knative#51) 8f6a3be Update knative/pkg/test (knative#50) 3ca4270 Add a logkey for the reconcile key. (knative#49) 62d2560 Add Istio DestinationRule and Policy into Istio apis and clients (knative#43) f4a77d7 Add a common test clients file (knative#46) 450739d Add common test logging module (knative#45
* bump knative/pkg to 8fc80de Includes the following changes: 8fc80de Few changes to the configmap package (#59) 0122abd The test logger will now log the correct caller (#63) e7a4b0d Dont call flag.parse in pkg/test (#62) b213523 Update test-infra dependency (#61) 382a2bf Make kube_checks generic so that it can be used in serving (#58) 760afb6 cleanup (#57) eedc0a9 Make verify-codegen.sh compatible with OS X (#54) 6eff182 Remove docker repo from e2e flags (#53) 4be5c07 Vendor the test-infra scripts (#52) 8c687df Update WaitForEndpointState to return response (#51) 8f6a3be Update knative/pkg/test (#50) 3ca4270 Add a logkey for the reconcile key. (#49) 62d2560 Add Istio DestinationRule and Policy into Istio apis and clients (#43) f4a77d7 Add a common test clients file (#46) 450739d Add common test logging module (#45 * Use updated methods that indicate that the configmap.Watcher is using an informer
…0.5.0 Run Origin's conformance test suite via specific target
Adds a utility (meant to be used with
go install) that will send a sample cloud event.