-
Notifications
You must be signed in to change notification settings - Fork 630
Destination in Sequence #2094
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
Destination in Sequence #2094
Changes from all commits
e85e7a8
b55b2cc
f0d6a3d
1f59d9f
221306f
4f3c21b
eb9b5a5
2010b59
b735820
58efd82
d50f086
5c4195d
885e1f8
e0a2a29
923bad3
ec1d0c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ import ( | |
| "k8s.io/apimachinery/pkg/runtime" | ||
| eventingduck "knative.dev/eventing/pkg/apis/duck/v1alpha1" | ||
| "knative.dev/pkg/apis" | ||
| "knative.dev/pkg/apis/v1alpha1" | ||
| ) | ||
|
|
||
| func TestSequenceValidation(t *testing.T) { | ||
|
|
@@ -45,20 +46,22 @@ func TestSequenceValidation(t *testing.T) { | |
| }) | ||
| } | ||
|
|
||
| func makeValidReply(channelName string) *corev1.ObjectReference { | ||
| return &corev1.ObjectReference{ | ||
| APIVersion: "messaging.knative.dev/v1alpha1", | ||
| Kind: "inmemorychannel", | ||
| Name: channelName, | ||
| func makeValidReply(channelName string) *v1alpha1.Destination { | ||
| return &v1alpha1.Destination{ | ||
| DeprecatedAPIVersion: "messaging.knative.dev/v1alpha1", | ||
| DeprecatedKind: "inmemorychannel", | ||
| DeprecatedName: channelName, | ||
| } | ||
| } | ||
|
|
||
| func makeInvalidReply(channelName string) *corev1.ObjectReference { | ||
| return &corev1.ObjectReference{ | ||
| APIVersion: "messaging.knative.dev/v1alpha1", | ||
| Kind: "inmemorychannel", | ||
| Namespace: "notallowed", | ||
| Name: channelName, | ||
| func makeInvalidReply(channelName string) *v1alpha1.Destination { | ||
| return &v1alpha1.Destination{ | ||
| Ref: &corev1.ObjectReference{ | ||
| APIVersion: "messaging.knative.dev/v1alpha1", | ||
| Kind: "inmemorychannel", | ||
| Namespace: "notallowed", | ||
| Name: channelName, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -144,27 +147,28 @@ func TestSequenceSpecValidation(t *testing.T) { | |
| ts: &SequenceSpec{ | ||
| ChannelTemplate: validChannelTemplate, | ||
| Steps: []SubscriberSpec{{URI: &subscriberURI}}, | ||
| Reply: &corev1.ObjectReference{ | ||
| APIVersion: "messaging.knative.dev/v1alpha1", | ||
| Kind: "inmemorychannel", | ||
| Reply: &v1alpha1.Destination{ | ||
| DeprecatedAPIVersion: "messaging.knative.dev/v1alpha1", | ||
| DeprecatedKind: "inmemorychannel", | ||
| }, | ||
| }, | ||
| want: func() *apis.FieldError { | ||
| fe := apis.ErrMissingField("reply.name") | ||
| return fe | ||
| }(), | ||
| }, { | ||
| name: "valid sequence with invalid reply", | ||
| ts: &SequenceSpec{ | ||
| ChannelTemplate: validChannelTemplate, | ||
| Steps: []SubscriberSpec{{URI: &subscriberURI}}, | ||
| Reply: makeInvalidReply("reply-channel"), | ||
| }, | ||
| want: func() *apis.FieldError { | ||
| fe := apis.ErrDisallowedFields("reply.Namespace") | ||
| fe.Details = "only name, apiVersion and kind are supported fields" | ||
| return fe | ||
| }(), | ||
| // TODO current destination ref allows setting the namespace, thus this fails. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /hold we have a DeprecatedNamespace in Destination, is that correct? I thought we weren't supporting namespaces in ObjectRef..
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /hold cancel, it seems that we will let this through |
||
| //}, { | ||
| // name: "valid sequence with invalid reply", | ||
| // ts: &SequenceSpec{ | ||
| // ChannelTemplate: validChannelTemplate, | ||
| // Steps: []SubscriberSpec{{URI: &subscriberURI}}, | ||
| // Reply: makeInvalidReply("reply-channel"), | ||
| // }, | ||
| // want: func() *apis.FieldError { | ||
| // fe := apis.ErrDisallowedFields("reply.Namespace") | ||
| // fe.Details = "only name, apiVersion and kind are supported fields" | ||
| // return fe | ||
| // }(), | ||
| }} | ||
|
|
||
| for _, test := range tests { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.