jordigilh commented on code in PR #372:
URL:
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/372#discussion_r1478853349
##########
controllers/platform/services/services.go:
##########
@@ -198,11 +198,24 @@ func (d DataIndexHandler) MergePodSpec(podSpec
corev1.PodSpec) (corev1.PodSpec,
return *c, err
}
+// hasPostgreSQLConfigured returns true when either the SonataFlow Platform
PostgreSQL CR's structure or the one in the Data Index service specification is
not nil
+func (d DataIndexHandler) hasPostgreSQLConfigured() bool {
+ return (d.platform.Spec.Services.DataIndex.Persistence != nil &&
d.platform.Spec.Services.DataIndex.Persistence.PostgreSQL != nil) ||
+ (d.platform.Spec.Persistence != nil &&
d.platform.Spec.Persistence.PostgreSQL != nil)
+}
Review Comment:
I'm not sure because this function is to determine if there is a postgreSQL
configuration for the data index service (whether it's derived from the
platform's own persistence spec or from the service's). Correct me if I'm
wrong, but the function `IsServiceSetInSpec()` just returns true when the DI
service is defined in the platform's spec. And at this point of the execution
the DI service has been already established that it exists, otherwise the
parent function would not be called in the first place.
I can add the check if you think it's worth to have it anyway. WDYT?
--
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]