Documentation
¶
Overview ¶
Package migrationview reads what the operator stored about one migration.
It is the read side of the migration path: what the database's own history said when it was last read, which sequence the operator would run next, and what the last run did. It connects to no database and reads no Secret.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMigrationNotFound = errors.New("no PtahMigration by that name")
ErrMigrationNotFound is returned when the named PtahMigration is not there. It is separate from a read failure: "there is nothing by that name" is an answer.
var Formats = []Format{Text, JSON}
Formats are the accepted values, in the order the help lists them.
Functions ¶
Types ¶
type ArtifactView ¶
type ArtifactView = sourceview.View
ArtifactView is the resolved, credential-free source binding: an OCI artifact, a ConfigMap and its snapshot, or a Git commit.
type ConditionView ¶
type ConditionView struct {
Type string `json:"type"`
Status string `json:"status"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
}
ConditionView is one published condition, reduced to what a reader acts on.
type HistoryView ¶
type HistoryView struct {
ObservedAt metav1.Time `json:"observedAt"`
CurrentVersion int64 `json:"currentVersion"`
CheckpointVersion int64 `json:"checkpointVersion,omitempty"`
AppliedCount int32 `json:"appliedCount"`
PendingCount int32 `json:"pendingCount"`
Dirty bool `json:"dirty,omitempty"`
ModifiedVersions []int64 `json:"modifiedVersions,omitempty"`
// OutOfOrderVersions names migrations that sort below the current version.
// Linear execution refuses them, so a reader of this view has to see which
// ones rather than a phase that says the history is blocked.
OutOfOrderVersions []int64 `json:"outOfOrderVersions,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
}
HistoryView is what the revision table said when it was last read.
type PlanView ¶
type PlanView struct {
Name string `json:"name"`
Fingerprint string `json:"fingerprint"`
CurrentVersion int64 `json:"currentVersion"`
CreatedAt metav1.Time `json:"createdAt"`
Migrations []PlannedMigrationView `json:"migrations"`
}
PlanView is the sequence the operator would run next. A migration plan holds versions and checksums rather than SQL: the statements live in the artifact, and printing them here would mean fetching it.
type PlannedMigrationView ¶
type PlannedMigrationView struct {
Version int64 `json:"version"`
VersionKey string `json:"versionKey,omitempty"`
Description string `json:"description,omitempty"`
Checksum string `json:"checksum"`
Checkpoint bool `json:"checkpoint,omitempty"`
TransactionMode string `json:"transactionMode,omitempty"`
}
PlannedMigrationView is one migration of the sequence.
type RunView ¶
type RunView struct {
Outcome string `json:"outcome"`
StartedAt metav1.Time `json:"startedAt"`
FinishedAt *metav1.Time `json:"finishedAt,omitempty"`
AppliedVersions []int64 `json:"appliedVersions,omitempty"`
Message string `json:"message,omitempty"`
}
RunView is what the database accounted for after the last execution.
type View ¶
type View struct {
Namespace string `json:"namespace"`
Migration string `json:"migration"`
Phase string `json:"phase,omitempty"`
Suspended bool `json:"suspended,omitempty"`
Artifact *ArtifactView `json:"artifact,omitempty"`
History *HistoryView `json:"history,omitempty"`
Plan *PlanView `json:"plan,omitempty"`
LastRun *RunView `json:"lastRun,omitempty"`
Conditions []ConditionView `json:"conditions,omitempty"`
}
View is everything this command prints, resolved before anything is written.