You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "davidradl (via GitHub)" <gi...@apache.org> on 2026/02/25 15:53:43 UTC
[PR] [FLINK-33634] Add Conditions to Flink CRD's Status field [flink-kubernetes-operator]
davidradl opened a new pull request, #1064:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1064
What is the purpose of the change
This PR address the [FLIP](https://cwiki.apache.org/confluence/display/FLINK/FLIP-493%3A+Add+K8S+conditions+to+CRD%27s+Status) to add conditions to Flink deployment status related to issue [FLINK-33634](https://issues.apache.org/jira/browse/FLINK-33634)
Brief change log
Added list of conditions to FlinkDeploymentStatus
A new class ConditionUtils introduced as utility class to build condition.
Verifying this change
Deployed and validated session job and application cluster deployment.
Does this pull request potentially affect one of the following parts:
Dependencies (does it add or upgrade a dependency): no
The public API, i.e., is any changes to the CustomResourceDescriptors: yes
Core observer or reconciler logic that is regularly executed: (yes / no)
Documentation
Does this pull request introduce a new feature? yes
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
--
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-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-33634] Add Conditions to Flink CRD's Status field [flink-kubernetes-operator]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl merged PR #1064:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1064
--
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-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-33634] Add Conditions to Flink CRD's Status field [flink-kubernetes-operator]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #1064:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1064#discussion_r2867575630
##########
flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/status/FlinkDeploymentStatus.java:
##########
@@ -68,4 +77,96 @@ public class FlinkDeploymentStatus extends CommonStatus<FlinkDeploymentSpec> {
public boolean isJobCancellable() {
return super.isJobCancellable() && jobManagerDeploymentStatus.isRestApiAvailable();
}
+
+ /**
+ * Computes and returns a List of Condition objects based on the current FlinkDeploymentStatus.
+ * This method should be called to generate conditions that can then be set using
+ * setConditions().
+ *
+ * @return a list of Condition object representing the current status of the Flink deployment
+ */
+ public List<Condition> computeConditions() {
+ Condition conditionToAdd = null;
+
+ if (reconciliationStatus != null) {
+ FlinkDeploymentSpec deploymentSpec =
+ reconciliationStatus.deserializeLastReconciledSpec();
+
+ if (deploymentSpec != null) {
+ switch (Mode.getMode(deploymentSpec)) {
+ case APPLICATION:
+ conditionToAdd = createApplicationModeCondition(getJobStatus().getState());
+ break;
+ case SESSION:
+ conditionToAdd = createSessionModeCondition(jobManagerDeploymentStatus);
+ }
+ updateLastTransitionTime(conditions, conditionToAdd);
+ }
+ }
+ return conditionToAdd == null ? List.of() : List.of(conditionToAdd);
+ }
+
+ private void updateLastTransitionTime(List<Condition> conditions, Condition condition) {
+ if (condition == null) {
+ return;
+ }
+ Condition existingCondition =
+ conditions.stream()
+ .filter(c -> c.getType().equals(condition.getType()))
+ .findFirst()
+ .orElse(null);
+ condition.setLastTransitionTime(getLastTransitionTimeStamp(existingCondition, condition));
+ }
+
+ private Condition createApplicationModeCondition(JobStatus jobStatus) {
Review Comment:
Now I have moved these methods to ConditionsUtil - they are all static.They could have been before I you rightly pointed out.
--
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-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-33634] Add Conditions to Flink CRD's Status field [flink-kubernetes-operator]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on PR #1064:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1064#issuecomment-3960303895
@gyfora I have brought this change up to date and tested it. Could you review please?
I have kept @lajith2006 's commits and did a git merge. I could do this cleanly in one commit - but still wanted to honour lajith's contributions. Let me know how you would like to see this.
--
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-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-33634] Add Conditions to Flink CRD's Status field [flink-kubernetes-operator]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on PR #1064:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1064#issuecomment-3960282956
This change bring sthe changes from [PR 957](https://github.com/apache/flink-kubernetes-operator/pull/957) up to date and adds a couple of commits.
--
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-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org