* Initial commit for the webhook to set the annotations about mutator.
The user that created or updated the resource will be set in the
annotations.
* update comments
* remove debug logging
* logging :/
* logging :/, returns
* logging :/ III
* error wrap
* simplify test
* rename the test
* add pkg/errors to the deps for better errors
* do not require CRD to implement Annotatable
* review issues
* fix interface as required by review
* Cleanup the webhook code.
- add more tests
- fix formatting
- fix logging and errors
- use shorthands
- some optimizations in types
- make code more Go'ey from C'ey.
* raise test coverage
* Add ping message verification to the websocket connection.
* Recycle ticker.
* Add comment.
* Fix datarace by waiting for goroutines to finish on Shutdown.
* fix very annoying logging in the integration tests
* Add clean test loggers method.
This would help us run the tests over-and-over again.
Currently the test hogs `t` and that object is not reusable.
* Add static endpoint override to test/spoof
When testing locally its common to use a cluster which both does not
have resolvable dns for ksvcs and does not have public IPs. Support
overriding the endpoint for knative's ingress controller to a static
value which can be set to e.g. the knative-ingressgateway nodeport.
* Fix 2 broken links
* Cleanup websocket connection, actually test reconnects.
* Some more cleanup.
* Locally define connFactory to avoid races.
* Move locks around, harden test.
* Add logging.
* Drop redundant target.
* Move message encoding outside of the writerLock.
* Fix assignment nit.
* Remove named return value.
* Add close signal to long-running loops.
* Add todo for returning a messageType.
* Bump header to 2019.
* Add note on draining the messageChan.
* Drop target from signature.
* Drop target from test.
* Add a more speaking example to draining the messageChan.
* Fix typo.
* Relax read lock, improve test.
* Bump test coverage.
* Add double shutdown test.
* Remove code duplication in test.
* Webhook creates a patch for all fields generated by round tripping the JSON through Golang types.
* Add unit tests for InnerDefaultResource.
* Linter errors.
* PR comments - test changes
* t.Helper()
* PR comments.
* CloudEvents v0.2 support, step 1: interfaces and versioned types.
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
* Add support for v0.2 event types. (Breaking change in return types!)
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
* Move DataContentType() to be common across Senders and Receivers.
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
* Add comment on why test code is commented out.
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
* Address @vagababov review.
* Add another test case and better cover extensions in handler tests.
* Add `AtIndex` method to deal to attach index at the current error.
This is useful when we are dealing with primite leaf list (e.g.
a list of strings).
The alternative are
a) creating dummy error and then executing ViaFieldIndex(), which is
plain ugly
b) implementing Validate() on the primitive type via type aliasing and
then collecting errors, which seems an overkill.
In addition it seems ViaFieldIndex was not covered by unit tests,
so I've added one to take care of that.
* implement suggestions from the review
* cleanup
* cosmetic
* cosmetic
* Some fixes to the event_v01.go file.
Mostly change to the encodeKey to not use pointer to the map.
Some minor readability improvements.
* Fix the comment wording.
This restores the appearance of "terminal" conditions to what is was prior to the separation of "terminal" and "non-terminal" conditions.
Terminal conditions with an "Error" severity will simply omit the field.
This keeps coming up, and came to a head when both Evan and Ville bugged me about it in the same day.
Fixes: https://github.com/knative/serving/issues/2507
* Add docs to help bootstrap cloud event sdk usage.
* add go markdown label.
* prettier markdown.
* well golang wants tabs but markdown does not i guess so... fight!
* adding me as an owner of this code.
* adding ville to the hook.
* Pushing new client and builder.
* good example of how to use the encoding settings int he builder.
* make it more clear,.
* prep for merge.
* adding tests.
* adding extenion tests.
* adding test for empty original extensions.
* Adding valid builder tests.
* adding client tests.
* Removing encoding from enum names.
* ran prettier.
* fix spacing.
* Update cloudevents/README.md
Co-Authored-By: n3wscott <32305648+n3wscott@users.noreply.github.com>
* Update based on feedback.
* adding builder to new client.
* update producer paragraph.
* trail space.
* trail space.
* Some fixes to the spoof.go and exporter.go
While reviewing some other CL, I saw some avenues for improving
spoof.go, to log the URL that's being fetched, which would help in test
debugging and to use switch construct, rather than nested if's.
While testing the change, I noticed some shifty loggin from the
exporter, so I fixed that as well while I was there.
* Continuation of the previous cleanups.
* Fix the issues with formatting by executing a grep
* and fix compilation error
* lowercase error
* fix the newly changed unit test
* Update test-infra
Bring in the latest features and fixes.
Bonus: use default build, unit and integration test runners.
* Update github.com/rogpeppe/go-internal to v1.0.1-alpha.6
This is needed to include the LICENSE file.
The are no changes in the packages used, so this update is safe.
* Fix license check for presubmit tests (should fail).
* Bump dependency on go-internal to include a LICENSE file.
* Taking check_licenses call out of update-deps.sh.
* Some fixes to the spoof.go and exporter.go
While reviewing some other CL, I saw some avenues for improving
spoof.go, to log the URL that's being fetched, which would help in test
debugging and to use switch construct, rather than nested if's.
While testing the change, I noticed some shifty loggin from the
exporter, so I fixed that as well while I was there.
* Continuation of the previous cleanups.
* duck typing - add a ConformsToType helper
Unlike VerifyType, ConformsToType will return the following:
- an error when any marshalling/unmarshalling fails
- false when the concrete type does not implement the duck type
- true when the concrete type implements the duck type
* use knative/pkg kmp to handle panics raised by go-cmp
In some cases, pods have entered 'Terminating' state, and we're only
waiting for K8s to kill the pods which unfortunately could go over the
5 minutes timeout here.