-
Notifications
You must be signed in to change notification settings - Fork 595
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
Fixed eventtype create-delete loop on built in sources #7245
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 |
---|---|---|
|
@@ -41,6 +41,10 @@ import ( | |
"knative.dev/eventing/pkg/reconciler/source/duck/resources" | ||
) | ||
|
||
const ( | ||
defaultNamespace = "default" | ||
) | ||
|
||
type Reconciler struct { | ||
// eventingClientSet allows us to configure Eventing objects | ||
eventingClientSet clientset.Interface | ||
|
@@ -211,6 +215,9 @@ func (r *Reconciler) makeEventTypes(ctx context.Context, src *duckv1.Source) []v | |
CeSchema: schemaURL, | ||
Description: description, | ||
}) | ||
if eventType.Spec.Reference.Namespace == "" { | ||
eventType.Spec.Reference.Namespace = defaultNamespace | ||
} | ||
Comment on lines
+218
to
+220
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. If we want to set a namespace, the correct one is 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 think we had this assumption before. but I like this suggestion 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. We did not, that was on the Broker name, which different from the reference namespace here |
||
eventTypes = append(eventTypes, *eventType) | ||
} | ||
return eventTypes | ||
|
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.
This update is not guaranteed to be seen by the other controller (since after FinalizeKind ends the finalizer is removed and with it the resource) and also I think there is (or there should be) an owner reference that should clean up event types associated with this source.