Documentation
¶
Overview ¶
Package infrastructureroots runs the operator-owned DataTug root check.
Index ¶
Constants ¶
const Database = "(default)"
const Project = "sneat-eur3-1"
Variables ¶
var ErrFenced = errors.New("infrastructure monitor lease superseded")
var ErrOutboxFull = errors.New("infrastructure monitor outbox full")
Functions ¶
func DefaultCatalogArtifact ¶
func DefaultCatalogArtifact() []byte
Types ¶
type Alert ¶
type Alert struct {
ID string
Kind string
At time.Time
Project string
Database string
RegistryDigest string
CatalogDigest string
CatalogRevision string
Unexpected []string
}
Alert has metadata only. Delivery is at least once; crash after send may resend.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func NewObserver ¶
NewObserver constructs a freshness/delivery worker without a root lister.
func (*Monitor) CheckFreshness ¶
CheckFreshness must run independently. Missing or 30h-old successful scans are stale even if the source is still being attempted. It never enumerates.
func (*Monitor) DeliverPending ¶
DeliverPending sends at most one oldest event and durably acknowledges it. Fencing prevents concurrent normal delivery. Crashes can cause duplicates.
type Options ¶
type Options struct {
DB dal.DB
RegistryDigest string
CatalogArtifact []byte
CatalogDigest string
CatalogRevision string
AuthorizeDelivery func(context.Context) error
ListRoots func(context.Context, string, string) ([]string, error)
SendAlert func(context.Context, Alert) error
Now func() time.Time
}
Options are operator-only dependencies. ListRoots must enumerate all roots or fail, including partial batches. It must never read collection documents. CatalogArtifact is the exact operator-pinned private project Check JSON. RegistryDigest and CatalogDigest are SHA256 hex; CatalogRevision is its Git SHA. Runtime uses these bytes directly; it never retrieves Git credentials.
type State ¶
type State struct {
SuccessRegistryDigest string
SuccessCatalogDigest string
SuccessCatalogRevision string
RegistryDigest string
CatalogDigest string
CatalogRevision string
Fence uint64
LeaseUntil time.Time
NextRun time.Time
LastAttempt time.Time
LastSuccess time.Time
Status string
Signature string
Stale bool
FreshnessSignature string
Sequence uint64
Pending []Alert
DeliveryFence uint64
DeliveryLeaseUntil time.Time
}