Documentation
¶
Overview ¶
Package regmaint keeps the private registry tidy (§5.10): it applies repository lifecycle policies and then runs registry garbage collection, on a schedule or on demand, and logs every run.
Index ¶
- Constants
- Variables
- type ErrInvalid
- type Expired
- type Manager
- func (m *Manager) GetPolicy(ctx context.Context, repo string) (Policy, error)
- func (m *Manager) ImageAvailable(ctx context.Context, image string) (bool, error)
- func (m *Manager) Preview(ctx context.Context, repo string, rules []registry.Rule) ([]registry.Decision, error)
- func (m *Manager) Run(ctx context.Context)
- func (m *Manager) Running() bool
- func (m *Manager) SetPolicy(ctx context.Context, repo string, rules []registry.Rule, actor string) (Policy, error)
- func (m *Manager) Start(trigger string) (store.GCRun, error)
- type Policy
Constants ¶
const TopicRun = "registry.gc"
TopicRun carries a store.GCRun whenever a run starts or finishes.
Variables ¶
var ( // ErrBusy means a run is already in progress. ErrBusy = errors.New("a registry cleanup is already running") // ErrNoRegistry means the registry system task is not running. ErrNoRegistry = errors.New("the registry is not running on the controller node") )
Functions ¶
This section is empty.
Types ¶
type ErrInvalid ¶
type ErrInvalid struct{ Err error }
ErrInvalid wraps validation errors.
func (ErrInvalid) Error ¶
func (e ErrInvalid) Error() string
type Expired ¶
type Expired struct {
Repository string `json:"repository"`
Tag string `json:"tag"`
Digest string `json:"digest"`
Reason string `json:"reason"`
}
Expired is one image a run deleted.
type Manager ¶
type Manager struct {
// RegistryHosts are the hostnames task definitions may use for the
// private registry besides "@registry/".
RegistryHosts func() []string
// Every is the time between scheduled runs.
Every time.Duration
// contains filtered or unexported fields
}
func (*Manager) ImageAvailable ¶
ImageAvailable reports whether a service image can still be pulled: images outside the private registry are assumed to be.
func (*Manager) Preview ¶
func (m *Manager) Preview(ctx context.Context, repo string, rules []registry.Rule) ([]registry.Decision, error)
Preview evaluates rules against a repository's images without deleting.