gyfora commented on code in PR #539: URL: https://github.com/apache/flink-kubernetes-operator/pull/539#discussion_r1121264500
########## flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/diff/SpecDiffTest.java: ########## @@ -181,4 +181,28 @@ public void testFlinkSessionJobSpecChanges() { assertEquals(DiffType.UPGRADE, diff.getType()); assertEquals(11, diff.getNumDiffs()); } + + @Test + public void testPodTemplateChanges() { + var left = BaseTestUtils.buildApplicationCluster().getSpec(); + left.setPodTemplate(BaseTestUtils.getTestPod("localhost1", "v1", List.of())); + left.setImage("img1"); + IngressSpec ingressSpec = new IngressSpec(); + ingressSpec.setTemplate("temp"); + left.setIngress(ingressSpec); + var right = BaseTestUtils.buildApplicationCluster().getSpec(); + right.setPodTemplate(BaseTestUtils.getTestPod("localhost2", "v2", List.of())); + right.setImage("img2"); + right.setRestartNonce(1L); + + var diff = new ReflectiveDiffBuilder<>(left, right).build(); + assertEquals(DiffType.UPGRADE, diff.getType()); + assertEquals( + "Diff: FlinkDeploymentSpec[image : \"img1\" -> \"img2\", " + + "ingress : {\"template\":\"temp\",\"className\":null,\"annotations\":null} -> null, " Review Comment: We could potentiall improve the behaviour when nulling out objects. It should not be necessary to show the entire left side object . Maybe something like `ingress : {...} -> null` -- 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