Commit Graph

16 Commits

Author SHA1 Message Date
Prashant Rewar fef5da99bd
Replace all usages of deprecated wait.PollImmediate with wait.PollUntilContextTimeout (#3004)
Signed-off-by: Prashant Rewar <108176843+prashantrewar@users.noreply.github.com>
2024-04-02 14:44:03 +00:00
Stavros Kontopoulos 8d3f951063
Allow overriding webhook secret data keys (#2662)
* override secret data keys when creating new webhooks

* fixes

* cleanup

* use webhook options

* remove unused env var keys

* fix docs

* update opt names and refactor integration test

* fixes
2023-08-02 19:19:48 +00:00
Dave Protasowski 9bda38b216
Fix some webhook testing tech debt (#2751)
* TestRegistrationStopChanFire now uses ephemeral ports

* For TLS servers dial TLS

* have server error logs appear in zap

* log the correct error

* pass ephemeral listeners to the webhook for testing
2023-05-25 14:35:25 +00:00
Matt Moore 552bbc1061
Support the webhook serving over non-TLS. (#2204)
This reworks the way we setup the TLS Config for the webhook, so that when the `opts.SecretName` is omitted we serve over non-TLS.
2021-08-02 20:22:47 -07:00
Markus Thömmes 5f11dd0634
Add smart handling of selectors in webhooks (#1949)
* Add smart handling of selectors in webhooks

This is an alternative fix for #1590. Instead of arbitrarily adding a label from a different project to avoid the reconcilers racing, this adds "smart" handling of the selectors in that labels not inside the knative.dev domain are plainly ignored and our own selectors are added additively.

* Fix formatting

* Fix missing variable usage
2020-12-08 23:38:41 -08:00
Zbynek Roubalik 2d4efecc6b
bump to k8s 1.18 (#1428)
* bump to k8s 1.18.8

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* plumbing ctx through

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* add more ctx plumbing

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* ctx WithCancel()

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-11 07:54:00 -07:00
Matt Moore d4ce001394 This refactors our core webhook logic to be reconciler-based. (#833)
This is the culmination of a large number of changes to refactor our webhook logic, and adopt a reconciler-based approach to make it resilient to unexected system events (e.g. rogue GCs!).

For more details on how this is consumed, see the new `webhook/README.md`.

Fixes: https://github.com/knative/pkg/issues/782
Closes: https://github.com/knative/pkg/issues/529
Fixes: https://github.com/knative/pkg/issues/450
Related: https://github.com/knative/pkg/issues/141
2019-10-31 10:17:13 -07:00
Matt Moore 50398a29a7 Factor out test helpers to prepare for webhook package split. (#829) 2019-10-29 14:13:11 -07:00
Matt Moore bfff3b7d72 Switch to using GetCertificate in tls.Config. (#823)
GetCertificate allows us to start in TLS mode and dynamically fetch new certificates as they change.  This will eventually allow us to decouple the cert creation process from the core webhook logic, and in a subsequent change service this from a secret lister cache.
2019-10-28 17:32:11 -07:00
Matt Moore 763c642d3c Streamline `webhook.New`. (#821)
This now pulls most of its configuration from context, which brings it a step closer to aligning with our `sharedmain` package.
2019-10-28 16:12:11 -07:00
Matt Moore 070396a075 Eliminate the Namespace config option in favor of system.Namespace. (#817) 2019-10-28 11:41:43 -07:00
Victor Agababov 74c5d67ea0 Fix the issues pointed out by staticcheck (#541)
* Fix the issues pointed out by staticcheck

* review fix
2019-07-23 13:13:36 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Ali Ok 9f8e0692b7 #457 Duck type user annotation logic (#467)
* #457 Duck type user annotation logic

* #457 Duck type user annotation logic - tests

* #457 Revert updater annotation key from lastModifier to updater

* #457 Rename HasSpec#GetSpec() to HasSpec#GetUntypedSpec()

* #457 Fix some indentation

* #457 Get group for user info annotations from the request

* #457 Reduce confusuion in webhook testing by using same group
2019-06-24 18:20:05 -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 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