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 ¶
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.
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).