agent

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 1 module, 1 package

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

Index

Constants

View Source
const (
	GRPCTransportType TransportType = "grpc"
	FileTransportType TransportType = "file"
	NATSTransportType TransportType = "nats"

	DockerRuntimeType     RuntimeType = "docker"
	ContainerdRuntimeType RuntimeType = "containerd"
	KubernetesRuntimeType RuntimeType = "kubernetes"
)
View Source
const (
	// DefaultPollInterval is the default average delay between polls when no work is available.
	DefaultPollInterval = 5 * time.Second
	// DefaultMaxInterval is the default cap on the delay before retrying after an error or a conflict.
	DefaultMaxInterval = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TransportReader TransportReader
	RuntimeExecutor RuntimeExecutor
	TransportWriter TransportWriter
	Retry           Retry
}

func (*Config) Run

func (c *Config) Run(ctx context.Context, log logr.Logger)

type ContainerdRuntime

type ContainerdRuntime struct {
	Namespace  string
	SocketPath string
	DataRoot   string
	// RegistryConfigPath is the root directory containing per-registry hosts.toml and certificate configuration.
	RegistryConfigPath string
}

type DockerRuntime

type DockerRuntime struct {
	SocketPath string
}

type FileTransport

type FileTransport struct {
	WorkflowPath string
}

type GRPCTransport

type GRPCTransport struct {
	ServerAddrPort string
	TLSEnabled     bool
	TLSInsecure    bool
}

type KubernetesRuntime added in v0.25.0

type KubernetesRuntime struct {
	Namespace          string
	Kubeconfig         string
	ServiceAccountName string
}

type NATSTransport

type NATSTransport struct {
	ServerAddrPort netip.AddrPort
	StreamName     string
	EventsSubject  string
	ActionsSubject string
}

type Options

type Options struct {
	Transport                 Transport
	Runtime                   Runtime
	Registry                  Registry
	Proxy                     Proxy
	TransportSelected         TransportType
	RuntimeSelected           RuntimeType
	AttributeDetectionEnabled bool
	// LLDPTimeout bounds how long attribute detection waits for LLDP
	// neighbors. Detection finishes before any Action runs because an Action
	// can power-cycle the machine. Zero disables LLDP discovery.
	LLDPTimeout time.Duration
	Retry       Retry
}

func (*Options) ConfigureAndRun

func (o *Options) ConfigureAndRun(inctx context.Context, log logr.Logger, id string) error

type Proxy

type Proxy struct {
	HTTPProxy  []string
	HTTPSProxy []string
	NoProxy    []string
}

type Registry

type Registry struct {
	Name string
	User string
	Pass string
}

type Retry added in v0.26.0

type Retry struct {
	// PollInterval is the average delay between polls when no work is available.
	// Each delay is uniformly random in [PollInterval/2, 3*PollInterval/2).
	PollInterval time.Duration
	// MaxInterval caps the delay before retrying after an error or a conflict.
	MaxInterval time.Duration
}

Retry is the Agent's retry policy. The Agent is the only component that retries; the Tink Server makes a single attempt per request. See docs/technical/designs/AGENT_SERVER_RETRY.md.

Transports classify errors by implementing any of these methods:

NoAction() bool  // no work is available, poll again later
Conflict() bool  // a transient conflict, retry soon
Permanent() bool // retrying will not succeed

Any other error is retried with exponential backoff.

type Runtime

type Runtime struct {
	Docker     DockerRuntime
	Containerd ContainerdRuntime
	Kubernetes KubernetesRuntime
}

type RuntimeExecutor

type RuntimeExecutor interface {
	// Execute blocks until the action is completed or an error occurs
	Execute(ctx context.Context, action spec.Action) error
}

RuntimeExecutor provides a method to execute an action.

type RuntimeType

type RuntimeType string

func (*RuntimeType) Set

func (r *RuntimeType) Set(s string) error

func (RuntimeType) String

func (r RuntimeType) String() string

func (*RuntimeType) Type

func (r *RuntimeType) Type() string

type Transport

type Transport struct {
	GRPC GRPCTransport
	File FileTransport
	NATS NATSTransport
}

type TransportReader

type TransportReader interface {
	// Read blocks until an action is available or an error occurs
	Read(ctx context.Context) (spec.Action, error)
}

TransportReader provides a method to read an action.

type TransportType

type TransportType string

func (*TransportType) Set

func (t *TransportType) Set(s string) error

func (TransportType) String

func (t TransportType) String() string

func (*TransportType) Type

func (t *TransportType) Type() string

type TransportWriter

type TransportWriter interface {
	// Write blocks until the event is written or an error occurs
	Write(ctx context.Context, event spec.Event) error
}

TransportWriter provides a method to write an event.

Directories

Path Synopsis
internal
pkg/rand
Package rand provides utilities related to randomization.
Package rand provides utilities related to randomization.
runtime/kubernetes
Package kubernetes implements a tink-agent RuntimeExecutor that runs Actions as Kubernetes Jobs via the Kubernetes API instead of a local Docker/containerd socket.
Package kubernetes implements a tink-agent RuntimeExecutor that runs Actions as Kubernetes Jobs via the Kubernetes API instead of a local Docker/containerd socket.

Jump to

Keyboard shortcuts

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