Documentation
¶
Overview ¶
Package topf contains the internal implementations of Topf
Index ¶
- Constants
- type Node
- func (n *Node) Apply(ctx context.Context, logger *slog.Logger, confirm, dryRun bool) (bool, error)
- func (n *Node) Attrs() slog.Attr
- func (n *Node) Client(ctx context.Context) (*client.Client, error)
- func (n *Node) ConfigProvider() talosconfig.Provider
- func (n *Node) MarshalYAML() (any, error)
- func (n *Node) Stabilize(ctx context.Context, logger *slog.Logger, stabilizationDuration time.Duration) error
- type RuntimeConfig
- type Topf
Constants ¶
const ( // DefaultSchematic is the schematic version used by Talos when no // extensions or command line flags are defined DefaultSchematic = "376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
Node *config.Node
MachineStatus runtime.MachineStatusSpec
Schematic string
TalosVersion string
ConfigBundle *bundle.Bundle `yaml:"-"`
Error error `yaml:",omitempty"`
// contains filtered or unexported fields
}
Node contains runtime state information about a Talos node wrapping the configured Node from Topf config
func (*Node) Apply ¶
Apply applies the configuration bundle to the node. If dryRun is true, only shows what changes would be applied without actually applying them.
func (*Node) Client ¶
Client returns a talos API client, either insecure (if maintenance mode) or authenticated (if bootstrapped already) by probing the node endpoint for mTLS.
func (*Node) ConfigProvider ¶
func (n *Node) ConfigProvider() talosconfig.Provider
ConfigProvider returns the config bundle associated with the node's role
func (*Node) MarshalYAML ¶
MarshalYAML implements custom YAML marshalling to properly serialize the Error field
type RuntimeConfig ¶
type RuntimeConfig struct {
// ConfigPath is the path to the topf.yaml configuration file
ConfigPath string
// NodesRegexFilter is an optional regex pattern to filter which nodes to operate on
// Empty string means all nodes
NodesRegexFilter string
// LogLevel sets the logging verbosity (debug, info, warn, error)
LogLevel string
}
RuntimeConfig contains configuration for creating a Topf runtime
type Topf ¶
type Topf interface {
// Config returns the cluster configuration
Config() *config.TopfConfig
// Secrets returns the lazy loaded secrets bundle
Secrets() (*secrets.Bundle, error)
// Logger returns the configured logger
Logger() *slog.Logger
// Nodes returns the list of nodes with additional information
Nodes(context.Context) ([]*Node, error)
}
Topf is the main interface to interact with a Topf cluster runtime
func NewTopfRuntime ¶
func NewTopfRuntime(cfg RuntimeConfig) (Topf, error)
NewTopfRuntime creates a new Topf runtime from the given configuration