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 -
Method Summary
Modifier and TypeMethodDescriptionstatic PodRetentionReturns the defaultPodRetentionfor aKubernetesCloudinstance.static PodRetentionReturns the defaultPodRetentionfor aPodTemplateinstance.abstract booleanshouldDeletePod(KubernetesCloud cloud, Supplier<io.fabric8.kubernetes.api.model.Pod> pod) Determines if a agent pod should be deleted after the Jenkins build completes.toString()Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
PodRetention
public PodRetention()
-
-
Method Details
-
getKubernetesCloudDefault
Returns the defaultPodRetentionfor aKubernetesCloudinstance.- Returns:
- the
NeverPodRetentionstrategy.
-
getPodTemplateDefault
Returns the defaultPodRetentionfor aPodTemplateinstance.- Returns:
- the
DefaultPodRetentionstrategy.
-
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- - theKubernetesCloudthe agent pod belongs to.pod- - thePodrunning the Jenkins build.- Returns:
trueif the agent pod should be deleted.
-
toString
-