com.codacy.scoobydoo.kubernetes.handlers.FindPodByNameHandler Maven / Gradle / Ivy
package com.codacy.scoobydoo.kubernetes.handlers;
import io.fabric8.kubernetes.client.KubernetesClient;
import java.util.concurrent.Callable;
public class FindPodByNameHandler implements Callable {
private final KubernetesClient kubernetesClient;
private final String podName;
private final String namespace;
public FindPodByNameHandler(KubernetesClient kubernetesClient, String podName, String namespace) {
this.kubernetesClient = kubernetesClient;
this.podName = podName;
this.namespace = namespace;
}
@Override
public Boolean call() {
return kubernetesClient
.pods()
.inNamespace(namespace)
.withName(podName).get() != null;
}
}