@Test(dataProvider = "start-params", expectedExceptions = IllegalArgumentException.class) void testNullStartParameters(PodConfig podConfig, ExecutionConfig executionConfig) { PodPushClient podPushClient = new PodPushClientImpl(); podPushClient.start(podConfig, executionConfig, new CountDownLatch(1), new CountDownLatch(1)); }
@Override public PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig, CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure) { if (podConfig == null || executionConfig == null) { throw new IllegalArgumentException("Must provide configuration details for Pod creation."); } else if (podConfig.getImageName() == null) { throw new IllegalArgumentException("Must provide podConfig.imageName."); } Pod podToCreate = Fabric8Helper.getPodSpec(kubeConfig, podConfig, executionConfig); String podName = podToCreate.getMetadata().getName(); if (executionConfig.getLogLineAccumulator() == null) executionConfig.setLogLineAccumulator(new LogLineAccumulatorImpl(podName)); if(!podConfig.isEndOfLogIdentifierEmpty()) { executionConfig.getLogLineAccumulator().setCompletionIdentifier(podConfig.getEndOfLogIdentifier()); } PodWatcherImpl podWatcherImpl = podWatcherFactory.createPodWatcher( kubernetesHttpClients.getLogWatchClient(), podScheduled, podFinishedSuccessOrFailure, kubeConfig.getNameSpace(), podName, executionConfig.getLogLineAccumulator() ); Watch watch = initializePodWatcher(podName, podWatcherImpl); podWatcherImpl.setWatch(watch); logPodSpecs(startPod(podToCreate), START_POD_TEMPLATE); return podWatcherImpl; }
PodPushClientImpl implements PodPushClient { @Override public PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig, CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure) { if (podConfig == null || executionConfig == null) { throw new IllegalArgumentException("Must provide configuration details for Pod creation."); } else if (podConfig.getImageName() == null) { throw new IllegalArgumentException("Must provide podConfig.imageName."); } Pod podToCreate = Fabric8Helper.getPodSpec(kubeConfig, podConfig, executionConfig); String podName = podToCreate.getMetadata().getName(); if (executionConfig.getLogLineAccumulator() == null) executionConfig.setLogLineAccumulator(new LogLineAccumulatorImpl(podName)); if(!podConfig.isEndOfLogIdentifierEmpty()) { executionConfig.getLogLineAccumulator().setCompletionIdentifier(podConfig.getEndOfLogIdentifier()); } PodWatcherImpl podWatcherImpl = podWatcherFactory.createPodWatcher( kubernetesHttpClients.getLogWatchClient(), podScheduled, podFinishedSuccessOrFailure, kubeConfig.getNameSpace(), podName, executionConfig.getLogLineAccumulator() ); Watch watch = initializePodWatcher(podName, podWatcherImpl); podWatcherImpl.setWatch(watch); logPodSpecs(startPod(podToCreate), START_POD_TEMPLATE); return podWatcherImpl; } }
PodPushClientImpl implements PodPushClient { @Override public PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig, CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure) { if (podConfig == null || executionConfig == null) { throw new IllegalArgumentException("Must provide configuration details for Pod creation."); } else if (podConfig.getImageName() == null) { throw new IllegalArgumentException("Must provide podConfig.imageName."); } Pod podToCreate = Fabric8Helper.getPodSpec(kubeConfig, podConfig, executionConfig); String podName = podToCreate.getMetadata().getName(); if (executionConfig.getLogLineAccumulator() == null) executionConfig.setLogLineAccumulator(new LogLineAccumulatorImpl(podName)); if(!podConfig.isEndOfLogIdentifierEmpty()) { executionConfig.getLogLineAccumulator().setCompletionIdentifier(podConfig.getEndOfLogIdentifier()); } PodWatcherImpl podWatcherImpl = podWatcherFactory.createPodWatcher( kubernetesHttpClients.getLogWatchClient(), podScheduled, podFinishedSuccessOrFailure, kubeConfig.getNameSpace(), podName, executionConfig.getLogLineAccumulator() ); Watch watch = initializePodWatcher(podName, podWatcherImpl); podWatcherImpl.setWatch(watch); logPodSpecs(startPod(podToCreate), START_POD_TEMPLATE); return podWatcherImpl; }  }
PodPushClientImpl implements PodPushClient { @Override public PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig, CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure) { if (podConfig == null || executionConfig == null) { throw new IllegalArgumentException("Must provide configuration details for Pod creation."); } else if (podConfig.getImageName() == null) { throw new IllegalArgumentException("Must provide podConfig.imageName."); } Pod podToCreate = Fabric8Helper.getPodSpec(kubeConfig, podConfig, executionConfig); String podName = podToCreate.getMetadata().getName(); if (executionConfig.getLogLineAccumulator() == null) executionConfig.setLogLineAccumulator(new LogLineAccumulatorImpl(podName)); if(!podConfig.isEndOfLogIdentifierEmpty()) { executionConfig.getLogLineAccumulator().setCompletionIdentifier(podConfig.getEndOfLogIdentifier()); } PodWatcherImpl podWatcherImpl = podWatcherFactory.createPodWatcher( kubernetesHttpClients.getLogWatchClient(), podScheduled, podFinishedSuccessOrFailure, kubeConfig.getNameSpace(), podName, executionConfig.getLogLineAccumulator() ); Watch watch = initializePodWatcher(podName, podWatcherImpl); podWatcherImpl.setWatch(watch); logPodSpecs(startPod(podToCreate), START_POD_TEMPLATE); return podWatcherImpl; }  @Override KubeConfig getKubeConfig(); @Override void setKubeConfig(KubeConfig kubeConfig); @Override KubernetesHttpClients getKubernetesHttpClients(); @Override void setKubernetesHttpClients(KubernetesHttpClients kubernetesHttpClients); @Override void close(); @Override PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig,
        CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure); @Override void startWithoutWatcher(PodConfig podConfig, ExecutionConfig executionConfig); void editPodAnnotations(String podName, Map<String, String> annotations); PodPushClientImpl setPodResourceFacadeFactory(PodResourceFacadeFactory podResourceFacadeFactory); boolean deletePod(String podName); PodPushClientImpl setPodWatcherFactory(PodWatcherFactory podWatcherFactory); }
