Class PodRetention
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<PodRetention>
-
- org.csanchez.jenkins.plugins.kubernetes.pod.retention.PodRetention
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<PodRetention>
public abstract class PodRetention extends AbstractDescribableImpl<PodRetention> implements ExtensionPoint
PodRetention
instances determine if the Kubernetes pod running a Jenkins agent should be deleted after Jenkins terminates the agent.Custom pod retention behavior can be added by extending this class, including a descriptor that extends
PodRetentionDescriptor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description PodRetention()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static PodRetention
getKubernetesCloudDefault()
Returns the defaultPodRetention
for aKubernetesCloud
instance.static PodRetention
getPodTemplateDefault()
Returns the defaultPodRetention
for aPodTemplate
instance.abstract boolean
shouldDeletePod(KubernetesCloud cloud, Supplier<io.fabric8.kubernetes.api.model.Pod> pod)
Determines if a agent pod should be deleted after the Jenkins build completes.String
toString()
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
getKubernetesCloudDefault
public static PodRetention getKubernetesCloudDefault()
Returns the defaultPodRetention
for aKubernetesCloud
instance.- Returns:
- the
Never
PodRetention
strategy.
-
getPodTemplateDefault
public static PodRetention getPodTemplateDefault()
Returns the defaultPodRetention
for aPodTemplate
instance.- Returns:
- the
Default
PodRetention
strategy.
-
shouldDeletePod
public abstract boolean shouldDeletePod(KubernetesCloud cloud, Supplier<io.fabric8.kubernetes.api.model.Pod> pod)
Determines if a agent pod should be deleted after the Jenkins build completes.- Parameters:
cloud
- - theKubernetesCloud
the agent pod belongs to.pod
- - thePod
running the Jenkins build.- Returns:
true
if the agent pod should be deleted.
-
-