diff --git a/go.mod b/go.mod index 0b6b248f..61e842a3 100644 --- a/go.mod +++ b/go.mod @@ -13,10 +13,10 @@ require ( k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 - knative.dev/eventing v0.41.1-0.20240529130930-2a11bb8636bf + knative.dev/eventing v0.41.1-0.20240530202412-a58c1352db05 knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea knative.dev/pkg v0.0.0-20240529181700-7d52a43448b2 - knative.dev/serving v0.41.1-0.20240529171320-0b363c0d791c + knative.dev/serving v0.41.1-0.20240531003236-a2459efd3217 ) require ( diff --git a/go.sum b/go.sum index d059f157..b3ccb560 100644 --- a/go.sum +++ b/go.sum @@ -787,16 +787,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.41.1-0.20240529130930-2a11bb8636bf h1:THZuEzMxX610jEqZViqNe00KOZv+mATP9MLvspgIaZE= -knative.dev/eventing v0.41.1-0.20240529130930-2a11bb8636bf/go.mod h1:IUBpMsDIfyV5836R9PN0/VyADgoDa9ykgz7gpvTseLw= +knative.dev/eventing v0.41.1-0.20240530202412-a58c1352db05 h1:OltA5F33cPH/q88XGlqUn6Ip2p2QgTSm0SJ2cNDqXzU= +knative.dev/eventing v0.41.1-0.20240530202412-a58c1352db05/go.mod h1:toAuiWQiMPHgWcXNYocPhMNx8xYFbjQsupEiQdPT83o= knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea h1:iWW6SNMrVd2hI5Y+ltKIEzXVedoQLL86b23dS5fkvXs= knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/networking v0.0.0-20240521183848-1d0137a18a68 h1:Piy1jJ5r3pet0cJV5An69hMTKUfXmiQgfEFThaAfQlA= knative.dev/networking v0.0.0-20240521183848-1d0137a18a68/go.mod h1:LFhDu22ymaEZFnFBUoSoo4Y4l+KWXujH5yQQNOaEwBc= knative.dev/pkg v0.0.0-20240529181700-7d52a43448b2 h1:Q4xHp1Y4maNrCJQ1bATmW0LyXSsMG9KlyrDgdKHCNT8= knative.dev/pkg v0.0.0-20240529181700-7d52a43448b2/go.mod h1:GHFUP1wtD/bR/c02QADqaAK3odDJh1ddBMvXhq/goy8= -knative.dev/serving v0.41.1-0.20240529171320-0b363c0d791c h1:cGDjYQpx5ctb6ukG6nnLRty2cwBdqoYFU8vprYxzcUQ= -knative.dev/serving v0.41.1-0.20240529171320-0b363c0d791c/go.mod h1:V+1hMZueIl655axDH4IOVc6xO8/Z9Ggun/jYEpIEhOo= +knative.dev/serving v0.41.1-0.20240531003236-a2459efd3217 h1:WymQFTYry1xPttr0XHpjpZLmVDueR2z9f9mzIwBMrEw= +knative.dev/serving v0.41.1-0.20240531003236-a2459efd3217/go.mod h1:V+1hMZueIl655axDH4IOVc6xO8/Z9Ggun/jYEpIEhOo= 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= diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go index 2bdd421a..6212e245 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go @@ -18,17 +18,86 @@ package v1beta2 import ( "context" - "fmt" "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" + + eventing "knative.dev/eventing/pkg/apis/eventing/v1" + "knative.dev/eventing/pkg/apis/eventing/v1beta3" ) -// ConvertTo implements apis.Convertible +// ConvertTo converts the receiver into `to`. func (source *EventType) ConvertTo(ctx context.Context, to apis.Convertible) error { - return fmt.Errorf("v1beta2 is the highest known version, got: %T", to) + switch sink := to.(type) { + case *v1beta3.EventType: + + source.ObjectMeta.DeepCopyInto(&sink.ObjectMeta) + source.Status.Status.DeepCopyInto(&sink.Status.Status) + + sink.Spec.Reference = source.Spec.Reference.DeepCopy() + sink.Spec.Description = source.Spec.Description + + if source.Spec.Reference == nil && source.Spec.Broker != "" { + source.Spec.Reference = &duckv1.KReference{ + Kind: "Broker", + Name: source.Spec.Broker, + APIVersion: eventing.SchemeGroupVersion.String(), + } + } + + sink.Spec.Attributes = []v1beta3.EventAttributeDefinition{} + if source.Spec.Type != "" { + sink.Spec.Attributes = append(sink.Spec.Attributes, v1beta3.EventAttributeDefinition{ + Name: "type", + Required: true, + Value: source.Spec.Type, + }) + } + if source.Spec.Schema != nil { + sink.Spec.Attributes = append(sink.Spec.Attributes, v1beta3.EventAttributeDefinition{ + Name: "schemadata", + Required: false, + Value: source.Spec.Schema.String(), + }) + } + if source.Spec.Source != nil { + sink.Spec.Attributes = append(sink.Spec.Attributes, v1beta3.EventAttributeDefinition{ + Name: "source", + Required: true, + Value: source.Spec.Source.String(), + }) + } + return nil + default: + return apis.ConvertToViaProxy(ctx, source, &v1beta3.EventType{}, to) + } + } // ConvertFrom implements apis.Convertible func (sink *EventType) ConvertFrom(ctx context.Context, from apis.Convertible) error { - return fmt.Errorf("v1beta2 is the highest known version, got: %T", from) + switch source := from.(type) { + case *v1beta3.EventType: + + source.ObjectMeta.DeepCopyInto(&sink.ObjectMeta) + source.Status.Status.DeepCopyInto(&sink.Status.Status) + + sink.Spec.Reference = source.Spec.Reference.DeepCopy() + sink.Spec.Description = source.Spec.Description + + for _, at := range source.Spec.Attributes { + switch at.Name { + case "source": + sink.Spec.Source, _ = apis.ParseURL(at.Value) + case "type": + sink.Spec.Type = at.Value + case "schemadata": + sink.Spec.Schema, _ = apis.ParseURL(at.Value) + } + } + + return nil + default: + return apis.ConvertFromViaProxy(ctx, from, &v1beta3.EventType{}, sink) + } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0473d8bc..a878ff3e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -964,7 +964,7 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/eventing v0.41.1-0.20240529130930-2a11bb8636bf +# knative.dev/eventing v0.41.1-0.20240530202412-a58c1352db05 ## explicit; go 1.21 knative.dev/eventing/pkg/adapter/v2 knative.dev/eventing/pkg/adapter/v2/util/crstatusevent @@ -1076,7 +1076,7 @@ knative.dev/pkg/tracker knative.dev/pkg/version knative.dev/pkg/webhook knative.dev/pkg/webhook/certificates/resources -# knative.dev/serving v0.41.1-0.20240529171320-0b363c0d791c +# knative.dev/serving v0.41.1-0.20240531003236-a2459efd3217 ## explicit; go 1.21 knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1