Documentation
¶
Overview ¶
Package resolve implements resolution for the Package CR.
The Package CR stores its spec as a raw JSON contract (spec.contract) rather than typed Kubernetes fields. ResolvePackage decodes this raw contract into a fully typed ResolvedPackage — the authoritative runtime representation consumed by all downstream domain and application logic.
Resolution is strict: required fields that are missing or malformed return errors immediately. Optional fields are extracted with safe defaults. No panics — all validation surfaces as errors that the domain layer can handle and record as conditions on the CR.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResolvedMaintainer ¶
ResolvedMaintainer is a package maintainer contact.
type ResolvedPackage ¶
type ResolvedPackage struct {
Package *environmentv1alpha1.Package
Spec *ResolvedPackageSpec
}
ResolvedPackage is the fully resolved Package CR, pairing the original Kubernetes object with its decoded and validated spec.
func ResolvePackage ¶
func ResolvePackage(pkg *environmentv1alpha1.Package) (*ResolvedPackage, error)
ResolvePackage decodes and validates the raw JSON contract from the Package CR spec into a ResolvedPackage. Returns an error if the CR is nil, the contract is absent, or any required field is missing or malformed.
type ResolvedPackageRepository ¶
type ResolvedPackageRepository struct {
URL string
CredentialsSecret string
// Ref is the Git ref to apply: a branch, tag or commit SHA, as the
// contract declares it. Required — the repository is not fetched
// without one.
Ref string
// Path is the directory inside the repository that holds the package
// definitions. Empty means the repository root.
Path string
}
ResolvedPackageRepository is the resolved OCI or Carvel package repository from which the package is sourced.
type ResolvedPackageSpec ¶
type ResolvedPackageSpec struct {
Name string
Version string
Description string
// DiffEnabled controls whether kapp diff is run before apply.
DiffEnabled bool
PackageRepository ResolvedPackageRepository
// StateRepository is optional — not all packages track state via GitOps.
StateRepository *ResolvedStateRepository
Maintainers []ResolvedMaintainer
}
ResolvedPackageSpec is the decoded and validated Package spec, ready for domain and application layer consumption.
type ResolvedStateRepository ¶
type ResolvedStateRepository struct {
URL string
// Ref is the Git ref to reconcile against: a branch, tag or commit SHA,
// as the contract declares it. Empty when not declared.
Ref string
CloneSecret string
Strategy string
Path string
}
ResolvedStateRepository is the optional GitOps state repository where package deployment state is tracked.