deploymentplan

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package deploymentplan holds immutable environment-specific executable plans. Credential values and runtime selector values never enter this envelope.

Index

Constants

View Source
const FormatVersion = 1

Variables

View Source
var ErrInvalid = xerror.New(xerror.KindInvalidInput, "DEPLOYMENT_RESOLUTION_INVALID", "deployment resolution is missing, invalid or no longer usable")

Functions

func Admit

func Admit(ctx context.Context, source slug.Slug, reference string) error

Admit records a lifecycle reference, never the credential's value or its hash.

func DispatchConfig

func DispatchConfig(ctx context.Context, org, source slug.Slug) (string, error)

DispatchConfig requires every dispatched source to belong to the attempt.

func Encode

func Encode(plan Plan) ([]byte, string, error)

func WithDispatch

func WithDispatch(ctx context.Context, org slug.Slug, targets []Target) context.Context

func WithStep

func WithStep(ctx context.Context, step slug.Slug) context.Context

Types

type Admission

type Admission struct {
	Step                slug.Slug `json:"step"`
	DataSource          slug.Slug `json:"data_source"`
	CredentialReference string    `json:"credential_reference"`
}

func Admissions

func Admissions(ctx context.Context) []Admission

type Input

type Input struct {
	Key      string                         `json:"key"`
	Type     model.RuntimeVariableValueType `json:"type"`
	Value    string                         `json:"value"`
	Revision string                         `json:"revision"`
}

type Plan

type Plan struct {
	TemplateDigest   string                          `json:"template_digest"`
	ResolutionInputs map[string]odcs.ResolutionValue `json:"resolution_inputs,omitempty"`
	RevalidatedFrom  string                          `json:"revalidated_from,omitempty"`
	Inputs           []Input                         `json:"inputs,omitempty"`
	LiteralValues    []pipelinevars.LiteralLocation  `json:"literal_values,omitempty"`
	FormatVersion    int                             `json:"format_version"`
	Organization     slug.Slug                       `json:"organization"`
	Project          slug.Slug                       `json:"project"`
	Environment      slug.Slug                       `json:"environment"`
	CompiledDigest   string                          `json:"compiled_digest"`
	CompiledPlan     json.RawMessage                 `json:"compiled_plan"`
	Pipeline         *pipelinespec.Pipeline          `json:"pipeline"`
	Targets          []Target                        `json:"targets"`
}

func Read

func Read(raw []byte, expected string) (*Plan, error)

Read verifies only recorded bytes, without resolving bindings or operations.

func (*Plan) Matches

func (p *Plan) Matches(org, project, environment, pipeline slug.Slug) bool

type Target

type Target struct {
	Step            slug.Slug `json:"step"`
	Role            string    `json:"role"`
	Reference       slug.Slug `json:"reference"`
	DataSource      slug.Slug `json:"data_source"`
	ConfigDigest    string    `json:"config_digest"`
	BindingRevision string    `json:"binding_revision"`
}

Jump to

Keyboard shortcuts

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