Documentation
¶
Overview ¶
Package state persists PullPilot's update bookkeeping in the data dir: when each new digest was first seen (for soak), the last digest applied per container, and digests known to fail health checks (never auto-retried).
Index ¶
- type State
- func (s *State) FirstNotify(key, digest string) bool
- func (s *State) IsBad(digest string) bool
- func (s *State) MarkApplied(key, digest string)
- func (s *State) MarkBad(digest string)
- func (s *State) PeekSeen(key, digest string) (time.Time, bool)
- func (s *State) SeenAt(key, digest string, now time.Time) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
// FirstSeen maps "container/digest" -> first time we observed that digest
// as the upstream target for the container. Drives the soak window.
FirstSeen map[string]time.Time `json:"first_seen"`
// BadDigests records digests that failed a health check; never retried.
BadDigests map[string]bool `json:"bad_digests"`
// LastApplied maps container key -> digest last successfully applied.
LastApplied map[string]string `json:"last_applied"`
// Notified records "container/digest" pairs already announced, so a soaking
// or monitor-only update is notified once per new digest, not every cycle.
Notified map[string]bool `json:"notified"`
// contains filtered or unexported fields
}
State is the on-disk bookkeeping, guarded by a mutex and flushed atomically.
func (*State) FirstNotify ¶
FirstNotify reports whether this is the first notification for a given container/digest, recording it so repeated cycles don't re-notify.
func (*State) MarkApplied ¶
MarkApplied records the digest last applied for a container and prunes that container's stale first-seen entries.
Click to show internal directories.
Click to hide internal directories.