Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Client container.Client
ScheduleSpec string
Cleanup bool
NoRestart bool
NoPull bool
MonitorOnly bool
EnableLabel bool
LifecycleHooks bool
RollingRestart bool
LabelPrecedence bool
Scope string
DisableContainers []string
Timeout time.Duration
}
Config is the resolved runtime configuration for a dockwatch run. It is a plain value with no package-level mutable state: build it once, hand it to New, and its validation rules live in one testable place.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller owns the cron schedule that drives periodic update scans. Each tick delegates to the Runner, which enforces the single-flight guard.
func NewController ¶
func NewController(runner *Runner, filter t.Filter) *Controller
NewController returns a Controller that will run scans for filter via runner.
func (*Controller) Current ¶
func (c *Controller) Current() string
Current returns the active cron spec.
func (*Controller) NextRun ¶
func (c *Controller) NextRun() time.Time
NextRun returns the next scheduled run time, or the zero time if unscheduled.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon owns the update run: the single-flight Runner and the schedule.
type Options ¶
type Options struct {
Filter t.Filter
FilterDesc string
RunOnce bool
EnableUpdateAPI bool
EnableMetricsAPI bool
UnblockHTTPAPI bool
Interactive bool
NoStartupMessage bool
APIToken string
In io.Reader
Out io.Writer
}
Options describe a single invocation's run mode. They are the run-time knobs that come from the command line, separated from the resolved Config.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes container update scans and guarantees that only one scan runs at a time. It owns the single-flight guard that was previously hand-rolled as a `chan bool` in the scheduler, the shell and the HTTP API.
func (*Runner) Run ¶
Run blocks until the single-flight guard is free, runs a scan for filter, registers the scan metric and returns it. It returns nil without scanning when maxQueuedScans callers are already waiting.