@Test public void testPlatformHealthNoNamespacesToTest () throws ApiException { when(coreV1Api.listNamespacedPod(anyString(), anyString(), anyBoolean(), anyString(), anyString(), anyString(), anyInt(), anyString(), anyInt(), anyBoolean())).thenReturn(getV1PodList(true, 0)); assertEquals(PlatformHealth.DEGRADED, platform.getPlatformHealth()); }
@Override public PlatformHealth getPlatformHealth () { try { V1PodList pods = listAllPodsInNamespace(); return (!pods.getItems().isEmpty()) ? PlatformHealth.OK : PlatformHealth.DEGRADED; } catch (ApiException e) { log.error("Kubernetes Platform health check failed", e); return PlatformHealth.FAILED; } }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public PlatformHealth getPlatformHealth () { try { V1PodList pods = listAllPodsInNamespace(); return (!pods.getItems().isEmpty()) ? PlatformHealth.OK : PlatformHealth.DEGRADED; } catch (ApiException e) { log.error("Kubernetes Platform health check failed", e); return PlatformHealth.FAILED; } } }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public PlatformHealth getPlatformHealth () { try { V1PodList pods = listAllPodsInNamespace(); return (!pods.getItems().isEmpty()) ? PlatformHealth.OK : PlatformHealth.DEGRADED; } catch (ApiException e) { log.error("Kubernetes Platform health check failed", e); return PlatformHealth.FAILED; } } @Autowired  KubernetesPlatform(ApiClient apiClient); }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public PlatformHealth getPlatformHealth () { try { V1PodList pods = listAllPodsInNamespace(); return (!pods.getItems().isEmpty()) ? PlatformHealth.OK : PlatformHealth.DEGRADED; } catch (ApiException e) { log.error("Kubernetes Platform health check failed", e); return PlatformHealth.FAILED; } } @Autowired  KubernetesPlatform(ApiClient apiClient); String getNamespace(); void setNamespace(String namespace); ContainerHealth checkHealth(KubernetesPodContainer kubernetesPodContainer); @Override ApiStatus getApiStatus(); @Override PlatformLevel getPlatformLevel(); @Override PlatformHealth getPlatformHealth(); @Override boolean isContainerRecycled(Container container); ContainerHealth replicaSetRecovered(KubernetesPodContainer kubernetesPodContainer); boolean isDesiredReplicas(KubernetesPodContainer instance); @Override void recycleContainer(KubernetesPodContainer container); boolean deletePod(KubernetesPodContainer instance); @Override ShellClient getConnectedShellClient(KubernetesPodContainer container); }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public PlatformHealth getPlatformHealth () { try { V1PodList pods = listAllPodsInNamespace(); return (!pods.getItems().isEmpty()) ? PlatformHealth.OK : PlatformHealth.DEGRADED; } catch (ApiException e) { log.error("Kubernetes Platform health check failed", e); return PlatformHealth.FAILED; } } @Autowired  KubernetesPlatform(ApiClient apiClient); String getNamespace(); void setNamespace(String namespace); ContainerHealth checkHealth(KubernetesPodContainer kubernetesPodContainer); @Override ApiStatus getApiStatus(); @Override PlatformLevel getPlatformLevel(); @Override PlatformHealth getPlatformHealth(); @Override boolean isContainerRecycled(Container container); ContainerHealth replicaSetRecovered(KubernetesPodContainer kubernetesPodContainer); boolean isDesiredReplicas(KubernetesPodContainer instance); @Override void recycleContainer(KubernetesPodContainer container); boolean deletePod(KubernetesPodContainer instance); @Override ShellClient getConnectedShellClient(KubernetesPodContainer container);  }