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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener called when a Kubernetes event related to a Kubernetes agent happens.static classSaveableListenerthat will update cloud watchers when Jenkins configuration is updated.static classOnly useful for tests which shutdown Jenkins without terminating the JVM.static classstatic classstatic classstatic classNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReapervoidvoidpreLaunch(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, onIdle, 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:
preLaunchin classComputerListener- Throws:
IOExceptionInterruptedException
-
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()
-