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 ¶
const PhaseFailed = "Failed"
PhaseFailed is the phase of a Deployment, or of a ServiceUnit within it, that could not be applied.
Variables ¶
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 ¶
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.
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.