Skip to content

Commit

Permalink
kie-kogito-serverless-operator-568: Disable Workflows DI and JS avail…
Browse files Browse the repository at this point in the history
…ability health checks when Knative Eventing is configured (apache#569)
  • Loading branch information
wmedvede authored and rgdoliveira committed Nov 6, 2024
1 parent ba37e18 commit e87bce4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/controller/platform/services/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import (
"net/url"
"strings"

"github.com/apache/incubator-kie-kogito-serverless-operator/internal/controller/workflowdef"

"k8s.io/klog/v2"

operatorapi "github.com/apache/incubator-kie-kogito-serverless-operator/api/v1alpha08"
"github.com/apache/incubator-kie-kogito-serverless-operator/internal/controller/knative"
"github.com/apache/incubator-kie-kogito-serverless-operator/internal/controller/profiles"
"github.com/apache/incubator-kie-kogito-serverless-operator/internal/controller/profiles/common/constants"
"github.com/apache/incubator-kie-kogito-serverless-operator/internal/controller/workflowdef"
"github.com/apache/incubator-kie-kogito-serverless-operator/log"
"github.com/apache/incubator-kie-kogito-serverless-operator/utils"

Expand Down Expand Up @@ -173,8 +174,6 @@ func GenerateDataIndexWorkflowProperties(workflow *operatorapi.SonataFlow, platf
props.Set(constants.KogitoProcessDefinitionsEventsEnabled, "true")
props.Set(constants.KogitoProcessInstancesEventsEnabled, "true")
props.Set(constants.KogitoProcessDefinitionsEventsErrorsEnabled, "true")
props.Set(constants.KogitoDataIndexHealthCheckEnabled, "true")
props.Set(constants.KogitoDataIndexURL, serviceBaseUrl)
if sink != nil {
props.Set(constants.KogitoProcessDefinitionsEventsConnector, constants.QuarkusHTTP)
props.Set(constants.KogitoProcessInstancesEventsConnector, constants.QuarkusHTTP)
Expand All @@ -183,6 +182,8 @@ func GenerateDataIndexWorkflowProperties(workflow *operatorapi.SonataFlow, platf
props.Set(constants.KogitoProcessDefinitionsEventsMethod, constants.Post)
props.Set(constants.KogitoProcessInstancesEventsMethod, constants.Post)
} else {
props.Set(constants.KogitoDataIndexHealthCheckEnabled, "true")
props.Set(constants.KogitoDataIndexURL, serviceBaseUrl)
props.Set(constants.KogitoProcessDefinitionsEventsURL, serviceBaseUrl+constants.KogitoProcessDefinitionsEventsPath)
props.Set(constants.KogitoProcessInstancesEventsURL, serviceBaseUrl+constants.KogitoProcessInstancesEventsPath)
}
Expand All @@ -209,15 +210,15 @@ func GenerateJobServiceWorkflowProperties(workflow *operatorapi.SonataFlow, plat
if !profiles.IsDevProfile(workflow) && workflow != nil && workflow.Status.Services != nil && workflow.Status.Services.JobServiceRef != nil {
serviceBaseUrl := workflow.Status.Services.JobServiceRef.Url
if js.IsServiceEnabled() && len(serviceBaseUrl) > 0 {
if workflowdef.HasTimeouts(workflow) {
props.Set(constants.KogitoJobServiceHealthCheckEnabled, "true")
}
props.Set(constants.KogitoJobServiceURL, serviceBaseUrl)
if sink != nil {
props.Set(constants.JobServiceRequestEventsURL, constants.KnativeInjectedEnvVar)
props.Set(constants.JobServiceRequestEventsConnector, constants.QuarkusHTTP)
props.Set(constants.JobServiceRequestEventsMethod, constants.Post)
} else {
if workflowdef.HasTimeouts(workflow) {
props.Set(constants.KogitoJobServiceHealthCheckEnabled, "true")
}
props.Set(constants.KogitoJobServiceURL, serviceBaseUrl)
props.Set(constants.JobServiceRequestEventsURL, serviceBaseUrl+constants.JobServiceJobEventsPath)
}
}
Expand Down

0 comments on commit e87bce4

Please sign in to comment.