lajith2006 commented on code in PR #957:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/957#discussion_r2013947250


##########
flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/status/FlinkDeploymentStatus.java:
##########
@@ -55,4 +60,175 @@ public class FlinkDeploymentStatus extends 
CommonStatus<FlinkDeploymentSpec> {
 
     /** Information about the TaskManagers for the scale subresource. */
     private TaskManagerInfo taskManager;
+
+    /** Condition of the CR . */
+    private List<Condition> conditions = new ArrayList<>();
+
+    private String phase;
+
+    public List<Condition> getConditions() {
+        if (reconciliationStatus != null
+                && reconciliationStatus.deserializeLastReconciledSpec() != null
+                && 
reconciliationStatus.deserializeLastReconciledSpec().getJob() == null) {
+            switch (jobManagerDeploymentStatus) {
+                case READY:
+                    updateCondition(
+                            conditions,
+                            ConditionUtils.runningTrue(
+                                    "JobManager is running and ready to 
receive REST API call",
+                                    "JobManager is running and ready to 
receive REST API call"));
+                    break;
+                case MISSING:
+                    updateCondition(
+                            conditions,
+                            ConditionUtils.runningFalse(
+                                    "JobManager deployment not found",
+                                    "JobManager deployment not found"));
+                    break;
+                case DEPLOYING:
+                    updateCondition(
+                            conditions,
+                            ConditionUtils.runningFalse(
+                                    "JobManager process is starting up",
+                                    "JobManager process is starting up"));

Review Comment:
    As per description 
[here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties)
 which says  `Reason is intended to be a one-word, CamelCase representation of 
the category of cause of the current status, and Message is intended to be a 
human-readable phrase or sentence`, I would use the existing enum 
https://github.com/apache/flink-kubernetes-operator/blob/main/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/status/JobManagerDeploymentStatus.java,
 to use as reason and respective explanation as message



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