rollout

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rollout upgrades agents node by node (§5.0.1 step 6, §6.2): each node gets the agent binary from the controller's downloads over its agent stream, restarts into it, and must reconnect with the new version before the next node starts. A failure stops the rollout.

Index

Constants

This section is empty.

Variables

View Source
var ErrRunning = errors.New("an agent rollout is already running")

ErrRunning is returned while a rollout is in progress.

View Source
var ReconnectTimeout = 3 * time.Minute

ReconnectTimeout is how long a node has to come back with the new version (longer than the agent's own rollback guard).

Functions

This section is empty.

Types

type Manager

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

func New

func New(gw *agentgw.Gateway, reg *nodes.Registry, downloads, target string, log *slog.Logger) *Manager

New returns a manager rolling agents out to target (the controller's own version) from the binaries in downloads.

func (*Manager) Hooks

func (m *Manager) Hooks() agentgw.Hooks

Hooks deliver agents' upgrade failures to the waiting rollout.

func (*Manager) Start

func (m *Manager) Start(ids []string, force bool) (*Rollout, error)

Start upgrades the given nodes (all when empty) that run another version; force also re-sends to nodes already at the target.

func (*Manager) Status

func (m *Manager) Status() *Rollout

Status is the current or last rollout (nil if none ran).

func (*Manager) Target

func (m *Manager) Target() string

type NodeStatus

type NodeStatus struct {
	NodeID     string     `json:"nodeId"`
	Node       string     `json:"node"`
	From       string     `json:"from"`
	State      string     `json:"state"` // pending | sending | restarting | done | failed | skipped
	Error      string     `json:"error,omitempty"`
	StartedAt  *time.Time `json:"startedAt,omitempty"`
	FinishedAt *time.Time `json:"finishedAt,omitempty"`
}

type Rollout

type Rollout struct {
	Target     string       `json:"target"`
	State      string       `json:"state"` // running | done | failed
	Message    string       `json:"message,omitempty"`
	StartedAt  time.Time    `json:"startedAt"`
	FinishedAt *time.Time   `json:"finishedAt,omitempty"`
	Nodes      []NodeStatus `json:"nodes"`
}

Jump to

Keyboard shortcuts

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