reconcile

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: 0 modules, 0 packages

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

Overview

Package reconcile squares a Docker engine's skiff containers with the local registry.

Both the panel's startup reaper and `skiff sync` used to delete every skiff container missing from the registry. That is only safe if the registry is complete, and it wasn't: a CLI deploy to a server over SSH recorded the app in the deployer's registry, never the server's, so the server's next panel restart deleted the live site. The policy here never deletes the only running instance of an app — it adopts it back into the registry instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plan

type Plan struct {
	// Remove holds stopped leftovers and superseded versions of apps that still
	// have a running, registered replica.
	Remove []string
	// Adopt maps an app to running containers that should be (re)registered
	// rather than deleted: its registry entry is missing or points only at
	// containers that are gone or stopped.
	Adopt map[string][]docker.ContainerInfo
}

Plan is what reconciling should do. Containers in neither list are left alone.

func PlanReap

func PlanReap(apps map[string]registry.App, cs []docker.ContainerInfo, cutoff time.Time) Plan

PlanReap decides what to do with every container the registry doesn't reference. Only apps with Host == "" belong to this engine; containers created after cutoff are skipped so an in-progress deploy isn't touched.

type Result

type Result struct {
	Removed []string
	Adopted []string // app names re-registered from running containers
}

Result reports what Reap did.

func Reap

func Reap(eng *docker.Engine, cutoff time.Time) (Result, error)

Reap applies PlanReap to eng using the local registry.

Jump to

Keyboard shortcuts

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