lifecyclejournal

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package lifecyclejournal derives a resource's lifecycle journal from the status writes the controllers already make.

Each controller writes status in one place and holds the status before and after the write there. SchemaEntries and MigrationEntries turn that transition into the events it records, and Record adds them to the journal in the same write, so no transition site has to remember the journal and the journal costs no request of its own.

Index

Constants

View Source
const (
	MaxEntries = 64
	MaxAge     = 30 * 24 * time.Hour
)

The journal's bounds. The API schema holds MaxEntries as well.

Variables

This section is empty.

Functions

func MigrationEntries

MigrationEntries is what a PtahMigration status write from before to after records, given the journal before the write. A plan is published by the write that first names it, as for a schema.

func Record

Record adds entries to journal, applies the bounds, and returns the journal to store. A nil journal starts covering at now. A failed attempt with the same operation and reason as the newest entry folds into it.

The age bound is measured from the newest entry rather than from now: an entry may be dated by the time its status carries, and the bound must not depend on which clock dated it. Record runs only in a status write that happens anyway, so it never causes a write itself.

func SchemaEntries

SchemaEntries is what a PtahSchema status write from before to after records. journal is the journal before the write, which tells a plan or an approval the resource already recorded from a new one: the controller clears and republishes the same plan while it refreshes.

A plan is published by the write that first names it. The plan an Apply ran stays in status until the proof that follows settles, and every write in between names it again; none of them publishes it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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