domain

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package domain holds the pure Deployment domain model: DeploymentSpec (the desired state), DeploymentResult/ServiceUnitResult (the outcome of a reconciliation), and the Runtime/Strategy/ReconciliationStrategy/Phase enums shared across pkg/apis/deployment's other layers.

DOMAIN PRINCIPLES

- No Kubernetes imports - No controller-runtime - No side effects - No persistence concerns

This package represents the *intent* and *result* of a Deployment, not how it is reconciled — dispatch and execution live in pkg/apis/deployment/{reconcile,strategy,api}.

Index

Constants

View Source
const PhaseFailed = "Failed"

PhaseFailed is the phase of a Deployment, or of a ServiceUnit within it, that could not be applied.

Variables

View Source
var ErrDeploymentFailed = errors.New("deployment failed")

ErrDeploymentFailed reports that executing a Deployment ended with at least one ServiceUnit that could not be applied.

Functions

This section is empty.

Types

type DeploymentPhase

type DeploymentPhase string

DeploymentPhase is the high-level reconciliation phase of a Deployment.

type DeploymentResult

type DeploymentResult struct {
	Phase DeploymentPhase

	Message string

	Runtime  Runtime
	Strategy Strategy

	ServiceUnits []ServiceUnitResult

	LastUpdateTime time.Time
}

DeploymentResult represents the outcome of executing a DeploymentIntent

func (*DeploymentResult) Failure

func (r *DeploymentResult) Failure() error

Failure returns ErrDeploymentFailed, wrapped with what failed, for a result whose phase is Failed. It returns nil for any other result: the execution did not fail, even if it is not finished.

A ServiceUnit that cannot be applied does not abort the others, so it is reported in the result and not as an error from the execution. Failure is how a caller turns that result back into an error.

type DeploymentSpec

type DeploymentSpec struct {
	Name string

	ServiceUnits []string

	Runtime Runtime

	// Rollout strategy (Rolling / Canary / BlueGreen)
	Strategy Strategy

	ImageAutomation bool

	ManifestsRepo *ManifestsRepo

	GitOwner string

	ReconciliationStrategy ReconciliationStrategy
}

DeploymentSpec represents the desired state of a Deployment. This is the canonical domain input used by application logic.

type ManifestsRepo

type ManifestsRepo struct {
	URL         string
	Ref         string
	CloneSecret string
	Strategy    string
	Path        string
}

ManifestsRepo is the Git repository a Deployment's manifests are rendered from or applied against.

type ReconciliationStrategy

type ReconciliationStrategy string

ReconciliationStrategy selects how a Deployment's manifests are applied (imperative apply, Kustomize, or Helm).

const (
	ReconciliationImperative ReconciliationStrategy = "Imperative"
	ReconciliationKustomize  ReconciliationStrategy = "Kustomize"
	ReconciliationHelm       ReconciliationStrategy = "Helm"
)

type Runtime

type Runtime string

Runtime identifies which execution platform a ServiceUnit deploys to.

const (
	RuntimeKubernetes Runtime = "kubernetes.io/container-runtime"
	RuntimeKnative    Runtime = "knative.dev/service-runtime"
	RuntimeWasm       Runtime = "blanketops.dev/wasm-runtime"
	RuntimeECS        Runtime = "blanketops.dev/aws-ecs"
	RuntimeAzure      Runtime = "blanketops.dev/azure-container"
)

type ServiceUnitPhase

type ServiceUnitPhase string

ServiceUnitPhase is the reconciliation phase of a single ServiceUnit within a Deployment.

type ServiceUnitResult

type ServiceUnitResult struct {
	Name string

	Phase ServiceUnitPhase

	Image string

	Runtime Runtime

	Message string
	Error   string

	LastTransitionTime time.Time
}

ServiceUnitResult is the observed outcome of reconciling a single ServiceUnit within a Deployment.

type Strategy

type Strategy string

Strategy selects the rollout strategy used when deploying a ServiceUnit.

const (
	StrategyRolling   Strategy = "Rolling"
	StrategyBlueGreen Strategy = "BlueGreen"
	StrategyCanary    Strategy = "Canary"
)

Jump to

Keyboard shortcuts

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