package state

import "github.com/hashicorp/nomad/client/allocrunner/state"

Index

Types

type AllocVolumes

type AllocVolumes struct {
	CSIVolumes map[string]*CSIVolumeStub // volume request name -> CSIVolumeStub
}

type CSIVolumeStub

type CSIVolumeStub struct {
	VolumeID         string
	VolumeNamespace  string
	VolumeExternalID string
	PluginID         string
	ExternalNodeID   string
	MountInfo        *csimanager.MountInfo
}

CSIVolumeStub is a stripped-down version of the CSIVolume with just the relevant data that we need to persist about the volume.

type State

type State struct {
	// ClientStatus captures the overall state of the allocation
	ClientStatus string

	// ClientDescription is an optional human readable description of the
	// allocations client state
	ClientDescription string

	// DeploymentStatus captures the status of the deployment
	DeploymentStatus *structs.AllocDeploymentStatus

	// TaskStates is a snapshot of task states.
	TaskStates map[string]*structs.TaskState

	// NetworkStatus captures network details not known until runtime
	NetworkStatus *structs.AllocNetworkStatus
}

State captures the state of the allocation runner.

func (*State) ClearDeploymentStatus

func (s *State) ClearDeploymentStatus()

ClearDeploymentStatus is a helper to clear the client-controlled DeploymentStatus fields: Healthy and Timestamp. The Canary and ModifyIndex fields should only be updated by the server.

func (*State) ClientTerminalStatus

func (s *State) ClientTerminalStatus() bool

ClientTerminalStatus returns if the client status is terminal and will no longer transition

func (*State) Copy

func (s *State) Copy() *State

Copy returns a deep copy of State.

func (*State) SetDeploymentStatus

func (s *State) SetDeploymentStatus(timestamp time.Time, healthy bool)

SetDeploymentStatus is a helper for updating the client-controlled DeploymentStatus fields: Healthy and Timestamp. The Canary and ModifyIndex fields should only be updated by the server.

Source Files

state.go

Version
v1.10.0 (latest)
Published
Apr 9, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
2 days ago

Tools for package owners.