gyfora commented on code in PR #770:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/770#discussion_r1478404649
##########
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:
The problem is that pod fields that are not in PodTemplateSpec end up
deserialised into the additionalProperties field. In order to avoid false
diffs, we have to remove these
--
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]