Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Upgrade to latest dependencies #1149

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ 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.37.1-0.20230601081636-d21c1aabd392
knative.dev/hack v0.0.0-20230530201435-5b7907fbe350
knative.dev/pkg v0.0.0-20230531073936-5671699f23d9
knative.dev/reconciler-test v0.0.0-20230530092335-cf14f44032b9
knative.dev/eventing v0.37.1-0.20230628105954-4b5fde82647d
knative.dev/hack v0.0.0-20230628110129-fc42790854e8
knative.dev/pkg v0.0.0-20230628105954-6eb4b40a9a30
knative.dev/reconciler-test v0.0.0-20230628013854-710f92a76fc1
sigs.k8s.io/controller-runtime v0.14.6
)

Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,14 @@ 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.37.1-0.20230601081636-d21c1aabd392 h1:JLQXhRSHQeghPofdqDnNIaVepWi5vhRPMxikTF1jNJg=
knative.dev/eventing v0.37.1-0.20230601081636-d21c1aabd392/go.mod h1:00ZmViqsuF5wC8D9XvPGxfrT3Fb3JIaRvIzjk+3ppHo=
knative.dev/hack v0.0.0-20230530201435-5b7907fbe350 h1:lSV9uFTohrQd7i5OUhLnR87PwUHJplQKJSEiZgzP/VY=
knative.dev/hack v0.0.0-20230530201435-5b7907fbe350/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20230531073936-5671699f23d9 h1:xd7E2nuQ358cXR4jB7Y5+FH88Mm+SQTZty5pXa1TSfs=
knative.dev/pkg v0.0.0-20230531073936-5671699f23d9/go.mod h1:dqC6IrvyBE7E+oZocs5PkVhq1G59pDTA7r8U17EAKMk=
knative.dev/reconciler-test v0.0.0-20230530092335-cf14f44032b9 h1:CzG5Oo639iM2u8x6LrWNznp9b7av7poZV1OpAeJc48s=
knative.dev/reconciler-test v0.0.0-20230530092335-cf14f44032b9/go.mod h1:iB/uRML7hm+V0YvUrAxO+SSq1wg0FRi2p8aVCIjbzeo=
knative.dev/eventing v0.37.1-0.20230628105954-4b5fde82647d h1:GF9+9uKyWY32xQa4+JJzH3E2V/wdREpgjFTdMAi1b7A=
knative.dev/eventing v0.37.1-0.20230628105954-4b5fde82647d/go.mod h1:MRpJ0pRqodV9mlPvRTLXnUOo0ExPDHyEk04Zxjn3bA0=
knative.dev/hack v0.0.0-20230628110129-fc42790854e8 h1:l7CnU4IiRB0TTQAWqOSXg9MnB2bxWjx4o/Vw6Yb27eM=
knative.dev/hack v0.0.0-20230628110129-fc42790854e8/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20230628105954-6eb4b40a9a30 h1:UUjxZMKgK907IfFY3b7xj9sY53c+feiYvzUwPtajN8I=
knative.dev/pkg v0.0.0-20230628105954-6eb4b40a9a30/go.mod h1:dqC6IrvyBE7E+oZocs5PkVhq1G59pDTA7r8U17EAKMk=
knative.dev/reconciler-test v0.0.0-20230628013854-710f92a76fc1 h1:cXjeVnhmjfztS5Ol6S9o+PWllbTydFaqR0lf8F+LzVw=
knative.dev/reconciler-test v0.0.0-20230628013854-710f92a76fc1/go.mod h1:iB/uRML7hm+V0YvUrAxO+SSq1wg0FRi2p8aVCIjbzeo=
pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
5 changes: 4 additions & 1 deletion vendor/knative.dev/eventing/cmd/heartbeats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ func main() {

// maybeQuitIstioProxy shuts down Istio's proxy when available.
func maybeQuitIstioProxy() {
_, err := http.DefaultClient.Get("http://localhost:15020/quitquitquit")
req, _ := http.NewRequest(http.MethodPost, "http://localhost:15020/quitquitquit", nil)

_, err := http.DefaultClient.Do(req)

if err != nil && !errors.Is(err, syscall.ECONNREFUSED) {
log.Println("[Ignore this warning if Istio proxy is not used on this pod]", err)
}
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,
}
}

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 @@ -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 @@ -104,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 @@ -35,16 +35,26 @@ func (source *EventType) ConvertTo(ctx context.Context, obj apis.Convertible) er
Status: source.Status.Status,
}
sink.Spec = v1beta2.EventTypeSpec{
Type: source.Spec.Type,
Source: source.Spec.Source,
Schema: source.Spec.Schema,
SchemaData: source.Spec.SchemaData,
Reference: &duckv1.KReference{
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,
},
Description: source.Spec.Description,
}
}

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

return nil
Expand All @@ -67,7 +77,7 @@ func (sink *EventType) ConvertFrom(ctx context.Context, obj apis.Convertible) er
Source: source.Spec.Source,
Schema: source.Spec.Schema,
SchemaData: source.Spec.SchemaData,
Broker: source.Spec.Reference.Name,
Reference: source.Spec.Reference,
Description: source.Spec.Description,
}

