Documentation
¶
Index ¶
Constants ¶
const ( StageDraft = "Draft" StageProposed = "Proposed" StagePublished = "Published" StageDeletionProposed = "DeletionProposed" )
Stage names match porch PackageRevision lifecycle values.
Variables ¶
This section is empty.
Functions ¶
func AllowedTransitions ¶
AllowedTransitions returns the lifecycle state machine for the given options.
func NextTransitionToward ¶
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 ¶
TransitionAllowed reports whether from → to is permitted under opts.
func ValidateTransition ¶
ValidateTransition returns an error if from → to is not permitted under opts.