Package io.jenkins.plugins.kubevirt
Class ProvisioningFailureTracker
java.lang.Object
io.jenkins.plugins.kubevirt.ProvisioningFailureTracker
Tracks consecutive VM provisioning failures per template.
When a launch fails, the counter increments. A successful agent connection
resets the counter. If consecutive failures exceed the template's retry
count (KubeVirtTemplate.getMaxProvisionAttempts()), waiting queue
items are cancelled so Jenkins does not provision VMs indefinitely.
0 fails after the first launch; -1 disables the limit.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetFailureCount(String templateId) Returns the current failure count without modifying it.static intrecordFailure(String templateId) Records a provisioning failure and returns the new failure count.static voidClears the failure counter after a successful launch or after giving up.
-
Method Details
-
recordFailure
Records a provisioning failure and returns the new failure count.- Parameters:
templateId- theKubeVirtTemplate.getId()of the failed template- Returns:
- the updated consecutive failure count, or
0iftemplateIdis blank
-
getFailureCount
Returns the current failure count without modifying it. -
reset
Clears the failure counter after a successful launch or after giving up.
-