Documentation
¶
Overview ¶
Package contract implements the Deployment CR contract adapter — the one-way projection from the resolved runtime spec (resolve.ResolvedDeploymentSpec) to the protobuf contract type (environmentscontractv1alpha1.DeploymentSpec).
The contract type is consumed by infrastructure-layer concerns only:
- Execution hash computation for deployment deduplication
- Spec comparison across GitOps reconciliation cycles
- Audit pipelines
Controllers and domain logic MUST NOT consume the returned contract value.
Unlike the BuildTrigger adapter, enum mapping here is non-fatal — unknown runtime and reconciliation strategy values map to UNSPECIFIED rather than returning an error. UNSPECIFIED is a valid contract value that downstream consumers can handle gracefully.
The common proto wrapper pattern applies: Runtime and ReconciliationStrategy are wrapper messages (*v1.DeploymentRuntime, *v1.ReconciliationStrategy) with the enum value carried on a named field.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToDeploymentContract ¶
func ToDeploymentContract(s *resolve.ResolvedDeploymentSpec) *environmentscontractv1alpha1.DeploymentSpec
ToDeploymentContract projects the resolved runtime deployment spec into a protobuf environmentscontractv1alpha1.DeploymentSpec for infrastructure consumers (hashing, comparison, audit).
Runtime and ReconciliationStrategy are projected as wrapper message instances carrying the enum value on a named field.
ManifestsRepo is omitted when nil — a Deployment without a manifests repo has not yet been fully configured and produces a partial contract suitable for hashing but not for GitOps delivery.
⚠️ ONE-WAY adapter. The returned value MUST NOT be fed back into any controller or domain logic path.
Types ¶
This section is empty.