PodPushClientImpl implements PodPushClient { @Override public PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig, CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure) { if (podConfig == null || executionConfig == null) { throw new IllegalArgumentException("Must provide configuration details for Pod creation."); } else if (podConfig.getImageName() == null) { throw new IllegalArgumentException("Must provide podConfig.imageName."); } Pod podToCreate = Fabric8Helper.getPodSpec(kubeConfig, podConfig, executionConfig); String podName = podToCreate.getMetadata().getName(); if (executionConfig.getLogLineAccumulator() == null) executionConfig.setLogLineAccumulator(new LogLineAccumulatorImpl(podName)); if(!podConfig.isEndOfLogIdentifierEmpty()) { executionConfig.getLogLineAccumulator().setCompletionIdentifier(podConfig.getEndOfLogIdentifier()); } PodWatcherImpl podWatcherImpl = podWatcherFactory.createPodWatcher( kubernetesHttpClients.getLogWatchClient(), podScheduled, podFinishedSuccessOrFailure, kubeConfig.getNameSpace(), podName, executionConfig.getLogLineAccumulator() ); Watch watch = initializePodWatcher(podName, podWatcherImpl); podWatcherImpl.setWatch(watch); logPodSpecs(startPod(podToCreate), START_POD_TEMPLATE); return podWatcherImpl; }  @Override KubeConfig getKubeConfig(); @Override void setKubeConfig(KubeConfig kubeConfig); @Override KubernetesHttpClients getKubernetesHttpClients(); @Override void setKubernetesHttpClients(KubernetesHttpClients kubernetesHttpClients); @Override void close(); @Override PodWatcher start(PodConfig podConfig, ExecutionConfig executionConfig,
        CountDownLatch podScheduled, CountDownLatch podFinishedSuccessOrFailure); @Override void startWithoutWatcher(PodConfig podConfig, ExecutionConfig executionConfig); void editPodAnnotations(String podName, Map<String, String> annotations); PodPushClientImpl setPodResourceFacadeFactory(PodResourceFacadeFactory podResourceFacadeFactory); boolean deletePod(String podName); PodPushClientImpl setPodWatcherFactory(PodWatcherFactory podWatcherFactory); static final String UNDEFINED_NODE_NAME; }