controller

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package controller is the top-level orchestrator for the ecs-arc controller. It wires together the scaleset client, listener, scaler, and runner for each configured scale set, managing their lifecycles as goroutines.

Index

Constants

View Source
const ManagedLabelName = "ecs-arc.managed"

ManagedLabelName is the reserved system label ecs-arc injects on every scale set it manages. Presence of this label is the marker used by the startup sweep and runtime deletion path to distinguish ecs-arc-owned scale sets from foreign ones in the same runner group.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller manages the lifecycle of all scale set goroutines.

func New

func New(cfg *config.Config, ecsClient *ecs.Client, ghClient *github.Client, source reconciler.ConfigSource, logger *slog.Logger) *Controller

New creates a new Controller. source is the TOML config source the reconciler will poll.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

Run starts the reconciler and event-driven scale set management loop. It blocks until the context is cancelled.

type ScaleSetClient added in v1.0.4

type ScaleSetClient interface {
	CreateRunnerScaleSet(ctx context.Context, rss *scaleset.RunnerScaleSet) (*scaleset.RunnerScaleSet, error)
	GetRunnerScaleSet(ctx context.Context, runnerGroupID int, name string) (*scaleset.RunnerScaleSet, error)
	UpdateRunnerScaleSet(ctx context.Context, id int, rss *scaleset.RunnerScaleSet) (*scaleset.RunnerScaleSet, error)
	DeleteRunnerScaleSet(ctx context.Context, id int) error
	ListRunnerScaleSets(ctx context.Context, runnerGroupID int) ([]scaleset.RunnerScaleSet, error)
	MessageSessionClient(ctx context.Context, scaleSetID int, owner string, options ...scaleset.HTTPOption) (*scaleset.MessageSessionClient, error)
	GenerateJitRunnerConfig(ctx context.Context, setting *scaleset.RunnerScaleSetJitRunnerSetting, scaleSetID int) (*scaleset.RunnerScaleSetJitRunnerConfig, error)
	GetRunnerByName(ctx context.Context, name string) (*scaleset.RunnerReference, error)
	RemoveRunner(ctx context.Context, runnerID int64) error
}

ScaleSetClient is the subset of *scaleset.Client the controller needs. It exists so tests can provide a fake implementation. It is a superset of the methods used directly by the controller plus those forwarded to the scaler (see scaler.ScaleSetClient).

Jump to

Keyboard shortcuts

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