You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/20 04:56:33 UTC

[GitHub] [flink-kubernetes-operator] gyfora commented on a diff in pull request #228: [FLINK-27686] Only patch status on change

gyfora commented on code in PR #228:
URL: https://github.com/apache/flink-kubernetes-operator/pull/228#discussion_r877733469


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/StatusHelper.java:
##########
@@ -64,6 +67,14 @@ public <T extends CustomResource<?, STATUS>> void patchAndCacheStatus(T resource
         // in the meantime
         resource.getMetadata().setResourceVersion(null);
 
+        ObjectNode newStatus = objectMapper.convertValue(resource.getStatus(), ObjectNode.class);
+        ObjectNode previousStatus = statusCache.put(getKey(resource), newStatus);
+
+        if (previousStatus == null || newStatus.equals(previousStatus)) {

Review Comment:
   Very good catch you are right @Aitozi 



-- 
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