Search in sources :

Example 56 with Session

use of io.fabric8.arquillian.kubernetes.Session in project fabric8 by fabric8io.

the class ServiceListResourceProvider method lookup.

@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();
    }
}
Also used : KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) Session(io.fabric8.arquillian.kubernetes.Session)

Aggregations

IOException (java.io.IOException)14 Session (io.fabric8.arquillian.kubernetes.Session)8 FabricException (io.fabric8.api.FabricException)7 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)7 Test (org.junit.Test)6 Session (com.jcraft.jsch.Session)5 CreateContainerMetadata (io.fabric8.api.CreateContainerMetadata)5 File (java.io.File)5 Logger (io.fabric8.arquillian.kubernetes.log.Logger)4 Pod (io.fabric8.kubernetes.api.model.Pod)4 Service (io.fabric8.kubernetes.api.model.Service)4 OpenShiftClient (io.fabric8.openshift.client.OpenShiftClient)4 ArrayList (java.util.ArrayList)4 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)4 FabricAuthenticationException (io.fabric8.api.FabricAuthenticationException)3 Util.readAsString (io.fabric8.arquillian.utils.Util.readAsString)3 ZooKeeperGroup (io.fabric8.groups.internal.ZooKeeperGroup)3 GeneratorContext (io.fabric8.maven.generator.api.GeneratorContext)3 MultiException (io.fabric8.utils.MultiException)3 HashMap (java.util.HashMap)3