Search in sources :

Example 1 with ListSecretForAllNamespaces

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();
    });
}
Also used : ListNamespacedSecret(com.marcnuri.yakc.api.core.v1.CoreV1Api.ListNamespacedSecret) ListSecretForAllNamespaces(com.marcnuri.yakc.api.core.v1.CoreV1Api.ListSecretForAllNamespaces) CoreV1Api(com.marcnuri.yakc.api.core.v1.CoreV1Api)

Aggregations

CoreV1Api (com.marcnuri.yakc.api.core.v1.CoreV1Api)1 ListNamespacedSecret (com.marcnuri.yakc.api.core.v1.CoreV1Api.ListNamespacedSecret)1 ListSecretForAllNamespaces (com.marcnuri.yakc.api.core.v1.CoreV1Api.ListSecretForAllNamespaces)1