Documentation
¶
Overview ¶
Package applicationrelease holds the owner-signed record of one scoped application release change: the retained copy of the application's prior data, the prior intent, and the release transition it authorizes.
A forward change stops only the selected application, copies each of its governed volumes into an operation-bound retained volume, reads the copy back as a file-tree digest and then selects the target release in the StackSpec; normal generate and Apply run the change. A rollback stops the application again, copies the retained data back, proves the live tree equals the checkpoint digest and restores the prior intent; the next Apply may then start the earlier release on exactly that data. While a record is open, Apply starts only the release it expects; without one, Apply refuses every move to an earlier release.
Index ¶
Constants ¶
const APIVersion = "stackkit.application-release/v1"
const Directory = ".stackkit/applications/releases"
Directory holds one owner-signed record per scoped release operation.
Variables ¶
This section is empty.
Functions ¶
func CanAdvance ¶
CanAdvance reports whether a record in state from may move to next.
func ValidOperationID ¶
ValidOperationID reports whether id is a scoped release operation identity.
Types ¶
type Record ¶
type Record struct {
APIVersion string `json:"apiVersion"`
OperationID string `json:"operationId"`
State State `json:"state"`
UseCaseRef string `json:"useCaseRef"`
WorkloadRef string `json:"workloadRef"`
ModuleRef string `json:"moduleRef"`
NodeRef string `json:"nodeRef"`
ComposeProject string `json:"composeProject"`
EntryComponent string `json:"entryComponent"`
PriorRelease string `json:"priorRelease"`
PriorImage Image `json:"priorImage"`
TargetRelease string `json:"targetRelease"`
TargetImage Image `json:"targetImage"`
PriorSpecHash string `json:"priorSpecHash"`
TargetSpecHash string `json:"targetSpecHash"`
// PriorSpec and TargetSpec are the exact canonical StackSpec bytes.
PriorSpec []byte `json:"priorSpec"`
TargetSpec []byte `json:"targetSpec"`
PlanHash string `json:"planHash"`
KopiaHelperImage string `json:"kopiaHelperImage"`
Volumes []Volume `json:"volumes"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Signature localevidence.OwnerApplicationReleaseSignature `json:"signature"`
}
func Persist ¶
Persist signs and atomically replaces the record of its operation. A new record must start at StateCheckpointStarted; an existing one may move only along the declared transitions.
type State ¶
type State string
const ( // StateCheckpointStarted: the application may be stopped and its // retained copies may be incomplete; live data is unchanged. StateCheckpointStarted State = "checkpoint-started" // StateCheckpointed: retained copies are complete and read back, the // target release is selected, and the application stays stopped until // Apply starts the target release. StateCheckpointed State = "checkpointed" // StateRollbackStarted: live data may be partly restored. StateRollbackStarted State = "rollback-started" // StateRolledBack: live data equals the checkpoint, the prior intent is // selected, and the next Apply may start the prior release. StateRolledBack State = "rolled-back" // StateAbandoned: a checkpoint that never completed was released; the // prior intent and runtime stay authoritative. StateAbandoned State = "abandoned" // StateFinalized: retained copies are removed; the record is history. StateFinalized State = "finalized" )
type Volume ¶
type Volume struct {
ComponentRef string `json:"componentRef"`
LogicalName string `json:"logicalName"`
ComposeProject string `json:"composeProject"`
LiveName string `json:"liveName"`
RollbackName string `json:"rollbackName"`
Checkpoint *Readback `json:"checkpoint,omitempty"`
}
Volume is one governed live volume of the application and its retained, operation-bound copy.