Class Reaper
java.lang.Object
hudson.slaves.ComputerListener
org.csanchez.jenkins.plugins.kubernetes.pod.retention.Reaper
- All Implemented Interfaces:
ExtensionPoint
Checks for deleted pods corresponding to
KubernetesSlave
and ensures the node is removed from Jenkins too.
If the pod has been deleted, all of the associated state (running user processes, workspace, etc.) must also be gone;
so there is no point in retaining this agent definition any further.
(KubernetesSlave
is not an EphemeralNode
: it does support running across Jenkins restarts.)
Note that pod retention policies other than the default Never
may disable this system,
unless some external process or garbage collection policy results in pod deletion.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Listener called when a Kubernetes event related to a Kubernetes agent happens.static class
SaveableListener
that will update cloud watchers when Jenkins configuration is updated.static class
Only useful for tests which shutdown Jenkins without terminating the JVM.static class
static class
static class
static class
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Reaper
void
void
preLaunch
(Computer c, TaskListener taskListener) terminationReasons
(String node) Get any reason(s) why a node was terminated by a listener.Methods inherited from class hudson.slaves.ComputerListener
all, onConfigurationChange, onLaunchFailure, onOffline, onOffline, onOnline, onOnline, onTemporarilyOffline, onTemporarilyOnline, preOnline, register, unregister
-
Constructor Details
-
Reaper
public Reaper()
-
-
Method Details
-
getInstance
-
preLaunch
public void preLaunch(Computer c, TaskListener taskListener) throws IOException, InterruptedException - Overrides:
preLaunch
in classComputerListener
- Throws:
IOException
InterruptedException
-
maybeActivate
public void maybeActivate() -
getWatchers
-
terminationReasons
Get any reason(s) why a node was terminated by a listener.- Parameters:
node
- aNode.getNodeName()
- Returns:
- a possibly empty set of
ContainerStateTerminated.getReason()
orPodStatus.getReason()
-