laughingman7743 commented on code in PR #1221:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1221#discussion_r4402243583
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/health/ClusterHealthInfo.java:
##########
@@ -31,6 +32,9 @@
@Experimental
@Data
@AllArgsConstructor
+// Health info stored by older operator versions may contain fields that no
longer exist, such as
+// "healthy" before FLINK-37769. Ignoring them lets the info be read and
re-evaluated.
Review Comment:
Thank you for the review and the approval! I have removed this comment, and
the other comments I added in the tests as well.
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/health/ClusterHealthInfoTest.java:
##########
@@ -54,6 +55,26 @@ public void
deserializeWithOldVersionShouldDeserializeCorrectly() {
assertEquals("test-error",
clusterHealthInfoFromJson.getHealthResult().getError());
}
+ @Test
+ public void deserializeShouldIgnoreLegacyHealthyField() {
+ // As stored by operators before 1.12 (FLINK-37769 replaced "healthy"
with
+ // "healthResult").
Review Comment:
Removed, thank you.
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/observer/ClusterHealthEvaluatorTest.java:
##########
@@ -263,6 +263,37 @@ public void
evaluateShouldMarkClusterUnhealthyWhenRestartThresholdHitInAverage()
assertClusterHealthIs(false);
}
+ @ParameterizedTest
+ @MethodSource("provideParametersEvaluateLegacyClusterHealthInfo")
+ public void evaluateShouldReevaluateLegacyClusterHealthInfo(
+ boolean legacyHealthy, int observedNumRestarts, boolean
expectedHealthy) {
+ configuration.set(OPERATOR_CLUSTER_HEALTH_CHECK_RESTARTS_WINDOW,
Duration.ofMinutes(5));
+ configuration.set(OPERATOR_CLUSTER_HEALTH_CHECK_RESTARTS_THRESHOLD,
100);
+ final var timeStamp = validInstant1.toEpochMilli();
+ // As stored by operators before 1.12 (FLINK-37769 replaced "healthy"
with
+ // "healthResult").
Review Comment:
Removed, thank you.
--
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]