migrationplan

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package migrationplan publishes and re-derives the immutable manifest of one planned migration sequence.

The controller writes the plan and admission re-derives it from the same inputs, so the derivation lives here rather than in either of them: a plan nobody can reproduce is a plan nothing can check.

Index

Constants

View Source
const (
	// ContractVersion versions migration plan publication separately from the
	// Kubernetes API version.
	ContractVersion int32 = 1

	// LabelMigration names the PtahMigration a plan belongs to.
	LabelMigration = workload.LabelMigration

	// MaxMigrations is the longest sequence one plan may carry. It matches the
	// CRD's own bound, so a sequence the API would refuse is refused before it
	// is published rather than after.
	MaxMigrations = 256
)

Variables

This section is empty.

Functions

func Desired

Desired builds the object the controller publishes. Its metadata is exactly what admission expects, because admission builds the same object.

func HistoryFingerprint

func HistoryFingerprint(report dataplane.MigrationStatusReport) (string, error)

HistoryFingerprint is the exact reading of the revision table a plan was computed against. It covers every migration the report accounted for, so a history that moved -- by anyone, for any reason -- produces a different fingerprint and invalidates the plan.

func Name

func Name(planFingerprint string) (string, error)

Name is the plan's deterministic object name. Two publications of the same plan are the same object, so a controller that restarted mid-publication cannot leave a second copy of one decision.

func Sequence

Sequence selects the migrations a plan executes, in the order the history document listed them. The order is the content: a plan that applies the same migrations in another order is a different plan.

func SequenceDigest

func SequenceDigest(planned []operatorv1alpha1.PlannedMigration) (string, error)

SequenceDigest binds the plan's fingerprint to the exact sequence it carries.

The derivation itself lives in internal/workload, because the Apply Job has to carry the same digest and that package is below this one. One rule, two callers.

Types

type Binding

type Binding struct {
	MigrationUID             types.UID
	HistoryFingerprint       string
	SequenceDigest           string
	ArtifactDigest           string
	CoordinationDigest       string
	TargetIdentityDigest     string
	PolicyFingerprint        string
	VerificationPolicyUID    types.UID
	VerificationPolicyDigest string
	ExecutionBindingID       string
	ControllerStateVersion   int32
	PtahVersion              string
	ExecutorImage            string
	RunnerProtocolVersion    int32
}

Binding is everything a migration plan is decided from. A changed input produces a different plan rather than a changed one.

The manager that publishes the plan is not an input. Its image, its revision and the runner image built beside it are recorded on the plan and left out of here, so a manager release that changes only them finds the same fingerprint, the same plan name and the same approvals.

func (Binding) Fingerprint

func (b Binding) Fingerprint() (string, error)

Fingerprint is the plan's identity. An approval names it, and everything the plan was decided from is inside it.

Jump to

Keyboard shortcuts

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