diff --git a/go.mod b/go.mod index 88df4925cd..77b0d9c106 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( k8s.io/client-go v0.26.5 k8s.io/code-generator v0.26.5 k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 - knative.dev/eventing v0.38.1-0.20230907060413-b08285068489 + knative.dev/eventing v0.38.1-0.20230911085617-94dfb4a1caf1 knative.dev/hack v0.0.0-20230906172513-760813ad2706 knative.dev/pkg v0.0.0-20230905144417-27252a376b30 knative.dev/reconciler-test v0.0.0-20230901013135-51e7751247b7 diff --git a/go.sum b/go.sum index 8724f678ab..2e47739cc5 100644 --- a/go.sum +++ b/go.sum @@ -843,8 +843,8 @@ 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-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/eventing v0.38.1-0.20230907060413-b08285068489 h1:XTeecv4cC1XnmTCHhAXqcGyIJf69jdQNFZ8Nh//xR5s= -knative.dev/eventing v0.38.1-0.20230907060413-b08285068489/go.mod h1:V81fCtozZsKFXTLix6y0BXEguzUo+FCcJGzNfjL7JHc= +knative.dev/eventing v0.38.1-0.20230911085617-94dfb4a1caf1 h1:J2kfRX8853MwQp66v9WdLaobqtH7W0pIbE/3/ubyhMQ= +knative.dev/eventing v0.38.1-0.20230911085617-94dfb4a1caf1/go.mod h1:V81fCtozZsKFXTLix6y0BXEguzUo+FCcJGzNfjL7JHc= knative.dev/hack v0.0.0-20230906172513-760813ad2706 h1:5/b4gPIUUNqVFkDKO9AMnEkdUvZrFVqf+z3r5rJ9w/U= knative.dev/hack v0.0.0-20230906172513-760813ad2706/go.mod h1:dx0YG3YWqJu653e9tjcT0Q1ZdS9JJXLKbUhzr4EB0g8= knative.dev/pkg v0.0.0-20230905144417-27252a376b30 h1:q8OCYCux80XnBIscEUTyK9kMAM5cYhPMXlU0b77maz0= diff --git a/pkg/reconciler/broker/broker.go b/pkg/reconciler/broker/broker.go index 22265dbab3..90e9e7bac2 100644 --- a/pkg/reconciler/broker/broker.go +++ b/pkg/reconciler/broker/broker.go @@ -409,9 +409,12 @@ func (r *Reconciler) reconcileCommonIngressResources(ctx context.Context, s *cor } PropagateIngressAvailability(&b.Status, ingressEndpoints) - b.Status.SetAddress(&apis.URL{ - Scheme: "http", - Host: network.GetServiceHostname(ingressEndpoints.GetName(), ingressEndpoints.GetNamespace()), + b.Status.SetAddress(&duckv1.Addressable{ + Name: pointer.String("http"), + URL: &apis.URL{ + Scheme: "http", + Host: network.GetServiceHostname(ingressEndpoints.GetName(), ingressEndpoints.GetNamespace()), + }, }) // If there's a Dead Letter Sink, then create a dispatcher for it. Note that this is for diff --git a/pkg/reconciler/broker/broker_test_helper.go b/pkg/reconciler/broker/broker_test_helper.go index 6cfdf38d9a..343f81c2d1 100644 --- a/pkg/reconciler/broker/broker_test_helper.go +++ b/pkg/reconciler/broker/broker_test_helper.go @@ -100,19 +100,19 @@ func WithBrokerConfig(config *duckv1.KReference) BrokerOption { } // WithBrokerAddress sets the Broker's address. -func WithBrokerAddress(address string) BrokerOption { +func WithBrokerAddress(address *duckv1.Addressable) BrokerOption { return func(b *v1.Broker) { - b.Status.SetAddress(&apis.URL{ - Scheme: "http", - Host: address, - }) + b.Status.SetAddress(address) } } // WithBrokerAddressURI sets the Broker's address as URI. func WithBrokerAddressURI(uri *apis.URL) BrokerOption { return func(b *v1.Broker) { - b.Status.SetAddress(uri) + b.Status.SetAddress(&duckv1.Addressable{ + Name: &uri.Scheme, + URL: uri, + }) } } diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_lifecycle.go index ebe569271e..9bc846e89e 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_lifecycle.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_lifecycle.go @@ -74,16 +74,14 @@ func (bs *BrokerStatus) GetTopLevelCondition() *apis.Condition { // SetAddress makes this Broker addressable by setting the URI. It also // sets the BrokerConditionAddressable to true. -func (bs *BrokerStatus) SetAddress(url *apis.URL) { +func (bs *BrokerStatus) SetAddress(address *v1.Addressable) { bs.AddressStatus = v1.AddressStatus{ - Address: &v1.Addressable{ - URL: url, - }, + Address: address, } - if url != nil { + if address != nil && address.URL != nil { bs.GetConditionSet().Manage(bs).MarkTrue(BrokerConditionAddressable) - bs.AddressStatus.Address.Name = &url.Scheme + bs.AddressStatus.Address.Name = &address.URL.Scheme } else { bs.GetConditionSet().Manage(bs).MarkFalse(BrokerConditionAddressable, "nil URL", "URL is nil") } diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/test_helper.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/test_helper.go index 80b2510009..31c2c51c87 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/test_helper.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/test_helper.go @@ -61,7 +61,9 @@ func (t testHelper) ReadyBrokerStatus() *BrokerStatus { bs.PropagateIngressAvailability(t.AvailableEndpoints()) bs.PropagateTriggerChannelReadiness(t.ReadyChannelStatus()) bs.PropagateFilterAvailability(t.AvailableEndpoints()) - bs.SetAddress(apis.HTTP("example.com")) + bs.SetAddress(&duckv1.Addressable{ + URL: apis.HTTP("example.com"), + }) bs.MarkDeadLetterSinkResolvedSucceeded(eventingduckv1.DeliveryStatus{}) return bs } @@ -71,7 +73,9 @@ func (t testHelper) ReadyBrokerStatusWithoutDLS() *BrokerStatus { bs.PropagateIngressAvailability(t.AvailableEndpoints()) bs.PropagateTriggerChannelReadiness(t.ReadyChannelStatus()) bs.PropagateFilterAvailability(t.AvailableEndpoints()) - bs.SetAddress(apis.HTTP("example.com")) + bs.SetAddress(&duckv1.Addressable{ + URL: apis.HTTP("example.com"), + }) bs.MarkDeadLetterSinkNotConfigured() return bs } diff --git a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go index 970b9abbd1..3ef470c251 100644 --- a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go +++ b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go @@ -88,19 +88,19 @@ func WithBrokerConfig(config *duckv1.KReference) BrokerOption { } // WithBrokerAddress sets the Broker's address. -func WithBrokerAddress(address string) BrokerOption { +func WithBrokerAddress(address *duckv1.Addressable) BrokerOption { return func(b *v1.Broker) { - b.Status.SetAddress(&apis.URL{ - Scheme: "http", - Host: address, - }) + b.Status.SetAddress(address) } } // WithBrokerAddressURI sets the Broker's address as URI. func WithBrokerAddressURI(uri *apis.URL) BrokerOption { return func(b *v1.Broker) { - b.Status.SetAddress(uri) + b.Status.SetAddress(&duckv1.Addressable{ + Name: &uri.Scheme, + URL: uri, + }) } } diff --git a/vendor/knative.dev/eventing/test/rekt/resources/addressable/addressable.go b/vendor/knative.dev/eventing/test/rekt/resources/addressable/addressable.go index df3997e261..0c2877b596 100644 --- a/vendor/knative.dev/eventing/test/rekt/resources/addressable/addressable.go +++ b/vendor/knative.dev/eventing/test/rekt/resources/addressable/addressable.go @@ -61,3 +61,13 @@ func AssertHTTPSAddress(addr *duckv1.Addressable) error { } return nil } + +func AssertAddressWithAudience(audience string) func(*duckv1.Addressable) error { + return func(addressable *duckv1.Addressable) error { + if (addressable.Audience == nil && audience != "") || (addressable.Audience != nil && *addressable.Audience != audience) { + return fmt.Errorf("audience of address (%v) does not match expected audience %s", addressable, audience) + } + + return nil + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 39651a7282..4d4e67cede 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1062,7 +1062,7 @@ k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/eventing v0.38.1-0.20230907060413-b08285068489 +# knative.dev/eventing v0.38.1-0.20230911085617-94dfb4a1caf1 ## explicit; go 1.19 knative.dev/eventing/cmd/heartbeats knative.dev/eventing/pkg/adapter/v2