Commit Graph

35 Commits

Author SHA1 Message Date
Dave Protasowski 8535fcc248
gofumpt the repo (#3067)
* gofumpt the repo

* don't prefix numbers with 0 - otherwise they're octal
2024-06-25 07:27:07 +00:00
Christoph Stäbler 339c22b821
Add AuthenticatableType duck type (#3056)
* Add AuthenticatableType

* Add Resolver for AuthenticatableType

* Run gofmt and goimports

* Fix linter issues
2024-06-14 13:52:39 +00:00
cola 833dd976f1
prioritize destination CA certs over resolved addressable CA certs (#2849)
Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>
2023-10-03 14:11:02 +00:00
Christoph Stäbler 0efc1bce35
Also return Audience in URIResolver.AddressableFromDestinationV1() (#2836) 2023-09-25 08:57:24 +00:00
Vishal Choudhary 300df436f9
Eventing TLS: Added AddressableFromDestination method on the resolver (#2717)
* Added AddressableFromDestination method

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* requested changes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added requested change

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added changes from pierDipi

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fixes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fixes in tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added changes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added return

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fixing errors

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated tests for ref

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added null pointer fix

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

---------

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
2023-04-20 07:15:39 +00:00
Dave Protasowski 8532ae0645
update OWNERS files to use teams with active members (#2672)
* update OWNERS files to use teams with active members

* add eventing-wg leads as approvers to /apis
2023-02-06 16:58:45 +00:00
Pierangelo Di Pilato 3ba5d72e31
Don't discard addressable resolver original errors (#2395)
Errors from the tracker or the addressable resolver factory
are discarded which isn't helpful for debugging since the
error is generic `kafkachannels "Lister" not found`.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-01-21 01:23:05 -08:00
Matt Moore e957ee54fa
Drop several deprecated APIs. (#2228) 2021-08-30 13:25:54 -07:00
Lionel Villard a7f5b39b89
Addressable resolver now accepts custom resolvers (#2195)
* addressable resolver now accepts custom resolvers

* apply comments from review

* add comment about ignoring error
2021-08-26 07:21:32 -07:00
Matt Moore 766b8f7bd2
Have the addressable resolver take a tracker. (#2220)
I noticed in a few places downstream that reconcilers were creating both trackers and Addressable resolvers, which seems superfluous.  As part of examining the way we use the tracker, I'm experimenting with changing this to just take a tracker.
2021-08-21 13:50:34 -07:00
Shashankft9 64ab22bbaa
k8s-service-trailing-slash-fix (#2178) 2021-07-31 00:28:40 -07:00
Ben Moss dd15eb0998
URIResolver verifies that services actually exist (#2149) 2021-06-11 01:23:43 -07:00
Dave Protasowski eaa823c765
bump k8s to v1.20.7 (#2145)
* bump k8s deps to v1.20.7

* fix migrator test pkg

* dynamicclient now expects List types to be declare either via a scheme or manually

* fix error message comparison

* drop excess vendor licenses

* Using the injection fake dynamic client will preserve pre-1.20 behaviour

This is accomplished by preprocessing the scheme/fixtures and declaring
a custom scheme were we map our types & lists to unstructured.* types

* revert webhook factory changes

* ensure objects to the dynamic client are unstructured

* seed the default dynamic client with k8s scheme

* include duckv1 types in default fake dynamic client scheme

* use default k8s scheme
looks like eventing adds to this scheme but we should import the correct one vs the one from the  fake package

* drop duckv1 from default scheme

* set APIVersion/Kind if empty

* refactor ToUnstructured helper to a new package
2021-06-10 06:56:43 -07:00
Mona Borham 37b289bab1
Allow URIs to be resolved without reconciler context (#2095) 2021-05-10 05:35:59 -07:00
Victor Agababov 188df22c59
Some small changes for the URL test (#1910)
I was looking at the #923 (it'll be quite some effort to get the
informer there, or create dynamic one for k8s services),
but nonetheless clean the test up.

- Rename the getters to exclude word get (as go style suggests).
- The errors test contains only errors, so stream line it
- Ensure errors are also idempotent, which wasn't.
2020-11-16 13:44:03 -08:00
Matt Moore 2bc79285d2
Use the network.GetServiceHostname helper (#1844) 2020-10-26 09:55:41 -07:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07: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
Lukas Berk 34829c0aee
Alter URIFromObjectReference to return apierrs (#1688)
* Return an apimachinery error if psbinding subject WithContext fails

In the event a subject's `WithContext()` call fails, then
ReconcileSubject fails without catching the proper
error (sinkbinding's WithContext returns its own custom errors).  This
can manifest itself in instances where the sinkbinding subject has
been deleted before the sinkbinding itself, and leaves the reconcile
deletion loop stuck before the finalizer can be removed.  Leaving the
sinkbinding itself stuck, despite the subject already being deleted.

* Alter URIFromObjectReference to return apierrs

This allows for reconcile deletion to properly remove finalizer and
delete sinkbinding

* Update Tests

* Drop unneeded Sprintf
2020-09-09 10:25:50 -07:00
Victor Agababov 5ba6c1d101
Change %v to %w in errors and other nits (#1252)
* Change %v to %w in errors and other nits
Other are things I noticed when fixing the main %v->%w conversion

* fold
2020-04-27 15:04:51 -07:00
Markus Thömmes 689dff7dc0
Replace deprecated 'Track' with 'TrackReference'. (#1198) 2020-04-06 08:15:19 -07:00
Ville Aikas 95163c65ac
Rename KnativeReference to KReference (#1039) 2020-02-03 12:58:30 -08:00
Ville Aikas 99abcc2ff5
add SetDefaults from parent (using context), change Destination to us… (#1031)
* add SetDefaults from parent (using context), change Destination to use KnativeReference

* address pr comments, change address resolver to use kref
2020-02-01 11:59:29 -08:00
Victor Agababov 8eb13fa842 Some cleanups in the URI tests (#914)
As referenced in the previous PRs

/assign @vaikas mattmoor
2019-11-28 13:42:22 -08:00
Ville Aikas cac31abb7f Change URIFromDestinationV1 to return apis.URL instead of string (#909) 2019-11-27 13:13:22 -08:00
Ville Aikas 9a81fcece3 Resolvev1destination (#905)
* support v1.Destination

* rebase

* remove leftover crud from rebase

* address pr feedback

* moar feedback from pr
2019-11-26 14:00:21 -08:00
Matt Moore 43ca049cdb Reduce the boilerplate for setting up duck.InformerFactory's. (#896)
This augments the injection codegen with the capability to produce a duck.InformerFactory
attached to context for each type that we process.

Now a `duck.InformerFactory` for "Addressable" can be produced by "Get"ing it from the context.

This is triggered by placing `// +genduck` on the type that implements `duck.Implementable`.
2019-11-25 09:57:10 -08:00
Matt Moore 285df36be4 Move Destination under knative.dev/pkg/apis/duck/v1. (#851)
Destination sits in a strange versioned directory without a group under APIs.  Destination is in fact part of our duck type space, so it belongs under the `duck` group.  This moves the definition (previously v1alpha1) to `v1` because it is referenced from source types that have been designated `v1`.
2019-11-06 15:59:02 -08:00
mattmoor-sockpuppet 7dc1697d41 golang format tools (#804)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign mattmoor
2019-10-25 07:08:35 -07:00
capri-xiyue a9458a30c0 add DeprecatedObjectReference in Destination to support backwards compatibility (#790)
* added DeprecatedObjectReference as a field in Destination to support backwards compatible

* updated code-gen

* added four deprecated fields
2019-10-24 12:55:34 -07:00
mattmoor-sockpuppet 2d54fc909d golang format tools (#791)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign mattmoor
2019-10-23 13:37:29 -07:00
capri-xiyue 5dcae770a9 change Destination api and addressable resolver, fixed unit tests and… (#774)
* change Destination api and addressable resolver, fixed unit tests and added more unit tests

* make validateDestination visible

* rename error msg, added comments, added unit tests

* reformat error msg and change positive case order

* modified error msg when ref is not valid

* fixed typo
2019-10-21 14:42:25 -07:00
Markus Thömmes b55b842259 Adjust tracker to take structured keys as well. (#706)
* Use structured keys in the tracker.

* Adjust the addressable resolver too.
2019-09-20 09:44:06 -07:00
Spencer Peterson 2e33eeae84 Test for and fix URIResolver being idempotent (#606)
* write test for modify original

* test idempotency in an easier way

* and fix the bug
2019-08-27 10:43:39 -07:00
Spencer Peterson 39a29cf1bf Resolver package for resolving addressables to URI (#578)
* addressable resolver and tests

* lint

* update deps

* fix dependency loop

* rebrand package

* 2019 copyright

* note that k8s services are not verified

* rebrand to URIResolver

* correct fmt for error type

* upstream cluster domain resolution

* eliminate eventing import

* fix issues

* errorf -> errors new

* document newuriresolver

* break up returning paths

* move cluster domain name resolution to pkg/network
2019-08-23 15:15:14 -07:00