Savonitar commented on code in PR #1121:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/1121#discussion_r3312863568


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkResourceContextFactory.java:
##########
@@ -98,39 +102,40 @@ public FlinkStateSnapshotContext 
getFlinkStateSnapshotContext(
                 configManager);
     }
 
+    public BlueGreenContext getBlueGreenContext(
+            FlinkBlueGreenDeployment bgDeployment,
+            FlinkBlueGreenDeploymentStatus deploymentStatus,
+            Context<FlinkBlueGreenDeployment> josdkContext,
+            FlinkBlueGreenDeployments deployments) {
+        return new BlueGreenContext(
+                bgDeployment, deploymentStatus, josdkContext, deployments, 
this);
+    }
+
+    @SuppressWarnings("unchecked")
     public <CR extends AbstractFlinkResource<?, ?>> FlinkResourceContext<CR> 
getResourceContext(
-            CR resource, Context josdkContext) {
+            CR resource, Context<CR> josdkContext) {

Review Comment:
   I like the idea, but will this change break 
https://github.com/apache/flink-kubernetes-operator/blob/main/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/bluegreen/BlueGreenDeploymentService.java#L289
 which uses `Context<FlinkBlueGreenDeployment> josdkContext` and other callers?



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkBlueGreenDeployments.java:
##########
@@ -51,7 +51,7 @@ static FlinkBlueGreenDeployments fromSecondaryResources(
                 context.getSecondaryResources(FlinkDeployment.class);
 
         if (secondaryResources.isEmpty() || secondaryResources.size() > 2) {
-            FlinkBlueGreenDeploymentController.logAndThrow(
+            throw new RuntimeException(

Review Comment:
   Could you please elaborate, why RuntimeException and not for example 
IllegalStateException (like in 
https://github.com/apache/flink-kubernetes-operator/blob/main/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/bluegreen/BlueGreenDeploymentService.java#L715)?
   
   Just curious (not a concern). 



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

Reply via email to