Skip to content

Commit

Permalink
upgrade to latest dependencies (#294)
Browse files Browse the repository at this point in the history
bumping knative.dev/networking a3fa3a5...75dcd54:
  > 75dcd54 upgrade to latest dependencies (# 827)
bumping knative.dev/serving 294cb9c...f1617ef:
  > f1617ef upgrade to latest dependencies (# 14188)
  > fcf7ba2 Update net-kourier nightly (# 14186)
bumping knative.dev/client-pkg e9d838e...bd83cf4:
  > bd83cf4 upgrade to latest dependencies (# 101)
bumping knative.dev/eventing 034bec9...248a471:
  > 248a471 Eventing TLS: Configure CRDs to have addresses and CA certs (# 7105)
  > d2ce623 [main] Upgrade to latest dependencies (# 7109)
  > 6bfc2d4 [main] Format Go code (# 7108)
  > 855fbed Auto create events in channels (# 7089)
  > 0054bf3 Eventing TLS: Configure certificates to force rotate private keys (# 7104)
  > 6911db0 Tag line proposal (# 7045)
  > a13eebe [main] Upgrade to latest dependencies (# 7100)
  > a755429 Re-enable PingSource TLS E2E test (# 7082)
  > de75496 Function CopySecretWithName for creating secrets with specific name (# 7002)
  > 6833ee6 Convert tls secret names to constants (# 7086)
  > 90721ab [main] Update community files (# 7088)
  > 4541f4f [main] Update community files (# 7087)
  > ed05a35 Revert "Add loopclosure linter" (# 7083)
  > 838274e [main] Upgrade to latest dependencies (# 7078)
  > a4f0c10 [main] Update community files (# 7085)
  > afcf60b Move ingress & filter TLS secret names into constants (# 7081)
  > 1e96c78 feat!: Add tls support for ingress (# 6986)
  > 6a0495c Add loopclosure linter (# 7079)
  > 2fe1db6 Updated mtping TLS cert test to bind to free port (# 7036)
  > 516a915 Upgrade rekt to latest (# 7076)
  > 6a890e0 Fix flaky unit tests (# 7080)
  > eaf28a7 Add tracing for TestBrokerWithManyTriggers (# 7077)
  > f5b1b12 Send namespace header in MT components (# 7048)
  > 4b5fde8 [main] Update community files (# 7043)
  > 8f74094 Add handler to auto create Event Types (# 7034)
  > 901ef61 Remove check for empty Namespace on resolver (# 7040)
  > 95cdbaa We should not limit the EventType creation from the Sources Duck to just brokers (# 7032)
  > 7429761 Adjust the Namespace reference to the one from the parent (# 7035)
  > cb2a891 update the redeployment script (# 7038)
  > ab01938 [main] Upgrade to latest dependencies (# 7025)
  > c9dcaf3 Added basic gc loop to kncloudevents clients map (# 6997)
  > d6cf96d EventType works with channel (# 7023)
  > 365d0b0 Run TLS e2e tests only when Istio is not enabled (# 7029)
  > 825a237 Update IMC CRD addressstatus to include `.name` and `.CACerts` fields (# 7026)
  > 3190df7 Tracking/reconcile KResource references (# 7014)
  > 0f68861 Rename more to Resource, instead of broker (# 7022)
  > bccb7d4 Better reflecting the lifecycle of event type … (# 7019)
  > 49d4acd Skip ping source TLS rekt test, since extremely flaky (# 7016)
  > 8719e18 [main] Upgrade to latest dependencies (# 7012)
  > e5ae717 Use HTTP POST when terminating istio proxy (# 7015)
  > fea730f Only check if the reference does exist (# 7010)
  > 631f4ec Add TLS support for mt-broker-filter (# 6940)
  > 45f0a19 Allow wathola components to run with Istio  (# 7011)
  > 65f4b1c [main] Format Go code (# 7008)
  > 3267b1a test SinkBinding with eventshub TLS receiver as sink (# 6979)
  > aad53f4 Updated eventingtls test certs to support IP addresses (# 7006)
  > 57d78e0 [main] Update community files (# 7004)
  > dfb2243 Support TLS in Trigger and Channel reconciler (# 6988)
  > df08b49 Eventing TLS: verify APIServerSource and PingSource sinkURI is https (# 6987)
  > d21c1aa [main] Upgrade to latest dependencies (# 6989)
  > 70113e8 Deprecate broker field and use KReference for the broker instead (# 6870)
  > 4e4647f test update to newest version (# 6990)
  > 870ac6b Update MessageDispatcher and FanoutMessageHandler to support sending events to TLS endpoints (# 6983)
  > 6dd5d58 Test PingSource with eventshub TLS receiver as sink (# 6965)
  > 55f4f28 [main] Upgrade to latest dependencies (# 6982)
  > 2a5a9a5 Add more items in the development getting started documentation (# 6978)
  > 59118a0 imc-dispatcher starts a TLS server, accepts host based routing on http receiver and path based routing on https receiver (# 6954)
  > ee49ada Rework kncloudevents library to support multiple clients (# 6975)
  > ee88094 Make ServerManager independent from kncloudevents package (# 6980)
  > 6a11c5f [main] Upgrade to latest dependencies (# 6969)
  > 8a9a532 Updated DEVELOPMENT.md to provide better instructions on setting up kubernetes (# 6977)
  > 390a0c8 Eventing TLS: Test ContainerSource with eventshub TLS receiver as sink (# 6957)
  > 5e245ac Fix flaky PingSource TLS unit test (# 6970)
  > f9f27c9 Use random names in Channel tests (# 6967)
  > d4609a5 Do not parse flags in InitializeEventingFlags (# 6966)
  > ef68a0a [main] Update community files (# 6968)
  > 4adc287 Add transport-encryption prerequisite for Addressable tests (# 6964)
  > deb0ef4 Add field for subscribers & replys CA certs to `SubscriberSpec` and `SubscriptionStatusPhysicalSubscription` (# 6959)
  > b81082c Eventing TLS: Test ApiServerSource with eventshub TLS receiver as sink (# 6956)
  > cdff269 Adding source duck type to v1b2 (# 6962)
  > b47b4ec [main] Upgrade to latest dependencies (# 6958)
  > 3315c20 Provide Channels CACerts in Brokers status annotation (# 6952)
  > 4b9fdef [main] Upgrade to latest dependencies (# 6955)
  > da31970 Improve cert-manager resources for Eventing TLS certs provisioning (# 6953)
  > fc5befb Provide subscribers CACerts in triggers status (# 6951)
  > 1efab19 Using v1b2 in the reconciler (# 6949)
  > c44671c Updating rekt test resources for EventType v1b2 (# 6946)
  > e31eb1f Adding testingv1b2 for eventtype (# 6944)
  > a9908ef Support TLS in PingSource (# 6929)
  > df559c0 Fix typo in flags.IsDisbledTransportEncryption name (# 6941)
  > 7073cc9 [main] Upgrade to latest dependencies (# 6939)
  > c6bc9bb Eventing TLS: Support K_CA_CERTS env variable injection for SinkBinding subjects (# 6931)
  > 24fbfe5 Eventing TLS: support exposing https address in Broker controller (# 6930)
  > d18cb42 Add information about retryable error in servermanager (# 6921)
  > f92a05b Added Support for K_CA_CERTS in the heartbeats (# 6920)
  > b8b43d0 Remove CA certs empty and non nil check, use URL scheme only (# 6928)
  > 3c8cc05 Return error directly if one receiver of servermanager fails (# 6919)
  > 92ab7f8 [main] Upgrade to latest dependencies (# 6927)
  > 5c6fe57 two more for reducing to debug, instead of info (# 6922)
  > 6cf9397 less verbose logs on scheduler component  (# 6912)
  > 69918f2 Adds ServerManager. Supports http/https message receivers (# 6908)
  > d58e259 Install ko using setup-ko in kind e2e tests (# 6910)
  > 9cdea5d Eventing TLS: Added Support for setting K_CA_CERTS in the ApiServerSource controller for the adapter (# 6897)
  > add8436 Eventing TLS: support exposing https address in InMemoryChannel controller (# 6881)
  > 59cfb6d [main] Upgrade to latest dependencies (# 6906)
  > 03f2a3d Remove unused test helper (# 6907)
  > 7a90c46 Remove eventing-natss from downstream tests (# 6905)
  > ba2550b [main] Upgrade to latest dependencies (# 6904)
  > 999eead More EventType v1beta2 work (# 6903)
  > 66e8257 Remove sanitize HTTP body for `knativeerrordata` extension (# 6902)
  > cd50d27 [main] Format Go code (# 6898)
  > 0f0a82c [main] Update community files (# 6901)
  > 7f4deb5 EventType v1b2 API addition (# 6893)
  > 1f917d0 Refactor PingSource adapter client creation (# 6880)
  > e2f1c77 [main] Update community files (# 6896)
  > 6a5c7ee Eventing TLS: migrate all resolver.URIResolver usages over to AddressableFromDestinationV1 (# 6883)
  > 0a12a6c Adds path based routing to message_receiver pkg (# 6873)
bumping knative.dev/pkg 5ef4812...aef227e:
  > aef227e upgrade to latest dependencies (# 2767)
  > 7051d30 Update community files (# 2764)
  > b7a11d4 Update community files (# 2763)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Jul 27, 2023
1 parent b21ac60 commit 0989604
Show file tree
Hide file tree
Showing 33 changed files with 776 additions and 61 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ require (
k8s.io/api v0.26.5
k8s.io/apimachinery v0.26.5
k8s.io/client-go v0.26.5
knative.dev/client-pkg v0.0.0-20230712132715-e9d838e71fa4
knative.dev/client-pkg v0.0.0-20230726202841-bd83cf476909
knative.dev/hack v0.0.0-20230712131415-ddae80293c43
knative.dev/networking v0.0.0-20230712132514-a3fa3a5f3624
knative.dev/serving v0.37.1-0.20230713131514-294cb9c08b37
knative.dev/networking v0.0.0-20230718160410-75dcd54d9510
knative.dev/serving v0.38.0
)

require (
Expand Down Expand Up @@ -116,8 +116,8 @@ require (
k8s.io/klog/v2 v2.80.2-0.20221028030830-9ae4992afb54 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect
knative.dev/eventing v0.37.0 // indirect
knative.dev/pkg v0.0.0-20230710013638-5ef4812a4fe9 // indirect
knative.dev/eventing v0.38.0 // indirect
knative.dev/pkg v0.0.0-20230718152110-aef227e72ead // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -891,18 +891,18 @@ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+O
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/client-pkg v0.0.0-20230712132715-e9d838e71fa4 h1:/7F60Oid9+UQIyORKtTphECrU7l1kUL2yQsMJW6/E1Y=
knative.dev/client-pkg v0.0.0-20230712132715-e9d838e71fa4/go.mod h1:oYnznlTBCj/bVEHo5vUSM/VS3oDFNJKDmH5+k1aC9/8=
knative.dev/eventing v0.37.0 h1:OtX8B9nvUSTNcbbpoNFDyeGaGU/5+aetj94i6oATpQU=
knative.dev/eventing v0.37.0/go.mod h1:62baPXiw5GPpPyV3f0GF64X7tOjc5x9cg64RAh1gjs4=
knative.dev/client-pkg v0.0.0-20230726202841-bd83cf476909 h1:tn75M7CVM0eSg4nH0yxA0tqA/g9O7pT1518mZS3VCFI=
knative.dev/client-pkg v0.0.0-20230726202841-bd83cf476909/go.mod h1:TuCXbcV3spDkZ3nGefq83OuLaICpfVpRJpegmYH9FfE=
knative.dev/eventing v0.38.0 h1:n6/k9IJ1kOvpZx4CMLqa1FG7g2iBiyKXwBu1Fy/81q4=
knative.dev/eventing v0.38.0/go.mod h1:JUqEC0zoyfYqhRHFz8VUxjkxH9G1cQ/Y+UvhXTxUXgI=
knative.dev/hack v0.0.0-20230712131415-ddae80293c43 h1:3SE06uNfSFGm/5XS+0trbyCUpgsOaBeyhPQU8FPNFz8=
knative.dev/hack v0.0.0-20230712131415-ddae80293c43/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20230712132514-a3fa3a5f3624 h1:jbU4fus3KQnmjs5IdRBDVurxnWWmBH285pQCpE6Fsn4=
knative.dev/networking v0.0.0-20230712132514-a3fa3a5f3624/go.mod h1:B7E9YnbdPCLAHy9aYpBvKkMzddpIQgKTdn2XcoDZAXU=
knative.dev/pkg v0.0.0-20230710013638-5ef4812a4fe9 h1:2T60dQFvSz7MS0M2pgLNMbxtv4Rn2zskjQH8kB/wTkg=
knative.dev/pkg v0.0.0-20230710013638-5ef4812a4fe9/go.mod h1:eXobTqst4aI7CNa6W7sG73VhEsHGWPSrkefeMTb++a0=
knative.dev/serving v0.37.1-0.20230713131514-294cb9c08b37 h1:tzEO9XdOvGlPj9jAa61BlSi3Gq7SQ5pVnWWntVv74P4=
knative.dev/serving v0.37.1-0.20230713131514-294cb9c08b37/go.mod h1:KzM8JVJDX87Mx4ACwG3R3TypDYiZgz6PZOdnyIcPwi8=
knative.dev/networking v0.0.0-20230718160410-75dcd54d9510 h1:eNbWjEkbtGjCqK5TB4S0CjSSDd4PvyXm+w7bM9/zce4=
knative.dev/networking v0.0.0-20230718160410-75dcd54d9510/go.mod h1:Vngl91M++hqgoGNIjCii7MXnsEeN3kRbGC1aodhFqbk=
knative.dev/pkg v0.0.0-20230718152110-aef227e72ead h1:2dDzorpKuVZW3Qp7TbirMMq16FbId8f6bacQFX8jXLw=
knative.dev/pkg v0.0.0-20230718152110-aef227e72ead/go.mod h1:WmrwRV/P+hGHoMraAEfwg6ec+fBTf+Obu41v354Iabc=
knative.dev/serving v0.38.0 h1:h2PLGbhXmE1P2jB5ozjnXT6CagadMykaJW4Q/dhv0os=
knative.dev/serving v0.38.0/go.mod h1:3/KPMVdVOZSHdrRhvelLuxuO+Ftln2ZTKq8R3gUu6Gw=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
22 changes: 22 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,26 @@ type DeliveryStatus struct {
// where failed events are sent to.
// +optional
DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
// DeadLetterSinkCACerts are Certification Authority (CA) certificates in PEM format
// according to https://www.rfc-editor.org/rfc/rfc7468.
// +optional
DeadLetterSinkCACerts *string `json:"deadLetterSinkCACerts,omitempty"`
}

func (ds *DeliveryStatus) IsSet() bool {
return ds.DeadLetterSinkURI != nil
}

func NewDeliveryStatusFromAddressable(addr *duckv1.Addressable) DeliveryStatus {
return DeliveryStatus{
DeadLetterSinkURI: addr.URL,
DeadLetterSinkCACerts: addr.CACerts,
}
}

func NewDestinationFromDeliveryStatus(status DeliveryStatus) duckv1.Destination {
return duckv1.Destination{
URI: status.DeadLetterSinkURI,
CACerts: status.DeadLetterSinkCACerts,
}
}
10 changes: 10 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/duck/v1/subscribable_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@ type SubscriberSpec struct {
// SubscriberURI is the endpoint for the subscriber
// +optional
SubscriberURI *apis.URL `json:"subscriberUri,omitempty"`
// SubscriberCACerts is the Certification Authority (CA) certificates in PEM
// format according to https://www.rfc-editor.org/rfc/rfc7468 for the
// subscriberUri
// +optional
SubscriberCACerts *string `json:"subscriberCACerts,omitempty"`
// ReplyURI is the endpoint for the reply
// +optional
ReplyURI *apis.URL `json:"replyUri,omitempty"`
// ReplyCACerts is the Certification Authority (CA) certificates in PEM
// format according to https://www.rfc-editor.org/rfc/rfc7468 for the
// replyUri.
// +optional
ReplyCACerts *string `json:"replyCACerts,omitempty"`
// +optional
// DeliverySpec contains options controlling the event delivery
// +optional
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/eventing/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const (
// annotation key used to specify the address of its channel.
BrokerChannelAddressStatusAnnotationKey = "knative.dev/channelAddress"

// BrokerChannelCACertsStatusAnnotationKey is the broker status annotation
// key used to specify the channels Certification Authority (CA)
// certificates in PEM format according to
// https://www.rfc-editor.org/rfc/rfc7468
BrokerChannelCACertsStatusAnnotationKey = "knative.dev/channelCACerts"

// BrokerChannelAPIVersionStatusAnnotationKey is the broker status
// annotation key used to specify the APIVersion of the channel for
// the triggers to subscribe to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"knative.dev/pkg/apis"
v1 "knative.dev/pkg/apis/duck/v1"

eventingduck "knative.dev/eventing/pkg/apis/duck/v1"
)

const (
Expand Down Expand Up @@ -81,6 +83,7 @@ func (bs *BrokerStatus) SetAddress(url *apis.URL) {

if url != nil {
bs.GetConditionSet().Manage(bs).MarkTrue(BrokerConditionAddressable)
bs.AddressStatus.Address.Name = &url.Scheme
} else {
bs.GetConditionSet().Manage(bs).MarkFalse(BrokerConditionAddressable, "nil URL", "URL is nil")
}
Expand All @@ -103,17 +106,17 @@ func (bs *BrokerStatus) InitializeConditions() {
bs.GetConditionSet().Manage(bs).InitializeConditions()
}

func (bs *BrokerStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSinkURI *apis.URL) {
bs.DeadLetterSinkURI = deadLetterSinkURI
func (bs *BrokerStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSink eventingduck.DeliveryStatus) {
bs.DeliveryStatus = deadLetterSink
bs.GetConditionSet().Manage(bs).MarkTrue(BrokerConditionDeadLetterSinkResolved)
}

func (bs *BrokerStatus) MarkDeadLetterSinkNotConfigured() {
bs.DeadLetterSinkURI = nil
bs.DeliveryStatus = eventingduck.DeliveryStatus{}
bs.GetConditionSet().Manage(bs).MarkTrueWithReason(BrokerConditionDeadLetterSinkResolved, "DeadLetterSinkNotConfigured", "No dead letter sink is configured.")
}

func (bs *BrokerStatus) MarkDeadLetterSinkResolvedFailed(reason, messageFormat string, messageA ...interface{}) {
bs.DeadLetterSinkURI = nil
bs.DeliveryStatus = eventingduck.DeliveryStatus{}
bs.GetConditionSet().Manage(bs).MarkFalse(BrokerConditionDeadLetterSinkResolved, reason, messageFormat, messageA...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package v1
import (
corev1 "k8s.io/api/core/v1"

eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"

eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1"
)

type testHelper struct{}
Expand Down Expand Up @@ -61,7 +62,7 @@ func (t testHelper) ReadyBrokerStatus() *BrokerStatus {
bs.PropagateTriggerChannelReadiness(t.ReadyChannelStatus())
bs.PropagateFilterAvailability(t.AvailableEndpoints())
bs.SetAddress(apis.HTTP("example.com"))
bs.MarkDeadLetterSinkResolvedSucceeded(nil)
bs.MarkDeadLetterSinkResolvedSucceeded(eventingduckv1.DeliveryStatus{})
return bs
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ type TriggerStatus struct {
// +optional
SubscriberURI *apis.URL `json:"subscriberUri,omitempty"`

// SubscriberCACerts is the Certification Authority (CA) certificates in PEM format
// according to https://www.rfc-editor.org/rfc/rfc7468 of the receiver for this Trigger.
// +optional
SubscriberCACerts *string `json:"subscriberCACerts,omitempty"`

// DeliveryStatus contains a resolved URL to the dead letter sink address, and any other
// resolved delivery options.
eventingduckv1.DeliveryStatus `json:",inline"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,71 @@ package v1beta1

import (
"context"
"fmt"

duckv1 "knative.dev/pkg/apis/duck/v1"

"knative.dev/eventing/pkg/apis/eventing/v1beta2"

"knative.dev/pkg/apis"
)

// ConvertTo implements apis.Convertible
func (source *EventType) ConvertTo(ctx context.Context, to apis.Convertible) error {
return fmt.Errorf("v1beta1 is the highest known version, got: %T", to)
func (source *EventType) ConvertTo(ctx context.Context, obj apis.Convertible) error {
switch sink := obj.(type) {
case *v1beta2.EventType:
sink.ObjectMeta = source.ObjectMeta
sink.Status = v1beta2.EventTypeStatus{
Status: source.Status.Status,
}
sink.Spec = v1beta2.EventTypeSpec{
Type: source.Spec.Type,
Source: source.Spec.Source,
Schema: source.Spec.Schema,
SchemaData: source.Spec.SchemaData,
Description: source.Spec.Description,
}

// for old stuff, we play nice here
// default to broker, but as a reference
if source.Spec.Reference == nil && source.Spec.Broker != "" {
sink.Spec.Reference = &duckv1.KReference{
APIVersion: "eventing.knative.dev/v1",
Kind: "Broker",
Name: source.Spec.Broker,
}
}

// if we have a reference, use it
if source.Spec.Reference != nil {
sink.Spec.Reference = source.Spec.Reference
}

return nil
default:
return apis.ConvertToViaProxy(ctx, source, &v1beta2.EventType{}, sink)
}
}

// ConvertFrom implements apis.Convertible
func (sink *EventType) ConvertFrom(ctx context.Context, from apis.Convertible) error {
return fmt.Errorf("v1beta1 is the highest known version, got: %T", from)
func (sink *EventType) ConvertFrom(ctx context.Context, obj apis.Convertible) error {
switch source := obj.(type) {
case *v1beta2.EventType:
sink.ObjectMeta = source.ObjectMeta
sink.Status = EventTypeStatus{
Status: source.Status.Status,
}

sink.Spec = EventTypeSpec{
Type: source.Spec.Type,
Source: source.Spec.Source,
Schema: source.Spec.Schema,
SchemaData: source.Spec.SchemaData,
Reference: source.Spec.Reference,
Description: source.Spec.Description,
}

return nil
default:
return apis.ConvertFromViaProxy(ctx, source, &v1beta2.EventType{}, sink)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (et *EventType) SetDefaults(ctx context.Context) {
}

func (ets *EventTypeSpec) SetDefaults(ctx context.Context) {
if ets.Broker == "" {
if ets.Reference == nil && ets.Broker == "" {
ets.Broker = "default"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ type EventType struct {
// Status represents the current state of the EventType.
// This data may be out of date.
// +optional
// TODO might be removed https://github.com/knative/eventing/issues/2750
Status EventTypeStatus `json:"status,omitempty"`
}

Expand Down Expand Up @@ -77,10 +76,13 @@ type EventTypeSpec struct {
// The contents are not validated or manipulated by the system.
// +optional
SchemaData string `json:"schemaData,omitempty"`
// TODO remove https://github.com/knative/eventing/issues/2750
// Broker refers to the Broker that can provide the EventType.
// +optional
Broker string `json:"broker,omitempty"`
// Reference is a KReference to the belonging addressable.
// For example, this could be a pointer to a Broker.
// +optional
Reference *duckv1.KReference `json:"reference,omitempty"`
// Description is an optional field used to describe the EventType, in any meaningful way.
// +optional
Description string `json:"description,omitempty"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2021 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1beta2 is the v1beta2 version of the API.
// +k8s:deepcopy-gen=package
// +groupName=eventing.knative.dev
package v1beta2
Loading

0 comments on commit 0989604

Please sign in to comment.