Documentation
¶
Overview ¶
Package resolve implements resolution for the Environment CR.
The Environment CR stores its spec as a raw JSON contract (spec.contract). ResolveEnvironment decodes this into a fully typed ResolvedEnvironment — the authoritative runtime representation consumed by all downstream domain and application logic.
Resolution is nil-tolerant for the CR itself but strict on the contract payload — a missing or malformed contract is always an error. All failures surface as errors. Resolution never panics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResolvedEnvironment ¶
type ResolvedEnvironment struct {
Environment *environmentv1alpha1.Environment
Spec *ResolvedEnvironmentSpec
}
ResolvedEnvironment pairs the original Kubernetes Environment object with its fully decoded and validated spec.
func ResolveEnvironment ¶
func ResolveEnvironment(environment *environmentv1alpha1.Environment) (*ResolvedEnvironment, error)
ResolveEnvironment decodes and validates the raw JSON contract from the Environment CR spec into a ResolvedEnvironment.
type ResolvedEnvironmentContract ¶
type ResolvedEnvironmentContract struct {
SecretStoreProvider string
// Vault is non-nil only when SecretStoreProvider is "vault" /
// "SECRET_STORE_PROVIDER_VAULT". Populated from
// contract.secretStore.vault — validated at resolution time so a
// malformed CR fails fast here rather than deep inside ESO reconciliation.
Vault *ResolvedVaultConfig
}
ResolvedEnvironmentContract holds platform-level bindings declared on the Environment — the ESO secret store provider, plus provider-specific connection config needed to provision the store itself (currently Vault only; AWS/GCP/Azure still resolve to a pre-provisioned platform store).
type ResolvedEnvironmentSpec ¶
type ResolvedEnvironmentSpec struct {
ApplicationName string
Branch string
GitOwner string
EnvironmentType string
Version string
Description string
// Optional CR references — empty string means not declared.
Build string
GitRepository string
GitHubEvent string
Deployment string
Route string
// Domain is resolved and validated here but not yet projected to the
// contract or cached — Domain CR support is still a stub elsewhere in
// the platform. Kept as its own field so it no longer clobbers Route.
Domain string
Package string
// Slices are nil when not declared; empty slice is never returned.
ServiceUnits []string
// Platform-level bindings.
Contract *ResolvedEnvironmentContract
}
ResolvedEnvironmentSpec is the decoded Environment spec. All CR references are stored as name strings — cross-CR lookups are the responsibility of the domain layer.
type ResolvedVaultConfig ¶
type ResolvedVaultConfig struct {
// Address is the Vault server URL. Required.
Address string
// Path is the KV secrets engine mount path (e.g. "secret"). Required.
Path string
// Role is the Vault Kubernetes-auth role to assume. Required.
Role string
// MountPath is the Vault Kubernetes-auth mount path. Defaults to
// "kubernetes" when not declared.
MountPath string
// Version is the KV engine version ("v1" or "v2"). Defaults to "v2"
// when not declared.
Version string
// ServiceAccountName optionally names the ServiceAccount ESO uses to
// authenticate the Kubernetes-auth login. Empty means ESO falls back
// to its own pod identity.
ServiceAccountName string
}
ResolvedVaultConfig is the Environment-declared HashiCorp Vault connection used to provision the ClusterSecretStore/SecretStore ESO reads from. This is connection config only — secret values are populated into Vault by a separate out-of-band process, never by this repo.