Class PodContainerSource.DefaultPodContainerSource
java.lang.Object
org.csanchez.jenkins.plugins.kubernetes.PodContainerSource
org.csanchez.jenkins.plugins.kubernetes.PodContainerSource.DefaultPodContainerSource
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
- PodContainerSource
@Extension
public static final class PodContainerSource.DefaultPodContainerSource
extends PodContainerSource
Default implementation of
PodContainerSource
that only searches the primary
pod containers. Ephemeral or init containers are not included container lookups in
this implementation.- See Also:
-
PodSpec.getContainers()
-
Nested Class Summary
Nested classes/interfaces inherited from class org.csanchez.jenkins.plugins.kubernetes.PodContainerSource
PodContainerSource.DefaultPodContainerSource
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<io.fabric8.kubernetes.api.model.ContainerStatus>
getContainerStatus
(io.fabric8.kubernetes.api.model.Pod pod, String containerName) Lookup the status of the named container.getContainerWorkingDir
(io.fabric8.kubernetes.api.model.Pod pod, String containerName) Lookup the working directory of the named container.Methods inherited from class org.csanchez.jenkins.plugins.kubernetes.PodContainerSource
all, lookupContainerStatus, lookupContainerWorkingDir
-
Constructor Details
-
DefaultPodContainerSource
public DefaultPodContainerSource()
-
-
Method Details
-
getContainerWorkingDir
public Optional<String> getContainerWorkingDir(@NonNull io.fabric8.kubernetes.api.model.Pod pod, @NonNull String containerName) Description copied from class:PodContainerSource
Lookup the working directory of the named container.- Specified by:
getContainerWorkingDir
in classPodContainerSource
- Parameters:
pod
- pod reference to lookup container incontainerName
- name of container to lookup- Returns:
- working directory path if container found and working dir specified, otherwise empty
-
getContainerStatus
public Optional<io.fabric8.kubernetes.api.model.ContainerStatus> getContainerStatus(@NonNull io.fabric8.kubernetes.api.model.Pod pod, @NonNull String containerName) Description copied from class:PodContainerSource
Lookup the status of the named container.- Specified by:
getContainerStatus
in classPodContainerSource
- Parameters:
pod
- pod reference to lookup container incontainerName
- name of container to lookup- Returns:
- container status if found, otherwise empty
-