use of io.fabric8.kubernetes.jolokia.JolokiaClients in project fabric8 by fabric8io.
the class J4pClientProvider method lookup.
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
KubernetesClient client = this.clientInstance.get();
Session session = this.sessionInstance.get();
JolokiaClients jolokiaClients = new JolokiaClients(client);
String serviceName = getServiceName(qualifiers);
String podName = getPodName(qualifiers);
String replicationControllerName = getReplicationControllerName(qualifiers);
if (Strings.isNotBlank(serviceName)) {
Service service = client.services().inNamespace(session.getNamespace()).withName(serviceName).get();
if (service != null) {
return jolokiaClients.clientForService(service);
}
}
if (Strings.isNotBlank(podName)) {
Pod pod = client.pods().inNamespace(session.getNamespace()).withName(serviceName).get();
if (pod != null) {
return jolokiaClients.clientForPod(pod);
}
}
if (Strings.isNotBlank(replicationControllerName)) {
ReplicationController replicationController = client.replicationControllers().inNamespace(session.getNamespace()).withName(replicationControllerName).get();
if (replicationController != null) {
return jolokiaClients.clientForReplicationController(replicationController);
}
}
return null;
}
use of io.fabric8.kubernetes.jolokia.JolokiaClients in project fabric8 by fabric8io.
the class JolokiaClientsProvider method lookup.
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
KubernetesClient client = this.clientInstance.get();
JolokiaClients jolokiaClients = new JolokiaClients(client);
return jolokiaClients;
}
Aggregations