Core Engine
The core engine (jhelm-core) handles chart management and the rendering pipeline.
1. Key Classes
-
Engine.java— Main rendering engine that orchestrates template processing -
Chart.java— Represents a Helm chart with metadata and templates -
RepoManager.java— Manages Helm chart repositories
2. Rendering Pipeline
The engine handles:
-
Named template collection and caching
-
Subchart rendering with recursion prevention
-
Value merging from chart defaults and user overrides
-
Template context management (Release, Chart, Values, Capabilities, etc.)
3. Implementation Details
-
Template Rendering: The
Engineclass creates a newGoTemplatefor each render to avoid template accumulation. -
Action Classes: Logic for Helm operations is encapsulated in Action classes (e.g.,
InstallAction,UpgradeAction,RollbackAction,TemplateAction,ShowAction). -
Recursion Protection: Stack depth tracking prevents infinite template recursion.
-
Named Templates:
defineblocks are collected before rendering begins. -
Value Merging: Chart values are merged with user-provided values and release info.
-
Capabilities:
.Capabilities.KubeVersionand.Capabilities.APIVersionsare supplied via aCapabilitiesoverride. Duringinstall/upgradethe engine reads the live server version from theKubeServiceso version-gated charts render against the real target; when the cluster is unreachable, or for the offlinetemplatecommand, it uses a built-in default (v1.35.0) that thetemplatecommand can override with--kube-version/--api-versions. -
Error Handling: Custom exceptions for parsing, execution, and not-found scenarios.