serial

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 3

README

pkg/provisioners/serial

Intention

pkg/provisioners/serial is the ordered-composition combinator for provisioners whose lifecycle has ordering constraints. It is intended for reconciler-driven use, where child provisioners are expected to be idempotent and repeated reconcile passes are expected to drive the system toward convergence.

This package does not try to provide transactional rollback. Its job is simpler:

  • provision children in dependency order
  • deprovision children in reverse dependency order
  • stop on the first error or yield and let the reconciler come back later

Invariants And Guard Rails

  • Provision(ctx) executes child provisioners in the declared order.
  • Deprovision(ctx) executes child provisioners in reverse order.
  • Execution stops on the first returned error, including provisioners.ErrYield.
  • This combinator assumes child provisioners are idempotent and safe to revisit on later reconcile passes.
  • The intended convergence model is controller-driven retry, not one-shot success.
  • Reverse-order deprovision assumes the same ordered child list is valid for both creation and teardown, with teardown simply needing the inverse traversal.

Caveats

  • This package preserves ordering only. It does not attempt rollback or compensation for earlier successful provision steps when a later child fails.
  • Partial progress is expected and acceptable in the reconciler model, but only because callers are expected to supply idempotent children and rely on automatic retries.
  • If the declared ordering is wrong, this combinator will faithfully enforce that wrong ordering.
  • Because execution stops on first error or yield, later children remain untouched until a future reconcile pass resumes progress.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provisioner

type Provisioner struct {
	provisioners.Metadata
	// contains filtered or unexported fields
}

func New

func New(name string, p ...provisioners.Provisioner) *Provisioner

func (*Provisioner) Deprovision

func (p *Provisioner) Deprovision(ctx context.Context) error

Deprovision implements the Provision interface. Note: things happen in the reverse order to provisioning, this assumes that the same code that generates the provisioner, generates the deprovisioner and ordering constraints matter.

func (*Provisioner) Provision

func (p *Provisioner) Provision(ctx context.Context) error

Provision implements the Provision interface.

Jump to

Keyboard shortcuts

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