localnode

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package localnode enrolls the Agent bundled with a Controller (the Compose install's) without anyone copying a token: the Controller creates that Node and keeps a fresh enrollment token in a file only the bundled Agent shares, until the Node is enrolled.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config)

Run keeps a valid token in TokenFile until the Node is enrolled, then removes the file.

func Step

func Step(ctx context.Context, cfg Config) (bool, error)

Step makes sure the Node exists and, until it is enrolled, that the token file holds a fresh token. It reports whether the Node is enrolled.

Types

type Config

type Config struct {
	Store *store.Store
	// CAPin is the Controller CA's pin, carried in enrollment tokens.
	CAPin []byte
	// Name is the bundled Node's name; TokenFile where its token goes.
	Name      string
	TokenFile string
	Logger    *slog.Logger
	// Now defaults to time.Now; Interval (default: half a token's
	// lifetime) is how often the token is renewed.
	Now      func() time.Time
	Interval time.Duration
}

Config configures Run.

Jump to

Keyboard shortcuts

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