use of com.marcnuri.yakc.api.core.v1.CoreV1Api.ListServiceForAllNamespaces in project yakc by manusa.
the class ServiceService method watch.
@Override
public Observable<WatchEvent<Service>> watch() throws IOException {
final CoreV1Api api = kubernetesClient.create(CoreV1Api.class);
return tryWithFallback(() -> {
api.listServiceForAllNamespaces(new ListServiceForAllNamespaces().limit(1)).get();
return api.listServiceForAllNamespaces().watch();
}, () -> {
final String ns = kubernetesClient.getConfiguration().getNamespace();
api.listNamespacedService(ns, new ListNamespacedService().limit(1)).get();
return api.listNamespacedService(ns).watch();
});
}
Aggregations