migrationplan

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 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. It is the contract of a plan computed from an
	// OCI artifact; SourceContractVersion is the one of a plan computed from a
	// ConfigMap, which binds its source in place of the artifact digest and
	// the verification policy.
	ContractVersion       int32 = fingerprint.CurrentPlanContractVersion
	SourceContractVersion int32 = fingerprint.SourcePlanContractVersion

	// 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.

func SupportedContractVersion added in v0.2.7

func SupportedContractVersion(version int32) bool

SupportedContractVersion reports whether this manager publishes and reads migration plans of version.

Types

type Binding

type Binding struct {
	MigrationUID       types.UID
	HistoryFingerprint string
	SequenceDigest     string
	ArtifactDigest     string
	// Source is the ConfigMap source a version 2 plan binds in place of the
	// artifact digest and the verification policy.
	Source                   *fingerprint.PlanSource
	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) ContractVersion added in v0.2.7

func (b Binding) ContractVersion() int32

ContractVersion is the plan contract this binding is published under.

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