ClusterAccess { public <T extends KubernetesClient> T createDefaultClient(Logger log) { if (isOpenShift(log)) { return (T) createOpenShiftClient(); } return (T) createKubernetesClient(); } ClusterAccess(ClusterConfiguration clusterConfiguration); @Deprecated  ClusterAccess(String namespace);  ClusterAccess(ClusterConfiguration clusterConfiguration, KubernetesClient client); T createDefaultClient(Logger log); KubernetesClient createKubernetesClient(); OpenShiftClient createOpenShiftClient(); String getNamespace(); boolean isOpenShiftImageStream(Logger log); boolean isOpenShift(Logger log); RuntimeMode resolveRuntimeMode(RuntimeMode mode, Logger log);  }
@Test @Ignore("Ignored as long as the kubernetes client not update with the fix https: public void createClientTestOpenshift() throws Exception { paths.add("/oapi"); paths.add("/oapi/v1"); RootPaths rootpaths = new RootPaths(); rootpaths.setPaths(paths); mockServer.expect().get().withPath("/" ).andReturn(200, rootpaths).always(); ClusterAccess clusterAccess = new ClusterAccess(null, client); Client outputClient = clusterAccess.createDefaultClient(logger); assertTrue(outputClient instanceof OpenShiftClient); }
@Test @Ignore("Ignored as long as the kubernetes client not update with the fix https: public void createClientTestKubernetes() throws Exception { RootPaths rootpaths = new RootPaths(); rootpaths.setPaths(paths); mockServer.expect().get().withPath("/" ).andReturn(200, rootpaths).always(); ClusterAccess clusterAccess = new ClusterAccess(null, client); Client outputClient = clusterAccess.createDefaultClient(logger); assertTrue(outputClient instanceof KubernetesClient); }