.withLabels(config.getLabels()).list().getItems() .forEach(s -> putAll(s, result));
@Override protected PodList listSelectedPods(ReplicationController obj) { return pods().inNamespace(namespace).withLabels(obj.getSpec().getSelector()).list(); }
client.secrets() .inNamespace(namespace) .withLabels(config.getLabels()) .list() .getItems()
public void deletePod(String namespace, Map<String, String> labels) { log.info("Delete pods with labels: {}", labels.toString()); client.pods().inNamespace(namespace).withLabels(labels).delete(); }
private Set<String> pullClusterMembers() { List<Pod> pods = kubernetesClient.pods() .inNamespace(this.lockConfiguration.getKubernetesResourcesNamespaceOrDefault(kubernetesClient)) .withLabels(this.lockConfiguration.getClusterLabels()) .list().getItems(); return pods.stream().map(pod -> pod.getMetadata().getName()).collect(Collectors.toSet()); }
@Override public void listMaps(Handler<AsyncResult<List<KafkaTopic>>> handler) { vertx.executeBlocking(future -> { try { future.complete(operation().inNamespace(namespace).withLabels(resourcePredicate.labels()).list().getItems()); } catch (Exception e) { future.fail(e); } }, handler); }
protected Watch watchInNamespace(String namespace, Labels selector, Watcher<T> watcher) { return operation().inNamespace(namespace).withLabels(selector.toMap()).watch(watcher); }
public List<PersistentVolumeClaim> listPersistentVolumeClaims(Map<String, String> labels) { return client.persistentVolumeClaims().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
public List<Secret> listSecrets(Map<String, String> labels) { return client.secrets().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
public List<ConfigMap> listConfigMaps(Map<String, String> labels) { return client.configMaps().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
public List<ServiceAccount> listServiceAccounts(Map<String, String> labels) { return client.serviceAccounts().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
public List<Service> listServices(Map<String, String> labels) { return client.services().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
@Override protected PodList listSelectedPods(ReplicationController obj) { return pods().inNamespace(namespace).withLabels(obj.getSpec().getSelector()).list(); }
public List<Deployment> listDeployments(Map<String, String> labels) { return client.apps().deployments().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
public List<StatefulSet> listStatefulSets(Map<String, String> labels) { return client.apps().statefulSets().inNamespace(globalNamespace).withLabels(labels).list().getItems(); }
protected List<T> listInNamespace(String namespace, Labels selector) { NonNamespaceOperation<T, L, D, R> tldrNonNamespaceOperation = operation().inNamespace(namespace); if (selector != null) { Map<String, String> labels = selector.toMap(); return tldrNonNamespaceOperation.withLabels(labels) .list() .getItems(); } else { return tldrNonNamespaceOperation .list() .getItems(); } }
@Override public Object lookup(ArquillianResource resource, Annotation... qualifiers) { KubernetesClient client = this.clientInstance.get(); Session session = sessionInstance.get(); Map<String, String> labels = getLabels(qualifiers); if( labels.isEmpty() ) { return client.services().inNamespace(session.getNamespace()).list(); } else { return client.services().inNamespace(session.getNamespace()).withLabels(labels).list(); } } }
@Override public Object lookup(ArquillianResource resource, Annotation... qualifiers) { KubernetesClient client = this.clientInstance.get(); Session session = sessionInstance.get(); Map<String, String> labels = getLabels(qualifiers); if( labels.isEmpty() ) { return client.replicationControllers().inNamespace(session.getNamespace()).list(); } else { return client.replicationControllers().inNamespace(session.getNamespace()).withLabels(labels).list(); } } }
@Override public Object lookup(ArquillianResource resource, Annotation... qualifiers) { KubernetesClient client = this.clientInstance.get(); Session session = sessionInstance.get(); Map<String, String> labels = getLabels(qualifiers); if( labels.isEmpty() ) { return client.pods().inNamespace(session.getNamespace()).list(); } else{ return client.pods().inNamespace(session.getNamespace()).withLabels(labels).list(); } } }
@Override public Object lookup(ArquillianResource resource, Annotation... qualifiers) { KubernetesClient client = this.clientInstance.get(); Session session = sessionInstance.get(); String name = getPodName(qualifiers); if (name != null) { return client.pods().inNamespace(session.getNamespace()).withName(name).get(); } // Gets the first pod found that matches the labels. Map<String, String> labels = getLabels(qualifiers); PodList list = client.pods().inNamespace(session.getNamespace()).withLabels(labels).list(); List<Pod> pods = notNullList(list.getItems()); if( !pods.isEmpty() ) { return pods.get(0); } return null; } }