gyfora commented on code in PR #625: URL: https://github.com/apache/flink-kubernetes-operator/pull/625#discussion_r1258236992
########## flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsTest.java: ########## @@ -86,6 +89,43 @@ public void testMergePods() { assertEquals(pod2.getSpec().getContainers(), mergedPod.getSpec().getContainers()); } + @Test + public void testAddStartupProbe() { + Pod pod = new Pod(); + FlinkUtils.addStartupProbe(pod); + + Probe expectedProbe = new Probe(); + expectedProbe.setPeriodSeconds(1); + expectedProbe.setFailureThreshold(Integer.MAX_VALUE); + expectedProbe.setHttpGet(new HTTPGetAction()); + expectedProbe.getHttpGet().setPort(new IntOrString("rest")); + expectedProbe.getHttpGet().setPath("/config"); + + assertEquals(1, pod.getSpec().getContainers().size()); + assertEquals(Constants.MAIN_CONTAINER_NAME, pod.getSpec().getContainers().get(0).getName()); + assertEquals(expectedProbe, pod.getSpec().getContainers().get(0).getStartupProbe()); + + FlinkUtils.addStartupProbe(pod); + + assertEquals(1, pod.getSpec().getContainers().size()); + assertEquals(Constants.MAIN_CONTAINER_NAME, pod.getSpec().getContainers().get(0).getName()); + assertEquals(expectedProbe, pod.getSpec().getContainers().get(0).getStartupProbe()); + + // Custom startup probe + pod.getSpec().getContainers().get(0).setStartupProbe(new Probe()); + assertEquals(1, pod.getSpec().getContainers().size()); Review Comment: good catch :) -- 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