lifecycle

package
v1.6.4-pre.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	StageDraft            = "Draft"
	StageProposed         = "Proposed"
	StagePublished        = "Published"
	StageDeletionProposed = "DeletionProposed"
)

Stage names match porch PackageRevision lifecycle values.

Variables

This section is empty.

Functions

func AllowedTransitions

func AllowedTransitions(opts Options) map[string][]string

AllowedTransitions returns the lifecycle state machine for the given options.

func NextTransitionToward

func NextTransitionToward(opts Options, current, desired string) (string, error)

NextTransitionToward returns the immediate lifecycle the controller should write to the content cache on this reconcile, when syncing backend state (current) toward the CR spec (desired).

ValidateTransition(current, desired) answers whether a single jump is allowed. The controller often needs several allowed hops: the user may apply Draft→Proposed and Proposed→Published as separate API calls while reconcile has not run yet, so spec is Published but cache is still Draft. NextTransitionToward returns Proposed first, then Published on a later reconcile—not a policy violation.

func TransitionAllowed

func TransitionAllowed(opts Options, from, to string) bool

TransitionAllowed reports whether from → to is permitted under opts.

func ValidateTransition

func ValidateTransition(opts Options, from, to string) error

ValidateTransition returns an error if from → to is not permitted under opts.

Types

type Options

type Options struct {
	AllowDirectPublicationFromDraft bool
}

Options controls lifecycle policy enforced by the API server and controllers. Database triggers only implement technical rules; they do not read this policy.

Jump to

Keyboard shortcuts

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