Skip to content

Commit

Permalink
fix(knative): Make knative broker name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
claudio4j committed Jan 11, 2022
1 parent 27ea823 commit 7609295
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/util/bindings/bindings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestBindings(t *testing.T) {
"type": "myeventtype",
}),
},
uri: "knative:event/myeventtype?apiVersion=eventing.knative.dev%2Fv1&kind=Broker",
uri: "knative:event/myeventtype?apiVersion=eventing.knative.dev%2Fv1&kind=Broker&name=default",
},
{
endpointType: v1alpha1.EndpointTypeSource,
Expand Down
9 changes: 3 additions & 6 deletions pkg/util/bindings/knative_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,9 @@ func (k KnativeRefBindingProvider) Translate(ctx BindingContext, endpointCtx End

var serviceURI string
if *serviceType == knativeapis.CamelServiceTypeEvent {
// TODO enable this when the runtime will support changing the broker name (https://github.com/apache/camel-k-runtime/issues/535)
/*
if props["name"] == "" {
props["name"] = e.Ref.Name
}
*/
if props["name"] == "" {
props["name"] = e.Ref.Name
}
if eventType, ok := props["type"]; ok {
// consume prop
delete(props, "type")
Expand Down

0 comments on commit 7609295

Please sign in to comment.