tchughesiv commented on code in PR #345:
URL: 
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/345#discussion_r1457748962


##########
controllers/platform/k8s.go:
##########
@@ -62,15 +61,19 @@ func (action *serviceAction) Handle(ctx context.Context, 
platform *operatorapi.S
                return nil, err
        }
 
-       if platform.Spec.Services.DataIndex != nil {
-               if err := createServiceComponents(ctx, action.client, platform, 
services.NewDataIndexService(platform)); err != nil {
-                       return nil, err
+       if platform.Spec.Services != nil {
+               psDI := services.NewDataIndexService(platform)
+               if psDI.IsServiceSetInSpec() {
+                       if err := createServiceComponents(ctx, action.client, 
platform, psDI); err != nil {
+                               return nil, err
+                       }
                }
-       }
 
-       if platform.Spec.Services.JobService != nil {
-               if err := createServiceComponents(ctx, action.client, platform, 
services.NewJobService(platform)); err != nil {
-                       return nil, err
+               psJS := services.NewJobService(platform)
+               if psJS.IsServiceSetInSpec() {
+                       if err := createServiceComponents(ctx, action.client, 
platform, psJS); err != nil {

Review Comment:
   > same here, the JS service spec could have changed and that would mean 
changes to the deployment rather than create a new one.
   
   what do you mean by `the JS service spec could have changed` ? just want to 
be clear that, with this PR, the clusterplatform does NOT make changes to the 
platforms` services or spec.



##########
controllers/platform/k8s.go:
##########
@@ -62,15 +61,19 @@ func (action *serviceAction) Handle(ctx context.Context, 
platform *operatorapi.S
                return nil, err
        }
 
-       if platform.Spec.Services.DataIndex != nil {
-               if err := createServiceComponents(ctx, action.client, platform, 
services.NewDataIndexService(platform)); err != nil {
-                       return nil, err
+       if platform.Spec.Services != nil {
+               psDI := services.NewDataIndexService(platform)
+               if psDI.IsServiceSetInSpec() {
+                       if err := createServiceComponents(ctx, action.client, 
platform, psDI); err != nil {
+                               return nil, err
+                       }
                }
-       }
 
-       if platform.Spec.Services.JobService != nil {
-               if err := createServiceComponents(ctx, action.client, platform, 
services.NewJobService(platform)); err != nil {
-                       return nil, err
+               psJS := services.NewJobService(platform)
+               if psJS.IsServiceSetInSpec() {
+                       if err := createServiceComponents(ctx, action.client, 
platform, psJS); err != nil {

Review Comment:
   > same here, the JS service spec could have changed and that would mean 
changes to the deployment rather than create a new one.
   
   what do you mean by `the JS service spec could have changed` ? just want to 
be clear that, with this PR, the clusterplatform does NOT make changes to the 
platforms' services or spec.



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