Expand Down
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 @@ -79,6 +79,10 @@ type EventTypeSpec struct {
// 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.

Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ package v1beta2

import (
"context"

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

func (et *EventType) SetDefaults(ctx context.Context) {
et.Spec.SetDefaults(ctx)
setReferenceNs(et)
}

func (ets *EventTypeSpec) SetDefaults(ctx context.Context) {
if ets.Reference == nil {
ets.Reference = &duckv1.KReference{
APIVersion: "eventing.knative.dev/v1",
Kind: "Broker",
Name: "default",
}
}

func setReferenceNs(et *EventType) {
if et.Spec.Reference != nil && et.Spec.Reference.Namespace == "" {
et.Spec.Reference.Namespace = et.GetNamespace()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ limitations under the License.
package v1beta2

import (
corev1 "k8s.io/api/core/v1"

eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1"
"knative.dev/pkg/apis"
)

var eventTypeCondSet = apis.NewLivingConditionSet(EventTypeConditionBrokerExists, EventTypeConditionBrokerReady)
var eventTypeCondSet = apis.NewLivingConditionSet(EventTypeConditionReferenceExists)

const (
EventTypeConditionReady = apis.ConditionReady
EventTypeConditionBrokerExists apis.ConditionType = "BrokerExists"
EventTypeConditionBrokerReady apis.ConditionType = "BrokerReady"
EventTypeConditionReady = apis.ConditionReady
EventTypeConditionReferenceExists apis.ConditionType = "ReferenceExists"
)

// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.
Expand Down Expand Up @@ -56,49 +52,14 @@ func (et *EventTypeStatus) InitializeConditions() {
eventTypeCondSet.Manage(et).InitializeConditions()
}

func (et *EventTypeStatus) MarkBrokerExists() {
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionBrokerExists)
}

func (et *EventTypeStatus) MarkBrokerDoesNotExist() {
eventTypeCondSet.Manage(et).MarkFalse(EventTypeConditionBrokerExists, "BrokerDoesNotExist", "Broker does not exist")
}

func (et *EventTypeStatus) MarkBrokerExistsUnknown(reason, messageFormat string, messageA ...interface{}) {
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionBrokerExists, reason, messageFormat, messageA...)
}

func (et *EventTypeStatus) MarkBrokerReady() {
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionBrokerReady)
}

func (et *EventTypeStatus) MarkBrokerFailed(reason, messageFormat string, messageA ...interface{}) {
eventTypeCondSet.Manage(et).MarkFalse(EventTypeConditionBrokerReady, reason, messageFormat, messageA...)
}

func (et *EventTypeStatus) MarkBrokerUnknown(reason, messageFormat string, messageA ...interface{}) {
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionBrokerReady, reason, messageFormat, messageA...)
func (et *EventTypeStatus) MarkReferenceExists() {
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionReferenceExists)
}

func (et *EventTypeStatus) MarkBrokerNotConfigured() {
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionBrokerReady,
"BrokerNotConfigured", "Broker has not yet been reconciled.")
func (et *EventTypeStatus) MarkReferenceDoesNotExist() {
eventTypeCondSet.Manage(et).MarkFalse(EventTypeConditionReferenceExists, "ResourceDoesNotExist", "Resource in spec.reference does not exist")
}

func (et *EventTypeStatus) PropagateBrokerStatus(bs *eventingv1.BrokerStatus) {
bc := bs.GetConditionSet().Manage(bs).GetTopLevelCondition()
if bc == nil {
et.MarkBrokerNotConfigured()
return
}
switch {
case bc.Status == corev1.ConditionUnknown:
et.MarkBrokerUnknown(bc.Reason, bc.Message)
case bc.Status == corev1.ConditionTrue:
eventTypeCondSet.Manage(et).MarkTrue(EventTypeConditionBrokerReady)
case bc.Status == corev1.ConditionFalse:
et.MarkBrokerFailed(bc.Reason, bc.Message)
default:
et.MarkBrokerUnknown("BrokerUnknown", "The status of Broker is invalid: %v", bc.Status)
}
func (et *EventTypeStatus) MarkReferenceExistsUnknown(reason, messageFormat string, messageA ...interface{}) {
eventTypeCondSet.Manage(et).MarkUnknown(EventTypeConditionReferenceExists, reason, messageFormat, messageA...)
}
1 change: 1 addition & 0 deletions vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ const (
KReferenceMapping = "kreference-mapping"
NewTriggerFilters = "new-trigger-filters"
TransportEncryption = "transport-encryption"
EvenTypeAutoCreate = "eventtype-auto-create"
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package v1
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
eventingduck "knative.dev/eventing/pkg/apis/duck/v1"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"

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

var chCondSet = apis.NewLivingConditionSet(
Expand Down Expand Up @@ -131,17 +132,17 @@ func (cs *ChannelStatus) PropagateStatuses(chs *eventingduck.ChannelableStatus)
cs.SubscribableStatus = chs.SubscribableStatus
}

func (cs *ChannelStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSinkURI *apis.URL) {
cs.DeliveryStatus.DeadLetterSinkURI = deadLetterSinkURI
func (cs *ChannelStatus) MarkDeadLetterSinkResolvedSucceeded(deadLetterSink eventingduck.DeliveryStatus) {
cs.DeliveryStatus = deadLetterSink
chCondSet.Manage(cs).MarkTrue(ChannelConditionDeadLetterSinkResolved)
}

func (cs *ChannelStatus) MarkDeadLetterSinkNotConfigured() {
cs.DeadLetterSinkURI = nil
cs.DeliveryStatus = eventingduck.DeliveryStatus{}
chCondSet.Manage(cs).MarkTrueWithReason(ChannelConditionDeadLetterSinkResolved, "DeadLetterSinkNotConfigured", "No dead letter sink is configured.")
}

func (cs *ChannelStatus) MarkDeadLetterSinkResolvedFailed(reason, messageFormat string, messageA ...interface{}) {
cs.DeadLetterSinkURI = nil
cs.DeliveryStatus = eventingduck.DeliveryStatus{}
chCondSet.Manage(cs).MarkFalse(ChannelConditionDeadLetterSinkResolved, reason, messageFormat, messageA...)
}
Loading