Documentation
¶
Overview ¶
Package engine orchestrates the load → fetch → compare pipeline that powers kube-diff. It exposes the comparison core as importable functions so that out-of-tree consumers (for example an in-cluster drift-detection controller) can reuse the exact same diff logic without depending on the CLI layer, stdout rendering, or os.Exit behavior.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare( ctx context.Context, fetcher cluster.ResourceFetcher, resources []source.Resource, opts diff.CompareOptions, ) ([]*diff.Result, error)
Compare compares each already-loaded local resource against the live cluster state using the given fetcher, returning one Result per resource. A resource the cluster reports as absent (a NotFound error, or a no-match error for a kind the cluster does not serve) is reported with StatusNew. Any other fetch error, such as Forbidden or a timeout, aborts the comparison and is returned wrapped with the resource identity, so a missing read permission or an unreachable API server is never mistaken for drift. It performs no filtering and no output rendering — callers decide what to do with the structured results.
func Run ¶
func Run( ctx context.Context, src source.Source, fetcher cluster.ResourceFetcher, opts diff.CompareOptions, ) ([]*diff.Result, error)
Run is a convenience wrapper that loads resources from src and then compares them against the cluster via Compare. It is the simplest entry point for consumers that do not need the CLI's intermediate filtering step.
Types ¶
This section is empty.