cmd

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const SupportsIsolationCommand = daemon.SupportsIsolationCommand

SupportsIsolationCommand is the subcommand an agent binary answers to say whether it can operate an isolation mode. The daemon runs it on an agent upgrade candidate, and the recovery script on the last-good binary, before either is allowed to run a node in a mode other than nspawn. A binary that predates the subcommand fails it, which is the answer wanted: it cannot operate those modes.

Variables

This section is empty.

Functions

func Run

func Run()

Types

type CommandContext

type CommandContext struct {
	Debug      bool
	LogFormat  string
	LogNoColor bool
	Logger     *slog.Logger
}

CommandContext holds cross-cutting configuration shared by all agent subcommands. It mirrors the pattern used in forge (see hack/cmd/forge/forge/cmd/common.go) but carries only the fields relevant to the agent: logging configuration.

Persistent flags are bound directly to this struct's exported fields in Run(), and Setup() is called inside each subcommand's RunE — after cobra has finished parsing — to initialize the Logger.

func (*CommandContext) Setup

func (c *CommandContext) Setup()

Setup initializes the Logger from the current flag values.

Jump to

Keyboard shortcuts

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