RichardW98 commented on code in PR #350:
URL: 
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/350#discussion_r1461291909


##########
controllers/profiles/common/object_creators.go:
##########
@@ -197,6 +211,85 @@ func ServiceCreator(workflow *operatorapi.SonataFlow) 
(client.Object, error) {
        return service, nil
 }
 
+// SinkBindingCreator is an ObjectsCreator for SinkBinding.
+// It will create v1.SinkBinding based on events defined in workflow.
+func SinkBindingCreator(workflow *operatorapi.SonataFlow) (client.Object, 
error) {
+       lbl := workflowproj.GetDefaultLabels(workflow)
+
+       // skip if no produced event is found
+       if workflow.Spec.Sink == nil || 
!workflowdef.ContainsEventKind(workflow, cncfmodel.EventKindProduced) {
+               return nil, nil
+       }
+
+       sink := workflow.Spec.Sink
+
+       // subject must be deployment to inject K_SINK, service won't work
+       sinkBinding := &sourcesv1.SinkBinding{
+               ObjectMeta: metav1.ObjectMeta{
+                       Name:      strings.ToLower(fmt.Sprintf("sb-%s", 
workflow.Name)),

Review Comment:
   yea totally agree on the naming convention optimization



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to