public abstract class PodRetention extends AbstractDescribableImpl<PodRetention> implements ExtensionPoint
PodRetention
instances determine if the Kubernetes pod running a Jenkins slave
should be deleted after Jenkins terminates the slave.
Custom pod retention behavior can be added by extending this class, including a descriptor
that extends PodRetentionDescriptor
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
PodRetention() |
Modifier and Type | Method and Description |
---|---|
static PodRetention |
getKubernetesCloudDefault()
Returns the default
PodRetention for a KubernetesCloud instance. |
static PodRetention |
getPodTemplateDefault()
Returns the default
PodRetention for a PodTemplate instance. |
abstract boolean |
shouldDeletePod(KubernetesCloud cloud,
io.fabric8.kubernetes.api.model.Pod pod)
Determines if a slave pod should be deleted after the Jenkins build completes.
|
String |
toString() |
getDescriptor
public static PodRetention getKubernetesCloudDefault()
PodRetention
for a KubernetesCloud
instance.Never
PodRetention
strategy.public static PodRetention getPodTemplateDefault()
PodRetention
for a PodTemplate
instance.Default
PodRetention
strategy.public abstract boolean shouldDeletePod(KubernetesCloud cloud, io.fabric8.kubernetes.api.model.Pod pod)
cloud
- - the KubernetesCloud
the slave pod belongs to.pod
- - the Pod
running the Jenkins build.true
if the slave pod should be deleted.Copyright © 2016–2019. All rights reserved.