Class KubeVirtComputer

All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, ExecutorListener, ModelObject, SearchableModelObject, SearchItem, AccessControlled, IComputer, ModelObjectWithContextMenu, Named, HasWidgets, IconSpec, org.jenkinsci.plugins.cloudstats.TrackedItem, org.kohsuke.stapler.StaplerProxy

public class KubeVirtComputer extends AbstractCloudComputer<KubeVirtAgent> implements org.jenkinsci.plugins.cloudstats.TrackedItem
Computer implementation for KubeVirt agents. Implements TrackedItem for cloud-stats plugin integration.
  • Constructor Details

    • KubeVirtComputer

      public KubeVirtComputer(KubeVirtAgent agent)
  • Method Details

    • isProvisioning

      public boolean isProvisioning()
      Returns true while the VM is still being provisioned, i.e. the agent's launcher is still the KubeVirtProvisioningLauncher. Once provisioning completes the launcher is swapped to the real SSH launcher and this method returns false.
    • getIcon

      public String getIcon()
      Overrides the default computer icon so that nodes still being provisioned are visually distinct from regular online/offline nodes.
      • Provisioning — symbol-computer-paused (same icon Jenkins uses for "will connect when needed")
      • Otherwise — delegates to the default Jenkins implementation
      Specified by:
      getIcon in interface IComputer
      Overrides:
      getIcon in class Computer
    • getIconClassName

      public String getIconClassName()
      Overrides SlaveComputer.getIconClassName() which returns the online icon (symbol-computer) while a connection attempt is in progress. For KubeVirt agents that are still provisioning a VM this is misleading, so we return a distinct "paused / waiting" icon instead.
      Specified by:
      getIconClassName in interface IComputer
      Specified by:
      getIconClassName in interface IconSpec
      Overrides:
      getIconClassName in class SlaveComputer
    • getIconAltText

      public String getIconAltText()
      Provides alt text that matches the provisioning icon.
      Specified by:
      getIconAltText in interface IComputer
    • doDoDelete

      public org.kohsuke.stapler.HttpResponse doDoDelete() throws IOException
      Override delete action to track that this is a user-initiated deletion. This ensures the correct OfflineCause is used when the agent goes offline.
      Overrides:
      doDoDelete in class AbstractCloudComputer<KubeVirtAgent>
      Throws:
      IOException
    • getId

      public org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id getId()
      Gets the provisioning activity ID for cloud-stats tracking. Delegates to the associated KubeVirtAgent node.
      Specified by:
      getId in interface org.jenkinsci.plugins.cloudstats.TrackedItem
      Returns:
      The provisioning activity ID, or null if the node is not available
    • getACL

      @NonNull public ACL getACL()
      Override ACL to deny CONFIGURE permission. KubeVirt agents are dynamically provisioned and should not be manually configured. This hides the Configure link from the sidebar.
      Specified by:
      getACL in interface AccessControlled
      Specified by:
      getACL in interface IComputer