Expand description
Cluster reader trait for the lookup() template function
This module decouples the engine from a specific Kubernetes client.
sherpack-engine defines the trait; concrete implementations live in
crates that have a cluster client (e.g. sherpack-kube::lookup).
§Helm-compatible semantics
lookup is non-fatal: errors (404, 403, network, unknown kind) all
resolve to an empty result rather than failing the render. Errors are
surfaced through LookupState::take_warnings() so the caller can log
them after the render.
§Determinism caveat
Templates that use lookup are non-deterministic by construction:
the same Pack rendered against different clusters produces different
manifests. This is the same trade-off Helm makes; document it loudly.
§Wiring
ⓘ
use sherpack_engine::{Engine, cluster_reader::ClusterReader};
use std::sync::Arc;
let reader: Arc<dyn ClusterReader> = Arc::new(MyReader::new());
let engine = Engine::builder()
.strict(true)
.with_cluster_reader(reader)
.build();Structs§
- Lookup
State - Per-render state for the
lookup()function.
Traits§
- Cluster
Reader - Reads existing cluster resources at template-render time.