@Test public void testApiStatusNotAvailable () throws ApiException { when(coreApi.getAPIVersions()).thenThrow(new ApiException()); Assert.assertEquals(ApiStatus.ERROR, platform.getApiStatus()); }
@Override public ApiStatus getApiStatus () { try { getCoreApi().getAPIVersions().getVersions(); return ApiStatus.OK; } catch (ApiException e) { log.error("Kubernetes API health check failed", e); return ApiStatus.ERROR; } }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public ApiStatus getApiStatus () { try { getCoreApi().getAPIVersions().getVersions(); return ApiStatus.OK; } catch (ApiException e) { log.error("Kubernetes API health check failed", e); return ApiStatus.ERROR; } } }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public ApiStatus getApiStatus () { try { getCoreApi().getAPIVersions().getVersions(); return ApiStatus.OK; } catch (ApiException e) { log.error("Kubernetes API health check failed", e); return ApiStatus.ERROR; } } @Autowired  KubernetesPlatform(ApiClient apiClient); }
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public ApiStatus getApiStatus () { try { getCoreApi().getAPIVersions().getVersions(); return ApiStatus.OK; } catch (ApiException e) { log.error("Kubernetes API health check failed", e); return ApiStatus.ERROR; } } @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 ApiStatus getApiStatus () { try { getCoreApi().getAPIVersions().getVersions(); return ApiStatus.OK; } catch (ApiException e) { log.error("Kubernetes API health check failed", e); return ApiStatus.ERROR; } } @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);  }