Skip to content

Commit

Permalink
upgrade to latest dependencies (#469)
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing-redis 7e92174...e89a50a:
  > e89a50a upgrade to latest dependencies (# 550)
  > 70000bd upgrade to latest dependencies (# 549)
bumping knative.dev/pkg 1ca1f09...b8b7ca1:
  > b8b7ca1 upgrade to latest dependencies (# 3000)
bumping knative.dev/eventing 4754325...e581d36:
  > e581d36 Update eventtype v1beta3 type to reflect spec changes (# 7708)
  > 93e0c85 CrossNamespace: added brokerRef in trigger spec (# 7815)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation authored Mar 28, 2024

Unverified

This user has not yet uploaded their public signing key.
1 parent a838dea commit bf5740a
Showing 8 changed files with 86 additions and 50 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@ require (
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
k8s.io/code-generator v0.29.2
knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba
knative.dev/eventing v0.40.1-0.20240327210418-e581d36f9f2a
knative.dev/eventing-kafka v0.40.1-0.20240207142533-d23eb248d3ac
knative.dev/eventing-redis v0.40.1-0.20240327132504-7e92174dd266
knative.dev/eventing-redis v0.40.1-0.20240328131421-e89a50a6b21a
knative.dev/hack v0.0.0-20240327150553-47368d631660
knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e
knative.dev/pkg v0.0.0-20240327172111-b8b7ca1f7904
knative.dev/reconciler-test v0.0.0-20240327131444-6346b918a853
sigs.k8s.io/controller-runtime v0.13.1
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -783,16 +783,16 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba h1:uX9UsYNHJQDpqVSMVijhSljmCSLZm5ocPdQJ4jrkyig=
knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba/go.mod h1:19sfPiy4dK2jBIHgszOTk43qOvfCXz1GTIncRY3trB8=
knative.dev/eventing v0.40.1-0.20240327210418-e581d36f9f2a h1:IcopvDTfpZ57wgJnWKvaLl1ob4E9xi49Azc5yhSwUTk=
knative.dev/eventing v0.40.1-0.20240327210418-e581d36f9f2a/go.mod h1:19sfPiy4dK2jBIHgszOTk43qOvfCXz1GTIncRY3trB8=
knative.dev/eventing-kafka v0.40.1-0.20240207142533-d23eb248d3ac h1:ZchQuCUvW4Hgn/6I+SRuaPei5JDtUqQ1he44tJ728hA=
knative.dev/eventing-kafka v0.40.1-0.20240207142533-d23eb248d3ac/go.mod h1:qGgNS+zY1A3xKqJFZ3KIWeWKZHIewBS1XmpRvTNQRJA=
knative.dev/eventing-redis v0.40.1-0.20240327132504-7e92174dd266 h1:FxT0pdaO0MXS83rRFK7e5SdWRo/LSbtajd60FaNF770=
knative.dev/eventing-redis v0.40.1-0.20240327132504-7e92174dd266/go.mod h1:xLcWAwJosXprUEa/wl/MKb4c5VQq9LsV2G2b4/G1fJ4=
knative.dev/eventing-redis v0.40.1-0.20240328131421-e89a50a6b21a h1:TjVZEqChLw01VX7O3zxsPRndozrFQCR2gbitRtxZI2w=
knative.dev/eventing-redis v0.40.1-0.20240328131421-e89a50a6b21a/go.mod h1:+muolJziOLEyvsDmvv21liUIK2tyJzMk9x/7XQBZxr8=
knative.dev/hack v0.0.0-20240327150553-47368d631660 h1:tW6NgyjMnSXBS75+k+Xh5uNiLhJ9TFswS9hrkC3OQOc=
knative.dev/hack v0.0.0-20240327150553-47368d631660/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e h1:Cg28hbL35g5Qd3tC0PKSX2FMMD8IZnTYxRr4VLIUgd8=
knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e/go.mod h1:uYSh5G3A/pFmzgowpvKeyphLbXVkY4x7zEhReKwsVeU=
knative.dev/pkg v0.0.0-20240327172111-b8b7ca1f7904 h1:AT4AIwO3p1qZtmEzW5tWPftrUxts8Tlpra7EjNS/2PY=
knative.dev/pkg v0.0.0-20240327172111-b8b7ca1f7904/go.mod h1:LgcT4KPEcw24alWzzkFAN2acHq38au8NZqybU16TStI=
knative.dev/reconciler-test v0.0.0-20240327131444-6346b918a853 h1:YNnU474EU6U4iBEVGV9zZmEH/IbZIQwJ4I4OU4PHodQ=
knative.dev/reconciler-test v0.0.0-20240327131444-6346b918a853/go.mod h1:e3ZGbaE4B/7hIDyxxkEIYyGdkXB/51gMaEdH8pPpXIM=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Original file line number Diff line number Diff line change
@@ -76,8 +76,9 @@ var (
type TriggerSpec struct {
// Broker is the broker that this trigger receives events from.
Broker string `json:"broker,omitempty"`
// BrokerNamespace is the namespace of the broker that the trigger receives events from.
BrokerNamespace string `json:"brokerNamespace,omitempty"`

// BrokerRef is the broker that is used for cross-namespace referencing.
BrokerRef *duckv1.KReference `json:"brokerRef,omitempty"`

// Filter is the filter to apply against all events from the Broker. Only events that pass this
// filter will be sent to the Subscriber. If not specified, will default to allowing all events.

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
@@ -62,31 +62,28 @@ var (
)

type EventTypeSpec struct {
// Type represents the CloudEvents type. It is authoritative.
Type string `json:"type"`
// Source is a URI, it represents the CloudEvents source.
// +optional
Source *apis.URL `json:"source,omitempty"`
// Schema is a URI, it represents the CloudEvents schemaurl extension attribute.
// It may be a JSON schema, a protobuf schema, etc. It is optional.
// +optional
Schema *apis.URL `json:"schema,omitempty"`
// SchemaData allows the CloudEvents schema to be stored directly in the
// EventType. Content is dependent on the encoding. Optional attribute.
// The contents are not validated or manipulated by the system.
// +optional
SchemaData string `json:"schemaData,omitempty"`
// Broker refers to the Broker that can provide the EventType.
// Deprecated: This field is deprecated and will be removed in a future release.
// +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"`
// Attributes is an array of CloudEvent attributes and extension attributes.
Attributes []EventAttributeDefinition `json:"attributes"`
}

type EventAttributeDefinition struct {
// Name is the name of the CloudEvents attribute.
Name string `json:"name"`
// Required determines whether this attribute must be set on corresponding CloudEvents.
Required bool `json:"required"`
// Value is a string representing the allowable values for the EventType attribute.
// It may be a single value such as "/apis/v1/namespaces/default/pingsource/ps", or it could be a template
// for the allowed values, such as "/apis/v1/namespaces/{namespace}/pingsource/{sourceName}.
// To specify a section of the string value which may change between different CloudEvents
// you can use curly brackets {} and optionally a variable name between them.
Value string `json:"value,omitempty"`
}

// EventTypeStatus represents the current state of a EventType.
Original file line number Diff line number Diff line change
@@ -29,13 +29,9 @@ func (et *EventType) Validate(ctx context.Context) *apis.FieldError {

func (ets *EventTypeSpec) Validate(ctx context.Context) *apis.FieldError {
var errs *apis.FieldError
if ets.Type == "" {
fe := apis.ErrMissingField("type")
errs = errs.Also(fe)
}
// TODO validate Source is a valid URI.
// TODO validate Schema is a valid URI.
// There is no validation of the SchemaData, it is application specific data.
// TODO: validate attribute with name=source is a valid URI
// TODO: validate attribute with name=schema is a valid URI
errs = errs.Also(ets.ValidateAttributes().ViaField("attributes"))
return errs
}

@@ -60,3 +56,30 @@ func (et *EventType) CheckImmutableFields(ctx context.Context, original *EventTy
}
return nil
}

func (ets *EventTypeSpec) ValidateAttributes() *apis.FieldError {
attributes := make(map[string]EventAttributeDefinition, len(ets.Attributes))
for _, attr := range ets.Attributes {
attributes[attr.Name] = attr
}

missingFields := []string{}
if _, ok := attributes["type"]; !ok {
missingFields = append(missingFields, "type")
}
if _, ok := attributes["source"]; !ok {
missingFields = append(missingFields, "source")
}
if _, ok := attributes["specversion"]; !ok {
missingFields = append(missingFields, "specversion")
}
if _, ok := attributes["id"]; !ok {
missingFields = append(missingFields, "id")
}

if len(missingFields) > 0 {
return apis.ErrMissingField(missingFields...)
}

return nil
}

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

6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -908,7 +908,7 @@ k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba
# knative.dev/eventing v0.40.1-0.20240327210418-e581d36f9f2a
## explicit; go 1.21
knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/duck
@@ -983,14 +983,14 @@ knative.dev/eventing-kafka/test/rekt/features/kafkasource
knative.dev/eventing-kafka/test/rekt/resources/kafkacat
knative.dev/eventing-kafka/test/rekt/resources/kafkasource
knative.dev/eventing-kafka/test/rekt/resources/kafkatopic
# knative.dev/eventing-redis v0.40.1-0.20240327132504-7e92174dd266
# knative.dev/eventing-redis v0.40.1-0.20240328131421-e89a50a6b21a
## explicit; go 1.21
knative.dev/eventing-redis/pkg/source/apis/sources
knative.dev/eventing-redis/pkg/source/apis/sources/v1alpha1
# knative.dev/hack v0.0.0-20240327150553-47368d631660
## explicit; go 1.18
knative.dev/hack
# knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e
# knative.dev/pkg v0.0.0-20240327172111-b8b7ca1f7904
## explicit; go 1.21
knative.dev/pkg/apis
knative.dev/pkg/apis/duck

0 comments on commit bf5740a

Please sign in to comment.