Package io.jenkins.plugins.kubevirt
Class KubeVirtComputer
java.lang.Object
- 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Computer
Computer.InternalComputerListener, Computer.TerminationRequestNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Field Summary
Fields inherited from class hudson.slaves.SlaveComputer
ALLOW_UNSUPPORTED_REMOTING_VERSIONSFields inherited from class hudson.model.Computer
BUILD, CONFIGURE, CONNECT, CREATE, DELETE, DISCONNECT, EXTENDED_READ, EXTENDED_READ_AND_CONNECT, nodeName, offlineCause, PERMISSIONS, SKIP_PERMISSION_CHECK, statusChangeLock, threadPoolForRemoting, transientActions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.stapler.HttpResponseOverride delete action to track that this is a user-initiated deletion.getACL()Override ACL to deny CONFIGURE permission.getIcon()Overrides the default computer icon so that nodes still being provisioned are visually distinct from regular online/offline nodes.Provides alt text that matches the provisioning icon.OverridesSlaveComputer.getIconClassName()which returns the online icon (symbol-computer) while a connection attempt is in progress.org.jenkinsci.plugins.cloudstats.ProvisioningActivity.IdgetId()Gets the provisioning activity ID for cloud-stats tracking.booleanReturnstruewhile the VM is still being provisioned, i.e.Methods inherited from class hudson.slaves.AbstractCloudComputer
getNodeMethods inherited from class hudson.slaves.SlaveComputer
_connect, closeLog, disconnect, doDoDisconnect, doJenkinsAgentJnlp, doLaunchSlaveAgent, doSlaveAgentJnlp, doSubmitDescription, getAbsoluteRemoteFs, getAbsoluteRemotePath, getChannel, getChannelToMaster, getClassLoadingCount, getClassLoadingPrefetchCacheCount, getClassLoadingTime, getDefaultCharset, getDelegatedLauncher, getEnvVarsFull, getJnlpJars, getJnlpMac, getLauncher, getListener, getLogRecords, getOSDescription, getResourceLoadingCount, getResourceLoadingTime, getRetentionStrategy, getSlaveVersion, getSystemInfoExtensions, getTarget, grabLauncher, isAcceptingTasks, isConnecting, isJnlpAgent, isLaunchSupported, isUnix, kill, openLogFile, setAcceptingTasks, setChannel, setChannel, setChannel, setChannel, setNode, taskAccepted, taskCompleted, taskCompletedWithProblems, taskStarted, toString, tryReconnectMethods inherited from class hudson.model.Computer
_doScript, addAction, buildEnvironment, cliConnect, cliDisconnect, cliOffline, cliOnline, connect, countBusy, countExecutors, countIdle, currentComputer, disconnect, doChangeOfflineCause, doConfigDotXml, doConfigSubmit, doDumpExportTable, doProgressiveLog, doRssAll, doRssFailed, doRssLatest, doScript, doScriptText, doToggleOffline, getActions, getAllExecutors, getApi, getAssignedLabels, getBuilds, getCaption, getComputerPanelBoxs, getConnectTime, getDemandStartMilliseconds, getDescription, getDisplayExecutors, getDisplayName, getEnvironment, getEnvVars, getExecutors, getHeapDump, getHostName, getIdleStartMilliseconds, getLoadStatistics, getLog, getLogDir, getLogFile, getLogText, getMonitorData, getMonitoringData, getName, getNumExecutors, getOfflineCause, getOfflineCauseReason, getOneOffExecutors, getSearchGroup, getSearchUrl, getSystemProperties, getTemporaryOfflineCauseReason, getTerminatedBy, getThreadDump, getTiedJobs, getTimeline, getUrl, getWorkspaceList, hasOfflineCause, interrupt, isAlive, isConnected, isIdle, isManualLaunchAllowed, isOffline, isOnline, isPartiallyIdle, isTemporarilyOffline, launch, onRemoved, recordTermination, relocateOldLogs, removeExecutor, resolveForCLI, setNumExecutors, setOfflineCause, setTemporarilyOffline, setTemporarilyOffline, setTemporaryOfflineCause, updateByXml, waitUntilOffline, waitUntilOnlineMethods inherited from class hudson.model.Actionable
addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgetsMethods inherited from interface jenkins.model.IComputer
getTooltipMethods inherited from interface hudson.search.SearchItem
getSearchIcon
-
Constructor Details
-
KubeVirtComputer
-
-
Method Details
-
isProvisioning
public boolean isProvisioning()Returnstruewhile the VM is still being provisioned, i.e. the agent's launcher is still theKubeVirtProvisioningLauncher. Once provisioning completes the launcher is swapped to the real SSH launcher and this method returnsfalse. -
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
- Provisioning —
-
getIconClassName
OverridesSlaveComputer.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:
getIconClassNamein interfaceIComputer- Specified by:
getIconClassNamein interfaceIconSpec- Overrides:
getIconClassNamein classSlaveComputer
-
getIconAltText
Provides alt text that matches the provisioning icon.- Specified by:
getIconAltTextin interfaceIComputer
-
doDoDelete
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:
doDoDeletein classAbstractCloudComputer<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:
getIdin interfaceorg.jenkinsci.plugins.cloudstats.TrackedItem- Returns:
- The provisioning activity ID, or null if the node is not available
-
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:
getACLin interfaceAccessControlled- Specified by:
getACLin interfaceIComputer
-