Package io.jenkins.plugins.kubevirt
Class OrphanedVMCleanupPeriodicWork
java.lang.Object
java.util.TimerTask
hudson.triggers.SafeTimerTask
hudson.model.PeriodicWork
hudson.model.AsyncPeriodicWork
io.jenkins.plugins.kubevirt.OrphanedVMCleanupPeriodicWork
- All Implemented Interfaces:
ExtensionPoint,Runnable
Periodic background task that detects and cleans up orphaned VMs in Kubernetes.
A VM is considered orphaned if:
- It exists in Kubernetes with our cloud label
- No corresponding Jenkins agent is registered
- It has existed for longer than the template's grace period (to avoid deleting VMs still provisioning)
This provides a safety net for scenarios where:
- Agent registration failed after VM creation
- Jenkins crashed/restarted during provisioning
- Network issues prevented proper cleanup
- The _terminate callback failed to delete the VM
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnableNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.AsyncPeriodicWork
nameFields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class hudson.model.AsyncPeriodicWork
createListener, doRun, getErrorLoggingLevel, getLogFile, getNormalLoggingLevel, getSlowLoggingLevel, queueIfAlreadyRunningMethods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, initMethods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, runMethods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Constructor Details
-
OrphanedVMCleanupPeriodicWork
public OrphanedVMCleanupPeriodicWork()
-
-
Method Details
-
getRecurrencePeriod
public long getRecurrencePeriod()- Specified by:
getRecurrencePeriodin classPeriodicWork
-
execute
- Specified by:
executein classAsyncPeriodicWork
-