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


##########
flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/utils/ConditionUtils.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import io.fabric8.kubernetes.api.model.ConditionBuilder;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/** Status of CR. */
+public class ConditionUtils {
+
+    public static Condition ready(final String message) {
+        return crCondition("Ready", "True", message, "Ready");
+    }
+
+    public static Condition notReady(final String message) {
+        return crCondition("Ready", "False", message, "Progressing");
+    }
+
+    public static Condition error(final String message) {
+        return crCondition("Error", "True", message, "The job terminally 
failed");
+    }
+
+    public static Condition crCondition(
+            final String type, final String status, final String message, 
final String reason) {
+        return new ConditionBuilder()
+                .withType(type)
+                .withStatus(status)
+                .withMessage(message)
+                .withReason(reason)

Review Comment:
   As per the doc , https://maelvls.dev/kubernetes-conditions/ ,  looks like we 
can keep reason as simple category of cause of the current status.
   
   `Reason is intended to be used in concise output, such as one-line kubectl 
get output, and in summarizing occurrences of causes, whereas Message is 
intended to be presented to users in detailed status explanations, such as 
kubectl describe output.`
   
   I was thinking probably  we can keep that for any not ready and error 
conditions, and not required for ready condition?. 
   
   



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to