Class KubeVirtPlannedNode
- All Implemented Interfaces:
org.jenkinsci.plugins.cloudstats.TrackedItem
With the provisioning-launcher approach, the Future is typically
pre-resolved (CompletableFuture.completedFuture(agent)), so the
agent node is registered by Jenkins core almost immediately. VM lifecycle
(creation, waiting, SSH) is handled inside
KubeVirtProvisioningLauncher.launch(hudson.slaves.SlaveComputer, hudson.model.TaskListener), not in the future.
This class still handles the edge case where agent construction itself fails (the future completes exceptionally) — there is no VM to clean up in that case since provisioning hasn't started yet.
-
Field Summary
Fields inherited from class hudson.slaves.NodeProvisioner.PlannedNode
displayName, future, numExecutors -
Constructor Summary
ConstructorsConstructorDescriptionKubeVirtPlannedNode(String displayName, Future<Node> future, int numExecutors, org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId, String templateName) Creates a new tracked planned node. -
Method Summary
-
Constructor Details
-
KubeVirtPlannedNode
public KubeVirtPlannedNode(String displayName, Future<Node> future, int numExecutors, org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId, String templateName) Creates a new tracked planned node.- Parameters:
displayName- The display name for this nodefuture- The future that will provide the nodenumExecutors- The number of executors this node will provideprovisioningId- The cloud-stats provisioning activity IDtemplateName- The name of the template being used for provisioning
-
-
Method Details
-
getCloudName
Gets the name of the cloud that is provisioning this node.- Returns:
- The cloud name
-
getTemplateName
Gets the name of the template being used to provision this node.- Returns:
- The template name
-
getId
public org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id getId()- Specified by:
getIdin interfaceorg.jenkinsci.plugins.cloudstats.TrackedItem
-
spent
public void spent()Called when this planned node is being consumed by Jenkins.With the pre-resolved future approach, this is called shortly after
provision()returns. In the success case (the normal path), the node was already created and Jenkins will add it — no cleanup needed. The only case requiring action is when the future completed exceptionally (agent construction failed), but since no VM was created at that point, there is nothing to clean up.- Overrides:
spentin classNodeProvisioner.PlannedNode
-