engine

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package engine implements PullPilot's update cycle: discover in-scope containers, decide which have a genuinely newer (and soaked) image, and recreate them with health-gated rollback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action is the decided outcome for a container.

const (
	ActionUpToDate Action = "up-to-date"
	ActionSkip     Action = "skip"
	ActionMonitor  Action = "monitor"
	ActionSoaking  Action = "soaking"
	ActionUpdate   Action = "update"
)

type Engine

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

Engine orchestrates one or more update cycles.

func New

func New(cfg *config.Config, st *state.State, log zerolog.Logger, note Notifier) (*Engine, error)

New connects to Docker, identifies PullPilot's own container, and resolves the default update scope (its own Compose project).

Docker SDK note: we intentionally stay on github.com/docker/docker v27.3.1. Its successor, github.com/moby/moby/client, is still pre-1.0 (v0.5.0) with an actively-redesigned API; we'll migrate once it reaches a stable 1.0. The CVEs govulncheck flags on this module are daemon-side and unreachable from a client-only consumer.

func (*Engine) Close

func (e *Engine) Close() error

Close releases the Docker client.

func (*Engine) Ping added in v0.1.2

func (e *Engine) Ping(ctx context.Context) error

Ping verifies the Docker daemon is reachable, with an actionable error. The client connects lazily, so without this a missing/forbidden socket only surfaces (cryptically) on the first cycle.

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, trigger string)

Run executes one full cycle. trigger is "schedule" or "webhook" (for logs).

func (*Engine) Status added in v0.1.2

func (e *Engine) Status(ctx context.Context) error

Status prints a read-only table of every managed container and what PullPilot would do — without changing anything or advancing soak timers.

type Notifier

type Notifier interface {
	Notify(ctx context.Context, title, body string)
}

Notifier receives human-facing events (updates, rollbacks, failures).

Jump to

Keyboard shortcuts

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