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

  1. Template Rendering: The Engine class creates a new GoTemplate for each render to avoid template accumulation.

  2. Action Classes: Logic for Helm operations is encapsulated in Action classes (e.g., InstallAction, UpgradeAction, RollbackAction, TemplateAction, ShowAction).

  3. Recursion Protection: Stack depth tracking prevents infinite template recursion.

  4. Named Templates: define blocks are collected before rendering begins.

  5. Value Merging: Chart values are merged with user-provided values and release info.

  6. Error Handling: Custom exceptions for parsing, execution, and not-found scenarios.