Commit Graph

65 Commits

Author SHA1 Message Date
Christoph Stäbler 0736c742cf
Add SinkAudience to SourceStatus (#2844) 2023-10-02 13:16:21 +00:00
Karthik Muraliprasad 76b4202e06
Add AuthStatus type (#2829)
* Add AuthStatus type

This commit adds a new AuthStatus type which currently contains the ServiceAccountName attribute, which is used for OIDC authentication

Signed-off-by: karthikmurali60 <karthik.murali60@gmail.com>

* Update generated code

Signed-off-by: karthikmurali60 <karthik.murali60@gmail.com>

---------

Signed-off-by: karthikmurali60 <karthik.murali60@gmail.com>
2023-09-22 12:05:12 +00:00
Abhijeet Gaurav 27252a376b
Added Audience field in duckv1.Destination (#2797)
* Added Audience field in duckv1.Destination

* generated  the DeepCopy functions to include the new field

Signed-off-by: Abhijeet Gaurav <abhijeetdav24aug@gmail.com>

* removed trailing whitespaces from both lines

Signed-off-by: Abhijeet Gaurav <abhijeetdav24aug@gmail.com>

---------

Signed-off-by: Abhijeet Gaurav <abhijeetdav24aug@gmail.com>
2023-09-05 14:44:17 +00:00
Abhijeet Gaurav 66bf5af149
Added Audience field in duckv1.Addressable (#2798)
* Added Audience field in duckv1.Addressable

* generated  the DeepCopy functions to include the new field

Signed-off-by: Abhijeet Gaurav <abhijeetdav24aug@gmail.com>

* removing one empty line

Co-authored-by: Christoph Stäbler <cstabler@redhat.com>

---------

Signed-off-by: Abhijeet Gaurav <abhijeetdav24aug@gmail.com>
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
2023-09-05 14:36:17 +00:00
Pierangelo Di Pilato 74c4be5e93
Generate kresource duck type codegen (#2754)
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2023-06-12 15:54:45 +00:00
Vishal Choudhary a170a07b34
Eventing TLS: validate that Destination.CACerts is a PEM encoded cert (#2743)
* added check to cacerts

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

* added test

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

* added csr test

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

* OR to AND

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

---------

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
2023-05-18 14:43:13 +00:00
Rahul kumar db8a353302
Add SinkCACerts to SourceStatus (#2733)
* Add SinkCACerts to SourceStatus

* add some changes (hack/update-codegen.sh)

* Update apis/duck/v1/source_types.go

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

---------

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2023-05-02 13:46:55 +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
Rahul Sawra 4835a4cb0c
Eventing TLS: update destination and Kref types (#2716)
* update destination and Kref types

* Update apis/duck/v1/destination.go

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

* update Destination in v1beta1

---------

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2023-04-04 10:08:38 +00:00
Vishal Choudhary b7f2774461
Made changes to addressable and address status. (#2713)
* changed addressable and addressstatus

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

* requested changes

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

---------

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
2023-04-03 15:12:33 +00:00
Christoph Stäbler 408ad0773f
Make SetDefaults of Destination duck type nil safer (#2670)
Signed-off-by: Christoph Stäbler <cstabler@redhat.com>

Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
2023-01-25 08:36:39 +00:00
Paul Schweigert 5569169b0c
update boilerplate date (#2539)
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
2022-06-30 22:25:31 +00:00
Pierangelo Di Pilato 2b23ad111b
Simplify URI creation in source validation tests (#2389)
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-01-12 10:19:51 -08:00
Pierangelo Di Pilato bba447088f
Validate Sink in SourceSpec (#2384)
* Validate Sink in SourceSpec

The `Sink` in `SourceSpec` is required.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Update apis/duck/v1/source_types.go

Co-authored-by: Pablo Mercado <pablo@triggermesh.com>

Co-authored-by: Pablo Mercado <pablo@triggermesh.com>
2022-01-11 08:24:14 -08:00
Pierangelo Di Pilato 552319d4f5
Add nil checks for Source types validation to be pointer receiver based (#2378)
It's better to have nil checks inside the Validate method of the
type itself instead of the type that holds a field of that type
because this allows using the types in other contexts without
the types that hold a field.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
2021-12-14 22:57:29 -08:00
Dave Protasowski a99300deff
kmap (#2354)
* move some functional map operations to it's own package

* include a new accessor helper for migrating key names

* use kmap methods

* add deprecation notices

* fix boilerplate

* Rename Accessor to OrderedLookup
2021-11-19 09:07:23 -08:00
knative-automation e61a20dd64
Update actions (#2313)
Signed-off-by: Knative Automation <automation@knative.team>
2021-10-15 12:26:13 -07:00
Ville Aikas 221312a6a0
duck cronjob (#2299) 2021-09-27 16:50:13 -07:00
Gabriel Freites 52b0e2938e
Source validation fixes (#2285)
* added error case when ceOverrides is null

* added test for empty source spec ceOverrides validation case

* added test for empty spec
2021-09-15 11:31:08 -07:00
Gabriel Freites d4505c6605
Source validation fixes (#2251)
* added basic structure for source validation

* added validation to the sources.spec.ceOverrides.extensions field

* added multi function validation acording to the spec field thats been validated

* added tests to source types validation

* added full coverage to validation cases

* updated codegen and dependencies

* fixed deepcopy not been generated + added link and explanation for the maxExtensionNameLength in cloud events

* removed extension name length because is a SHOULD not a MUST

* removed extension name length because is a SHOULD not a MUST

* fixed copyright dates on edited files

* fixed error message and header copyright year in pr comments

* fixed unnecesary method ValidateSource

* fixed pr comments

* fixed deprecated method used on apis/duck/ABOUT.md

* updated tests names to match the spec

* fixed error message

* added key keyword to test to description

* fixed extension keys validation error message
2021-09-09 09:52:59 -07:00
Matt Moore 71508fc69a
Introduce `duckv1.Pod`. (#2280)
This is mostly for symmetry since many folks that validate PodSpecable types often also want to validate `Pod`, so while `Pod` isn't as often a duck-type, the main value of this is exposing similar mechanisms to #2279 for `corev1.Pod` without folks needing to define their own `corev1.Pod` clone.
2021-09-07 19:59:33 -07:00
Matt Moore 26db1ba732
Enable using `duckv1.WithPod` with our webhook infra. (#2279)
Today you can't use `duckv1.WithPod` to author webhooks because it doesn't implement the `Validate` or `SetDefaults` methods, and that makes sense since they are (by definition) a generic encapsulation of a number of types.

However, if we could infuse `ctx` with appropriate callbacks for `Validate` and `SetDefaults` then folks can use our types, but infuse `ctx` with callbacks that perform the appropriate validation.

What I have in mind is something along these lines:

```go
return defaulting.NewAdmissionController(ctx,
	// Name of the resource webhook.
	"foo.bar.dev",

	// The path on which to serve the webhook.
	"/defaulting",

	// The resources to default.
	map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
		appsv1.SchemeGroupVersion.WithKind("Deployment"):  &duckv1.WithPod{},
		appsv1.SchemeGroupVersion.WithKind("ReplicaSet"):  &duckv1.WithPod{},
		appsv1.SchemeGroupVersion.WithKind("StatefulSet"): &duckv1.WithPod{},
		appsv1.SchemeGroupVersion.WithKind("DaemonSet"):   &duckv1.WithPod{},
		batchv1.SchemeGroupVersion.WithKind("Job"):        &duckv1.WithPod{},
	},

	// A function that infuses the context passed to Validate/SetDefaults with custom metadata.
	func(ctx context.Context) context.Context{
		return duckv1.WithPodSpecDefaulter(ctx, myFancyLogic)
	},

	// Whether to disallow unknown fields.
	false,
)
```

It is roughly equivalent for validation.
2021-09-07 16:24:33 -07:00
Francesco Guardiani 192b0c9d6e
Add KReference.Group field and ResolveGroup function (#2127)
* Add Group field and ResolveGroup function

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Remove core special case

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Copyright

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Added validation code

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Fix comment

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Add omitempty

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Moved ResolveGroup code to kref
Made ResolveGroup a util method, more than an instance method

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* New type KReferenceResolver

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Added +optional as suggested

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2021-06-15 02:27:20 -07:00
Dave Protasowski 6484377731
update boilerplate date (#2134) 2021-05-28 13:21:29 -07:00
Markus Thömmes 980a33719a
Fix revive related linting issues (#2131) 2021-05-26 01:10:28 -07:00
Scott Nichols 7101e9d4f6
allow the addressable ducktype to act as an ownerref (#1999)
* allow the addressable ducktype to act as an ownerref

* lint
2021-01-24 12:34:54 -08:00
Ville Aikas 273ba59a11
move fuzzers (#1852)
* move fuzzers

Signed-off-by: Ville Aikas <vaikas@vmware.com>

* fix the imports

Signed-off-by: Ville Aikas <vaikas@vmware.com>

* oooook
2020-10-27 05:15:33 -07:00
Ville Aikas fb7f15ff41
add fuzzers (#1770)
* add fuzzers

* fix boilerplate

* fuzz conditions
2020-10-07 08:02:20 -07:00
capri-xiyue b3f27fd930
move binding duck to v1 (#1774)
* move biding duck to v1

* fixed naming
2020-10-06 10:24:21 -07:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07:00
Markus Thömmes 5fbbde31b3
Align linters with serving (enables stylecheck and asciicheck) (#1738) 2020-09-23 07:37:40 -07:00
Victor Agababov 473bba04ee
Fix comment to ensure we tell the truth to the world (#1601)
* Make sure GetCondition actually returns the condition

otherwise we return the temp object that loop variable points at.

* comment

* fix

* meh

* update
2020-08-10 15:35:05 -07:00
Ville Aikas cb1281d05c
make the rt error message clearer (#1492) 2020-07-14 16:31:32 -07:00
Ignacio (Nacho) Cano 27fe4e1910
Promoting Binding to v1beta1 (#1483)
* binding to v1beta1

* improving coverage
2020-07-14 08:34:19 -07:00
Alvaro Aleman 22502028e3
Avoid importing apis/duck from apis/duck/<<version>> (#1388) 2020-07-10 17:49:37 -07:00
Victor Agababov 08a86da47d
User variadic version and remove nil (#1361)
* User variadic version and remove nil

Update duck/status to use new version of UnionMaps

* comment
2020-05-28 12:03:00 -07:00
Victor Agababov 7893fe6758
Fix beta duck conversion & omit conversion if nil (#1359) 2020-05-26 13:52:50 -07:00
Victor Agababov c48d2ebdae
Add Status.Annotations to the conversion workflow (#1357) 2020-05-26 12:46:49 -07:00
Ville Aikas 870993f63e
add Status.Annotations field (#1317)
* add Status.Annotations field

* add to v1beta1 in case folks use those for making roundtripping / conversion work

* forgot to run update-codegen
2020-05-22 14:22:44 -07:00
Weston Haught db40bcad49
Simplify the krshaped interface, just use k8s interfaces for TypeMeta and ObjectMeta (#1322)
* simplify the krshaped interface

* switch to the runtime.ObjectKind interface

* update example types
2020-05-14 09:47:00 -07:00
Weston Haught 3769cd27e5
Switch KRShaped interface to retrieve entire condition set (#1307)
* Switch interface to retrieve entire condition set

* fix method under test

* type
2020-05-06 14:53:44 -07:00
Weston Haught 1099bd14ba
Include GetTopLevelConditionType for KRShaped (#1298)
* Include GetHappyConditionType for KRShaped

* Rename to GetTopLevelCondition
2020-05-05 14:22:44 -07:00
Weston Haught 0605de9264
Make example types KRShaped (#1288)
* make pkg example types KRShaped

* Fix comments

* Switch to the ObjectMeta standard accessor

* Keep pointers around
2020-05-05 10:50:44 -07:00
Weston Haught 4a2ba059b0
Create an interface for retrieving duck-type fields (#1275)
* Split KResource into a file. Include an interface.

* Update apis/duck/v1/kresource_type.go

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* type

* rename to KRShaped

Co-authored-by: Matt Moore <mattmoor@vmware.com>
2020-05-04 11:09:43 -07:00
Victor Agababov 8ddda31a35
Some fixes we did in server upstream to pkg (#1244)
* Some fixes we did in server upstream to pkg

- reduce formatting calls where they are not necessary
- remove casts where they are not necessary
- switch to consts where possible.

* nit

* 1more
2020-04-24 15:03:49 -07:00
Ignacio (Nacho) Cano 381424b197
add CloudEventAttributes to duckv1.SourceStatus (#1165) 2020-03-20 09:08:22 -07:00
Dave Protasowski d771641c91
Fixed #1057 - Rename ConvertUp/Down to ConvertTo/From (#1122) 2020-02-24 09:44:08 -08:00
Matthias Wessendorf d8b36f3593
💄 updating comment on Destination, because it's no longer a domain name, but merely a URI (#1094)
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
2020-02-13 23:31:40 -08:00
Victor Agababov 8c2e0012c3
No reason to get parent NS if we're not gonna use it. (#1055)
and add a comment for the public method
2020-02-06 09:42:32 -08:00
Ville Aikas 4ec5e09f71
check KReference namespace matches parent. Allow escape hatch. (#1052) 2020-02-05 08:04:31 -08:00