davidradl commented on code in PR #957:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/957#discussion_r2007900319
##########
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"));
+ break;
+ case DEPLOYED_NOT_READY:
+ updateCondition(
+ conditions,
+ ConditionUtils.runningFalse(
+ "JobManager is running but not ready yet
to receive REST API calls",
+ "JobManager is running but not ready yet
to receive REST API calls"));
+ break;
+ case ERROR:
+ updateCondition(
+ conditions,
+ ConditionUtils.runningFalse(
+ "Deployment in terminal error, requires
spec change for reconciliation to continue",
+ "JobManager deployment failed"));
+ }
+ } else if (getJobStatus() != null && getJobStatus().getState() !=
null) {
+ switch (getJobStatus().getState()) {
+ case RECONCILING:
+ updateCondition(
+ conditions,
+ ConditionUtils.runningFalse(
+ JobStatus.RECONCILING.name(), "Job is
currently reconciling"));
+ break;
+ case CREATED:
+ updateCondition(
+ conditions,
+ ConditionUtils.runningFalse(
+ JobStatus.CREATED.name(), "Job is
created"));
+ break;
+ case RUNNING:
+ updateCondition(
+ conditions,
+
ConditionUtils.runningTrue(JobStatus.RUNNING.name(), "Job is running"));
+ break;
+ case FAILING:
+ updateCondition(
+ conditions,
+ ConditionUtils.runningFalse(
+ JobStatus.FAILING.name(), "Job has
failed"));
+ break;
+ case RESTARTING:
+ updateCondition(
+ conditions,
+ ConditionUtils.runningFalse(
+ JobStatus.RESTARTING.name(),
+ "The job is currently undergoing a
restarting"));
Review Comment:
nit: "The job is currently undergoing a restarting" -> "The job is
currently restarting"
--
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]