afedulov commented on code in PR #770: URL: https://github.com/apache/flink-kubernetes-operator/pull/770#discussion_r1478491551
########## flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/diff/ReflectiveDiffBuilder.java: ########## @@ -172,4 +173,26 @@ private DiffType getType(SpecDiff.Config annotation, String key) { } return diffType; } + + private static void clearIgnoredFields(Object o) { + if (o == null) { + return; + } + if (o instanceof FlinkDeploymentSpec) { + var spec = (FlinkDeploymentSpec) o; + clearAdditionalProps(spec.getPodTemplate()); + if (spec.getJobManager() != null) { + clearAdditionalProps(spec.getJobManager().getPodTemplate()); + } + if (spec.getTaskManager() != null) { + clearAdditionalProps(spec.getTaskManager().getPodTemplate()); + } + } + } + + private static void clearAdditionalProps(Object o) { + if (o != null && o instanceof PodTemplateSpec) { Review Comment: Oh, I see, makes sense. Let's maybe also add a one-liner here to explain this behavior, it is not evident. ########## flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/diff/ReflectiveDiffBuilder.java: ########## @@ -172,4 +173,26 @@ private DiffType getType(SpecDiff.Config annotation, String key) { } return diffType; } + + private static void clearIgnoredFields(Object o) { + if (o == null) { + return; + } + if (o instanceof FlinkDeploymentSpec) { + var spec = (FlinkDeploymentSpec) o; + clearAdditionalProps(spec.getPodTemplate()); + if (spec.getJobManager() != null) { + clearAdditionalProps(spec.getJobManager().getPodTemplate()); + } + if (spec.getTaskManager() != null) { + clearAdditionalProps(spec.getTaskManager().getPodTemplate()); + } + } + } + + private static void clearAdditionalProps(Object o) { + if (o != null && o instanceof PodTemplateSpec) { Review Comment: Oh, I see, makes sense. Let's maybe also add a one-liner here to explain this behavior, it is not self-evident. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org