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