Commit Graph

58 Commits

Author SHA1 Message Date
Zrss d82a0a3d1c Exit when bootstrap http server of webhook error (#131)
* Exit when bootstrap http server of webhook error

* Clean useless newRunningTestAdmissionController func

* return server.Close() err
2018-10-23 13:56:31 -07:00
Dave Protasowski 2b6bdaba3b Use zaptest logger for our TestLogger (#89)
* Bump go.uber.org/zap to 67bc79

* Use the zaptest logger which uses testing.T.Log methods
2018-09-25 21:40:20 -07:00
Matt Moore c15d7c8f22 Eliminate custom methods from GenericCRD (#78)
* Prune the GenericCRD spec to what is used.

Encapsulate our change detection slightly.

* Support common spec mutations via duck typing.

This adds support for performing common mutations to objects via duck types and JSON patching.

Fixes: https://github.com/knative/pkg/issues/76

* Eliminate getSpecJSON thru schemaless duck typing.

This leverages a one-off trick to get the JSON of the spec field from arbitrary types.
2018-09-18 14:25:19 -07:00
Scott Nichols a3bc2db77a Remove strict name metadata check to be shareable in eventing (#44)
* Do not valdiate name meta for all objects.

* Remove the test too.
2018-08-14 08:45:57 -07:00
Matt Moore 7a0c09e11a
Support multiple group/kind contexts in shared webhook. (#41)
In order to have a single webhook support multiple domain contexts, this reworks the `Handlers` argument to embed the `schema.GroupVersion` by wrapping the existing keys with it as a `schema.GroupVersionKind`.

This is mostly straightforward, but one oddity is that I discovered that `AdmissionRequest` gets this same tuple as the less capable `metav1.GroupVersionKind`, so there's a silly conversion we have to do.

I tried this manually vendored in serving with KPA and things worked great.
2018-08-09 16:00:55 -07:00
Matt Moore fdf2fdcd93 Move the test resource out of `./webhook`. (#32)
This is so that other things can more naturally write tests using this same test resource.
2018-07-31 16:02:37 -07:00
Matt Moore 03fb14296d Make the fields of the AdmissionController public. (#24) 2018-07-27 21:27:36 -07:00
Matt Moore 4d4c00734e Pull the webhook from `knative/serving` into `knative/pkg`. (#23)
This pulls the Knative webhook logic (oriented around the interfaces in `knative/pkg/apis`) into `knative/pkg`.

The code is largely copied as-is, with `keep.go` excluded.  The main changes are to the test code, which in `knative/serving` still operate in terms of the serving types.

Fixes: https://github.com/knative/pkg/issues/9
2018-07-27 19:03:36 -07:00