machinestatus

package
v0.1.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package machinestatus provides functionality to poll the state of machines, i.e., power, connectivity, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

Get gets the baremetal.MachineStatus resource from the state.

func Modify

func Modify(ctx context.Context, st state.State, id resource.ID, updateFn func(status *baremetal.MachineStatus) error) (*baremetal.MachineStatus, error)

Modify modifies the baremetal.MachineStatus resource in the state.

Types

type AgentService

type AgentService interface {
	AllConnectedMachines() map[string]struct{}
	IsAccessible(ctx context.Context, machineID string) (bool, error)
}

AgentService is the interface for controlling Talos agent.

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

Poller polls the machines periodically and updates their statuses.

func NewPoller

func NewPoller(agentService AgentService, powerClientFactory PowerClientFactory, state state.State, logger *zap.Logger) *Poller

NewPoller creates a new Poller.

func (*Poller) Run

func (m *Poller) Run(ctx context.Context) error

Run starts the Poller.

type PowerClientFactory

type PowerClientFactory interface {
	GetClient(powerManagement *specs.PowerManagement) (power.Client, error)
}

PowerClientFactory is the interface for creating power clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL