Documentation
¶
Index ¶
- Constants
- func AggregateApplicationResults(results []v1beta1.DeviceDeltaApplyStatus) *v1beta1.DeviceDeltaApplyStatus
- func Fingerprint(values ...string) string
- type ApplicationAttempt
- type ApplicationImage
- type ApplicationResult
- type ApplicationSnapshot
- type ApplicationVolumeBinding
- type Store
- func (s *Store) ApplicationLifetime(application string) string
- func (s *Store) ApplicationResults(application string) map[string]ApplicationResult
- func (s *Store) ApplicationSnapshot(application string) *ApplicationSnapshot
- func (s *Store) ApplicationVolumeBinding(application, lifetime, volumeID string) (ApplicationVolumeBinding, bool)
- func (s *Store) ApplicationVolumeImage(application, lifetime, volumeID, createdAt string) (ApplicationImage, bool)
- func (s *Store) ClearApplicationResult(application, specKey, targetID, targetKey string) error
- func (s *Store) ClearApplicationResultForAttempt(attempt ApplicationAttempt) error
- func (s *Store) ClearApplicationVolumeImage(application, lifetime, volumeID string) error
- func (s *Store) EnsureApplicationLifetime(application string) (string, error)
- func (s *Store) OSResult(targetKey string) *v1beta1.DeviceDeltaApplyStatus
- func (s *Store) ObservedApplicationResult(application string, images []ApplicationImage, complete bool) *v1beta1.DeviceDeltaApplyStatus
- func (s *Store) ObservedApplicationResultForLifetime(application, lifetime string, images []ApplicationImage, complete bool) *v1beta1.DeviceDeltaApplyStatus
- func (s *Store) ObservedOSResult(image, digest string) *v1beta1.DeviceDeltaApplyStatus
- func (s *Store) ReconcileApplicationSpecs(specKeys map[string]string) error
- func (s *Store) ReconcileApplicationTargets(targets map[string]map[string]string, complete bool) error
- func (s *Store) RecordApplicationImageResult(application, specKey, targetID, targetKey string, image ApplicationImage, ...) error
- func (s *Store) RecordApplicationImageResultForAttempt(attempt ApplicationAttempt, image ApplicationImage, ...) error
- func (s *Store) RecordApplicationResult(application, specKey, targetID, targetKey string, ...) error
- func (s *Store) RecordApplicationResultForAttempt(attempt ApplicationAttempt, result v1beta1.DeviceDeltaApplyStatus) error
- func (s *Store) RecordApplicationVolumeImage(application, lifetime, volumeID, createdAt string, image ApplicationImage) error
- func (s *Store) RecordOSImageResult(targetKey, image, digest string, result v1beta1.DeviceDeltaApplyStatus) error
- func (s *Store) RecordOSResult(targetKey string, result v1beta1.DeviceDeltaApplyStatus) error
- func (s *Store) RemoveApplication(application string) error
- func (s *Store) SetOSTarget(targetKey string) error
Constants ¶
const (
// FileName is the dedicated on-disk state file for agent-reported delta outcomes.
FileName = "delta-status.json"
)
Variables ¶
This section is empty.
Functions ¶
func AggregateApplicationResults ¶
func AggregateApplicationResults(results []v1beta1.DeviceDeltaApplyStatus) *v1beta1.DeviceDeltaApplyStatus
AggregateApplicationResults applies the shared precedence and fallback-reason policy.
func Fingerprint ¶
Fingerprint returns a stable key for a set of target attributes.
Types ¶
type ApplicationAttempt ¶
type ApplicationAttempt struct {
Application string
Lifetime string
SpecKey string
TargetID string
TargetKey string
}
ApplicationAttempt captures the immutable scheduling identity of one target. Completion and invalidation use the same token so obsolete work is ignored.
type ApplicationImage ¶
type ApplicationImage struct {
Image string `json:"image"`
Owner string `json:"owner"`
OCIType string `json:"ociType"`
Digest string `json:"digest"`
}
ApplicationImage is a verified observation scoped to its storage owner and OCI type. The digest is the single registry identity supplied by the owning runtime.
type ApplicationResult ¶
type ApplicationResult struct {
TargetKey string
Status v1beta1.DeviceDeltaApplyStatus
}
ApplicationResult is one image's persisted delta result.
type ApplicationSnapshot ¶
type ApplicationSnapshot struct {
Lifetime string
SpecKey string
Targets map[string]string
Results map[string]ApplicationResult
}
ApplicationSnapshot is an in-memory copy of an application's current delta targets and the results recorded for them.
type ApplicationVolumeBinding ¶
type ApplicationVolumeBinding struct {
CreatedAt string
Image ApplicationImage
}
ApplicationVolumeBinding is the stored image identity and runtime creation identity associated with one installed application volume.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists the most recent delta results independently of status delivery. It is shared by the OS and application prefetch managers.
func New ¶
func New(readWriter fileio.ReadWriter, dataDir string, logger *log.PrefixLogger) *Store
New loads persisted delta outcomes. Invalid or unreadable state is logged and ignored so a status file problem does not prevent the agent from starting.
func (*Store) ApplicationLifetime ¶
ApplicationLifetime returns the stable identity for an application's current installation lifetime. Desired-spec changes retain it; reconciliation after removal creates a new value.
func (*Store) ApplicationResults ¶
func (s *Store) ApplicationResults(application string) map[string]ApplicationResult
ApplicationResults returns copies of results saved for an application.
func (*Store) ApplicationSnapshot ¶
func (s *Store) ApplicationSnapshot(application string) *ApplicationSnapshot
ApplicationSnapshot returns the current target set and its recorded results. The store is loaded from disk once by New; this method only copies in-memory state so status collection does not perform disk I/O.
func (*Store) ApplicationVolumeBinding ¶
func (s *Store) ApplicationVolumeBinding(application, lifetime, volumeID string) (ApplicationVolumeBinding, bool)
ApplicationVolumeBinding returns the current stored binding for one volume. Callers that inspect the live volume should read it before and after that inspection and require the binding to remain unchanged.
func (*Store) ApplicationVolumeImage ¶
func (s *Store) ApplicationVolumeImage(application, lifetime, volumeID, createdAt string) (ApplicationImage, bool)
ApplicationVolumeImage returns the image provenance recorded for one application volume only when the application's lifetime and volume incarnation still match.
func (*Store) ClearApplicationResult ¶
ClearApplicationResult invalidates an outcome when the active target's content changes. Invalidations for superseded specs or targets are ignored.
func (*Store) ClearApplicationResultForAttempt ¶
func (s *Store) ClearApplicationResultForAttempt(attempt ApplicationAttempt) error
ClearApplicationResultForAttempt ignores invalidations from an obsolete application lifetime as well as from superseded desired targets.
func (*Store) ClearApplicationVolumeImage ¶
ClearApplicationVolumeImage invalidates a volume binding before its contents or runtime object are changed.
func (*Store) EnsureApplicationLifetime ¶
EnsureApplicationLifetime creates an empty application record when runtime work begins before dependency prefetch has reconciled the desired spec. Existing records and lifetimes are preserved across ordinary updates.
func (*Store) OSResult ¶
func (s *Store) OSResult(targetKey string) *v1beta1.DeviceDeltaApplyStatus
OSResult returns a copy of the result for the requested target.
func (*Store) ObservedApplicationResult ¶
func (s *Store) ObservedApplicationResult(application string, images []ApplicationImage, complete bool) *v1beta1.DeviceDeltaApplyStatus
ObservedApplicationResult combines only history matching every image in a complete observed snapshot. It returns an owned result without runtime or disk I/O.
func (*Store) ObservedApplicationResultForLifetime ¶
func (s *Store) ObservedApplicationResultForLifetime(application, lifetime string, images []ApplicationImage, complete bool) *v1beta1.DeviceDeltaApplyStatus
ObservedApplicationResultForLifetime selects an owned aggregate only when the complete snapshot belongs to the application's currently registered lifetime.
func (*Store) ObservedOSResult ¶
func (s *Store) ObservedOSResult(image, digest string) *v1beta1.DeviceDeltaApplyStatus
ObservedOSResult selects an owned copy for exactly the booted image and digest. It never uses the active desired attempt or performs disk I/O.
func (*Store) ReconcileApplicationSpecs ¶
ReconcileApplicationSpecs advances active attempts without discarding observed image history, and removes state for applications no longer present.
func (*Store) ReconcileApplicationTargets ¶
func (s *Store) ReconcileApplicationTargets(targets map[string]map[string]string, complete bool) error
ReconcileApplicationTargets updates per-image target identities. On an incomplete collection, targets not seen yet are retained so nested images discovered in a later collection pass do not discard completed results. Results follow an unchanged full target key when its indexing identity changes.
func (*Store) RecordApplicationImageResult ¶
func (s *Store) RecordApplicationImageResult(application, specKey, targetID, targetKey string, image ApplicationImage, result v1beta1.DeviceDeltaApplyStatus) error
RecordApplicationImageResult persists verified history only for an active attempt. Attempt-only results are used for scheduling, never for publication.
func (*Store) RecordApplicationImageResultForAttempt ¶
func (s *Store) RecordApplicationImageResultForAttempt(attempt ApplicationAttempt, image ApplicationImage, result v1beta1.DeviceDeltaApplyStatus) error
RecordApplicationImageResultForAttempt records digest-associated history only for the application lifetime and desired attempt that initiated the work.
func (*Store) RecordApplicationResult ¶
func (s *Store) RecordApplicationResult(application, specKey, targetID, targetKey string, result v1beta1.DeviceDeltaApplyStatus) error
RecordApplicationResult durably records one image result. Results for an image target that has since changed are ignored.
func (*Store) RecordApplicationResultForAttempt ¶
func (s *Store) RecordApplicationResultForAttempt(attempt ApplicationAttempt, result v1beta1.DeviceDeltaApplyStatus) error
RecordApplicationResultForAttempt durably records a scheduling result only when both the desired attempt and application lifetime are still current.
func (*Store) RecordApplicationVolumeImage ¶
func (s *Store) RecordApplicationVolumeImage(application, lifetime, volumeID, createdAt string, image ApplicationImage) error
RecordApplicationVolumeImage binds an image-backed volume's exact installed content to its public Podman creation identity. A stale lifetime cannot repopulate evidence after application removal and recreation.
func (*Store) RecordOSImageResult ¶
func (s *Store) RecordOSImageResult(targetKey, image, digest string, result v1beta1.DeviceDeltaApplyStatus) error
RecordOSImageResult records a verified image association for the active attempt. Superseded attempts and unknown identities cannot add a publishable outcome.
func (*Store) RecordOSResult ¶
func (s *Store) RecordOSResult(targetKey string, result v1beta1.DeviceDeltaApplyStatus) error
RecordOSResult durably records the result for the active OS target. A result from a superseded target is ignored.
func (*Store) RemoveApplication ¶
RemoveApplication retires the current lifetime immediately and removes all results and volume bindings. A subsequent ensure receives a fresh token.
func (*Store) SetOSTarget ¶
SetOSTarget updates the active attempt while retaining verified image history. An empty key clears the OS scope.