Class PodUtils
- java.lang.Object
-
- org.csanchez.jenkins.plugins.kubernetes.PodUtils
-
public final class PodUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Predicate<io.fabric8.kubernetes.api.model.ContainerStatus>
CONTAINER_IS_TERMINATED
static Predicate<io.fabric8.kubernetes.api.model.ContainerStatus>
CONTAINER_IS_WAITING
-
Constructor Summary
Constructors Constructor Description PodUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
cancelQueueItemFor(io.fabric8.kubernetes.api.model.Pod pod, String reason)
Cancel queue items matching the given pod.static List<io.fabric8.kubernetes.api.model.ContainerStatus>
getContainers(io.fabric8.kubernetes.api.model.Pod pod, Predicate<io.fabric8.kubernetes.api.model.ContainerStatus> predicate)
static List<io.fabric8.kubernetes.api.model.ContainerStatus>
getContainerStatus(io.fabric8.kubernetes.api.model.Pod pod)
static List<io.fabric8.kubernetes.api.model.ContainerStatus>
getTerminatedContainers(io.fabric8.kubernetes.api.model.Pod pod)
static List<io.fabric8.kubernetes.api.model.ContainerStatus>
getWaitingContainers(io.fabric8.kubernetes.api.model.Pod pod)
static String
logLastLines(io.fabric8.kubernetes.api.model.Pod pod, io.fabric8.kubernetes.client.KubernetesClient client)
-
-
-
Method Detail
-
getTerminatedContainers
@NonNull public static List<io.fabric8.kubernetes.api.model.ContainerStatus> getTerminatedContainers(io.fabric8.kubernetes.api.model.Pod pod)
-
getWaitingContainers
public static List<io.fabric8.kubernetes.api.model.ContainerStatus> getWaitingContainers(io.fabric8.kubernetes.api.model.Pod pod)
-
getContainerStatus
public static List<io.fabric8.kubernetes.api.model.ContainerStatus> getContainerStatus(io.fabric8.kubernetes.api.model.Pod pod)
-
getContainers
public static List<io.fabric8.kubernetes.api.model.ContainerStatus> getContainers(io.fabric8.kubernetes.api.model.Pod pod, Predicate<io.fabric8.kubernetes.api.model.ContainerStatus> predicate)
-
cancelQueueItemFor
public static void cancelQueueItemFor(io.fabric8.kubernetes.api.model.Pod pod, String reason)
Cancel queue items matching the given pod. It uses the annotation "runUrl" added to the pod to do the matching. It uses the current thread context to list item queues, so make sure to be in the right context before calling this method.- Parameters:
pod
- The pod to cancel items for.reason
- The reason the item are being cancelled.
-
logLastLines
@CheckForNull public static String logLastLines(@NonNull io.fabric8.kubernetes.api.model.Pod pod, @NonNull io.fabric8.kubernetes.client.KubernetesClient client)
-
-