use of io.fabric8.kubernetes.api.model.DoneableNode in project camel by apache.
the class KubernetesNodesProducer method doListNodesByLabels.
protected void doListNodesByLabels(Exchange exchange, String operation) throws Exception {
NodeList nodeList = null;
Map<String, String> labels = exchange.getIn().getHeader(KubernetesConstants.KUBERNETES_NODES_LABELS, Map.class);
NonNamespaceOperation<Node, NodeList, DoneableNode, Resource<Node, DoneableNode>> nodes = getEndpoint().getKubernetesClient().nodes();
for (Map.Entry<String, String> entry : labels.entrySet()) {
nodes.withLabel(entry.getKey(), entry.getValue());
}
nodeList = nodes.list();
MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
exchange.getOut().setBody(nodeList.getItems());
}
Aggregations