appbundle

package
v0.19.1247 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunbookStepKindAction     = "action"
	RunbookStepKindDrift      = "drift"
	RunbookStepKindHealthGate = "health-gate"
)
View Source
const InputPlaceholderPrefix = "__NUON_INPUT_"

Variables

This section is empty.

Functions

func ComponentOutputPlaceholder

func ComponentOutputPlaceholder(componentName, outputPath string) string

func InputPlaceholder

func InputPlaceholder(name string) string

func ParseInputPlaceholder

func ParseInputPlaceholder(value string) (string, bool)

ParseInputPlaceholder returns the input name encoded by an exact InputPlaceholder token, and whether value is one.

Types

type ActionTemplate

type ActionTemplate struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// CronSchedule is a five-field cron expression evaluated in UTC. Empty
	// means manual dispatch only.
	CronSchedule  string          `json:"cron_schedule,omitempty"`
	JobType       string          `json:"job_type"`
	JobGroup      string          `json:"job_group"`
	JobOperation  string          `json:"job_operation"`
	CompositePlan json.RawMessage `json:"composite_plan"`
}

ActionTemplate is a self-contained offline action: its composite plan carries an ActionWorkflowRunPlan whose steps are fully interpolated inline commands (no git sources, no secret params). Publish rejects anything else.

type ComponentSpec

type ComponentSpec struct {
	InstallComponentID string `json:"install_component_id"`
	ComponentID        string `json:"component_id"`
	ComponentName      string `json:"component_name"`
	ComponentType      string `json:"component_type"`
	HelmReleaseName    string `json:"helm_release_name,omitempty"`
	HelmNamespace      string `json:"helm_namespace,omitempty"`
}

ComponentSpec is the component-health ownership metadata the connected runner would fetch from ctl-api (GetRunnerInstallComponents). It is frozen into the envelope at export so the offline health engine can map cluster and terraform resources back to components. It carries no credentials.

type DriftTemplate

type DriftTemplate struct {
	ID            string          `json:"id"`
	ComponentID   string          `json:"component_id,omitempty"`
	ComponentName string          `json:"component_name"`
	JobType       string          `json:"job_type"`
	JobGroup      string          `json:"job_group"`
	JobOperation  string          `json:"job_operation"`
	CompositePlan json.RawMessage `json:"composite_plan"`
}

DriftTemplate is a plan-only terraform run derived from a component's deploy plan with any pre-rendered plan contents cleared, so every drift run plans fresh against current state. Drift means "drifted from the bundle's frozen desired config".

type Envelope

type Envelope struct {
	Version   string          `json:"version"`
	OrgID     string          `json:"org_id"`
	AppID     string          `json:"app_id"`
	InstallID string          `json:"install_id"`
	CreatedAt time.Time       `json:"created_at"`
	Source    string          `json:"source"`
	AppConfig json.RawMessage `json:"app_config,omitempty"`
	Inputs    []InputSpec     `json:"inputs,omitempty"`
	// ForceDefaultCloudAuth rewrites every cloud-auth block in the composite
	// plans to use the runner process's ambient credentials. Exported plans
	// reference roles provisioned by the sandbox, which don't exist yet when
	// an offline run starts from scratch.
	ForceDefaultCloudAuth bool            `json:"force_default_cloud_auth,omitempty"`
	Components            []ComponentSpec `json:"components,omitempty"`
	Steps                 []Step          `json:"steps"`
	// Operation templates are immutable execution templates, not saved plans:
	// every run instantiates a fresh runtime job from the pinned plan.
	Actions  []ActionTemplate  `json:"actions,omitempty"`
	Drift    []DriftTemplate   `json:"drift,omitempty"`
	Runbooks []RunbookTemplate `json:"runbooks,omitempty"`
	// OutputBindings map component-output placeholder tokens baked into
	// composite plans to the producing step's terraform outputs, letting the
	// runner render cross-component references after the producer applies.
	OutputBindings []OutputBinding `json:"output_bindings,omitempty"`
}

func Load

func Load(path string) (*Envelope, error)

func Parse

func Parse(b []byte) (*Envelope, error)

func (*Envelope) FindAction

func (e *Envelope) FindAction(id string) *ActionTemplate

func (*Envelope) FindDrift

func (e *Envelope) FindDrift(id string) *DriftTemplate

func (*Envelope) FindRunbook

func (e *Envelope) FindRunbook(id string) *RunbookTemplate

func (*Envelope) Validate

func (e *Envelope) Validate() error

type InputSpec

type InputSpec struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description,omitempty"`
	Secret      bool   `json:"secret,omitempty"`
	Required    bool   `json:"required,omitempty"`
	Default     string `json:"default,omitempty"`
	// Bindable reports whether plan export replaced this input's reference
	// value with a placeholder, so a customer-supplied value takes effect
	// offline. Non-bindable inputs keep the value baked at publish time.
	Bindable bool `json:"bindable,omitempty"`
}

type OutputBinding

type OutputBinding struct {
	Token         string `json:"token"`
	ComponentName string `json:"component_name"`
	StepID        string `json:"step_id"`
	OutputPath    string `json:"output_path"`
}

OutputBinding defers one cross-component output reference to execution time. Token is the exact placeholder string compiled into downstream plans; StepID names the producing component's apply step, whose recorded outputs are walked with the dotted OutputPath to yield the value.

type RunbookStep

type RunbookStep struct {
	Kind  string `json:"kind"`
	RefID string `json:"ref_id,omitempty"`
	// Component scopes a health-gate to one component by name; empty gates
	// on every component's health.
	Component string `json:"component,omitempty"`
}

type RunbookTemplate

type RunbookTemplate struct {
	ID    string        `json:"id"`
	Name  string        `json:"name"`
	Steps []RunbookStep `json:"steps"`
}

type Step

type Step struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	JobType      string   `json:"job_type"`
	JobOperation string   `json:"job_operation"`
	JobGroup     string   `json:"job_group"`
	DependsOn    []string `json:"depends_on,omitempty"`
	// PlanFromStep names an earlier step whose execution result (a rendered
	// plan, e.g. a tfplan) is injected into this step's composite plan as
	// apply_plan_contents at fetch time. This replaces the control plane's
	// plan-approval chaining for offline runs.
	PlanFromStep  string          `json:"plan_from_step,omitempty"`
	CompositePlan json.RawMessage `json:"composite_plan"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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