Package io.jenkins.plugins.kubevirt
Class QueueUtils
java.lang.Object
io.jenkins.plugins.kubevirt.QueueUtils
Utilities for interacting with the Jenkins build queue.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcancelWaitingItemsSatisfiedBy(Set<LabelAtom> agentLabels, String reason) Cancels queue items whose assigned label is satisfied by the given agent labels.
-
Method Details
-
cancelWaitingItemsSatisfiedBy
Cancels queue items whose assigned label is satisfied by the given agent labels.A job waiting for
linuxis cancelled when the agent labels includelinux(for examplelinux kubevirt). Jobs whose expression is not satisfied (for examplewindows) are left in the queue.For Freestyle (and other
Jobtasks), the reason is also appended to the build console when aRuncan be resolved. Pipelinenode/agentwaits are notJobs; those items are cancelled only, and the reason is recorded in the Jenkins system log.- Parameters:
agentLabels- labels of the agent that failed to provisionreason- a human-readable reason included in log messages- Returns:
- the number of queue items cancelled
-