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


##########
controllers/profiles/profile.go:
##########
@@ -71,6 +71,8 @@ type ReconciliationState interface {
        Do(ctx context.Context, workflow *operatorapi.SonataFlow) (ctrl.Result, 
[]client.Object, error)
        // PostReconcile performs the actions to perform after the 
reconciliation that are not mandatory
        PostReconcile(ctx context.Context, workflow *operatorapi.SonataFlow) 
error
+       // CanReconcileNext check if next state can be reconciled
+       CanReconcileNext() bool

Review Comment:
   Not sure why we need a Knative state. That can happen within the deployment 
handler. Not even the Knative conditions we need, sounds off.
   
   We can instead post the Knative objects status to the events API. The more 
conditions and states we add, the more complex it gets. Now adding a new API to 
the core reconcile might make things more difficult to maintain.
   
   Not sure if I was clear in the last review, but within the existing state 
where we create everything, we add a new `KnativeEventingHandler` as we have 
here: 
   
https://github.com/apache/incubator-kie-kogito-serverless-operator/blob/main/controllers/profiles/prod/deployment_handler.go#L50
   
   So the code from the Knative state goes to a handler like this in the 
`knative.go` file. You reuse the whole states we already have in both profiles.
   
   For example, in dev mode you add here:
   
   
https://github.com/apache/incubator-kie-kogito-serverless-operator/blob/main/controllers/profiles/dev/states_dev.go#L111C28-L111C28
   
   Something like:
   
   ```go
   knative_objs := common.KnativeHandler().Ensure()
   ```
   
   In prod, you use the `deployment_handler.go`:
   
https://github.com/apache/incubator-kie-kogito-serverless-operator/blob/main/controllers/profiles/prod/deployment_handler.go#L78



-- 
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