-
Notifications
You must be signed in to change notification settings - Fork 630
Add data validation for subscription in reconciler #1100
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ var ( | |
| serviceURI = "http://" + serviceDNS + "/" | ||
|
|
||
| subscriberGVK = metav1.GroupVersionKind{ | ||
| Group: "testing.eventing.knative.dev", | ||
| Group: "eventing.knative.dev", | ||
|
Contributor
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. this is testing ducktyping for subscribers.
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. I changed that because in subscriber validation there is hardcoded logic to validate API group is
Contributor
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. ah, thanks. |
||
| Version: "v1alpha1", | ||
| Kind: "Subscriber", | ||
| } | ||
|
|
@@ -154,7 +154,7 @@ func TestAllCases(t *testing.T) { | |
| Key: testNS + "/" + subscriptionName, | ||
| WantErr: true, | ||
| WantEvents: []string{ | ||
| Eventf(corev1.EventTypeWarning, "SubscriberResolveFailed", "Failed to resolve spec.subscriber: subscribers.testing.eventing.knative.dev %q not found", subscriberName), | ||
| Eventf(corev1.EventTypeWarning, "SubscriberResolveFailed", "Failed to resolve spec.subscriber: subscribers.eventing.knative.dev %q not found", subscriberName), | ||
| }, | ||
| WantStatusUpdates: []clientgotesting.UpdateActionImpl{{ | ||
| Object: NewSubscription(subscriptionName, testNS, | ||
|
|
@@ -214,8 +214,7 @@ func TestAllCases(t *testing.T) { | |
| Key: testNS + "/" + subscriptionName, | ||
| WantErr: true, | ||
| WantEvents: []string{ | ||
| Eventf(corev1.EventTypeWarning, "ResultResolveFailed", "Failed to resolve spec.reply: status does not contain address"), | ||
| Eventf(corev1.EventTypeWarning, "SubscriptionUpdateStatusFailed", "Failed to update Subscription's status: status does not contain address"), // TODO: BUGBUG THIS IS WEIRD | ||
| Eventf(corev1.EventTypeWarning, "SubscriptionUpdateStatusFailed", "Failed to update Subscription's status: invalid value: Subscriber: spec.reply.kind\nonly 'Channel' kind is allowed"), | ||
| }, | ||
| WantStatusUpdates: []clientgotesting.UpdateActionImpl{{ | ||
| Object: NewSubscription(subscriptionName, testNS, | ||
|
|
@@ -224,7 +223,6 @@ func TestAllCases(t *testing.T) { | |
| WithSubscriptionReply(subscriberGVK, replyName), | ||
| // The first reconciliation will initialize the status conditions. | ||
| WithInitSubscriptionConditions, | ||
| WithSubscriptionPhysicalSubscriptionSubscriber(subscriberURI), | ||
|
Contributor
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. interesting, I suppose this is because you are validating. NICE.
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. Yes |
||
| ), | ||
| }}, | ||
| }, { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, thanks!