Documentation
¶
Overview ¶
Package deployment owns DeploymentIntent — the Kubernetes-free, fully resolved plan for a Deployment, built once its ResolvedDeployment and ResolvedServiceUnits are known. It carries which runtime and strategy to use, the reconciliation mode, and each ServiceUnit's own pkg/intent/serviceunit.ServiceUnitIntent.
IntentBuilder.Build (intent_builder.go) is the canonical, complete constructor and the one pkg/apis/deployment/application.DeploymentService actually calls. ResolveDeploymentIntent (resolve.go) is an older, partial constructor that never learned Runtime/Strategy/ReconciliationStrategy/ ManifestsRepo — it has no callers in DeploymentService's path and should be treated as superseded rather than a second supported entry point.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInvalidDeployment ¶
ErrInvalidDeployment indicates a semantic error in a resolved Deployment. This means the resolver violated an invariant or the contract is invalid.
func ErrServiceUnitNotFound ¶
ErrServiceUnitNotFound indicates a Deployment references a ServiceUnit name that has no corresponding resolved ServiceUnit.
Types ¶
type DeploymentIntent ¶
type DeploymentIntent struct {
Source *environmentv1alpha1.Deployment // ← IMPORTANT
Name string
Namespace string
Runtime Runtime
Strategy Strategy
ServiceUnits []serviceunitIntent.ServiceUnitIntent
ReconciliationStrategy ReconciliationStrategy
ImageAutomation bool
ManifestsRepo *ManifestsRepo
GitOwner string
GeneratedAt time.Time
}
DeploymentIntent is the Kubernetes-free, fully resolved plan for a Deployment: which runtime and strategy to use, the reconciliation mode, and each ServiceUnit's own intent. Built by IntentBuilder.Build.
func ResolveDeploymentIntent ¶
func ResolveDeploymentIntent( deploy *deploymentResolution.ResolvedDeployment, serviceUnits map[string]*serviceunitResolution.ResolvedServiceUnit, ) (*DeploymentIntent, error)
ResolveDeploymentIntent is an older, partial DeploymentIntent constructor that never learned Runtime/Strategy/ReconciliationStrategy/ManifestsRepo. It has no callers in DeploymentService's path — superseded by IntentBuilder.Build, not a second supported entry point.
type IntentBuilder ¶
type IntentBuilder struct{}
IntentBuilder builds a DeploymentIntent from fully resolved inputs. It is the canonical, complete constructor that DeploymentService calls.
func NewIntentBuilder ¶
func NewIntentBuilder() *IntentBuilder
NewIntentBuilder constructs an IntentBuilder.
func (*IntentBuilder) Build ¶
func (b *IntentBuilder) Build( ctx context.Context, depl *deploymentResolution.ResolvedDeployment, serviceUnits []serviceunitResolution.ResolvedServiceUnit, ) (*DeploymentIntent, error)
Build constructs a DeploymentIntent from fully RESOLVED inputs.
CONTRACT: - Inputs are already validated and normalized - No Kubernetes types allowed - No string-to-enum logic allowed - Any invalid state is a resolver bug
func (*IntentBuilder) BuildTeardown ¶
func (b *IntentBuilder) BuildTeardown( depl *deploymentResolution.ResolvedDeployment, ) (*DeploymentIntent, error)
BuildTeardown constructs the DeploymentIntent needed to remove what a Deployment applied. It takes the Deployment alone.
What was applied for each ServiceUnit is named after it, and the names are in the Deployment's own contract. Tearing down must not depend on the ServiceUnits themselves: they may already be gone, or no longer resolve, or name a Build that has no image, and none of that is a reason to leave the workload running and the Deployment undeletable.
type ManifestsRepo ¶
type ManifestsRepo struct {
// URL to the manifests repository
URL string
// Git reference
Ref Ref
// Secret used to clone the repository
CloneSecret string
// Application strategy (e.g. kustomization, helm, raw)
Strategy string
// Path within the repository
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.
type ServiceUnitPhase ¶
type ServiceUnitPhase string
ServiceUnitPhase is the reconciliation phase of a single ServiceUnit within a Deployment.
const ( ServiceUnitPending ServiceUnitPhase = "Pending" ServiceUnitResolving ServiceUnitPhase = "Resolving" ServiceUnitDeploying ServiceUnitPhase = "Deploying" ServiceUnitReady ServiceUnitPhase = "Ready" ServiceUnitFailed ServiceUnitPhase = "Failed" )
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.