gyfora commented on code in PR #724:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/724#discussion_r1418996423
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/diff/DiffResult.java:
##########
@@ -101,14 +101,7 @@ public String toString() {
}
private static DiffType getSpechChangeType(List<Diff<?>> diffs) {
- var type = DiffType.IGNORE;
- for (var diff : diffs) {
- type = DiffType.max(type, diff.getType());
- if (type == DiffType.UPGRADE) {
- return type;
- }
- }
- return type;
+ return
diffs.stream().map(Diff::getType).reduce(DiffType::max).orElse(DiffType.IGNORE);
Review Comment:
Yes the logic didn't really change here. This is a common way to represent
an ordinal structure between the diff types.
REDEPLOY > UPGRADE > SCALE > IGNORE , basically the higher one completely
subsumes the other for instance a SCALE change can be executed as a
redeploy/upgrade but not vice versa. I will add a note to the enum that makes
sense
--
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]