pub struct MacroPostProcessor { /* private fields */ }Expand description
Post-processor for macro variable scoping
Implementations§
Source§impl MacroPostProcessor
impl MacroPostProcessor
Sourcepub fn from_yaml(yaml_content: &str) -> Result<Self, Error>
pub fn from_yaml(yaml_content: &str) -> Result<Self, Error>
Create a new processor from values.yaml content
Sourcepub fn from_value(value: &Value) -> Self
pub fn from_value(value: &Value) -> Self
Create from a pre-parsed YAML value
Sourcepub fn resolve(&self, variable: &str) -> ResolvedVariable
pub fn resolve(&self, variable: &str) -> ResolvedVariable
Resolve a bare variable name to its full path
Sourcepub fn resolve_with_hint(&self, variable: &str, hint: &str) -> ResolvedVariable
pub fn resolve_with_hint(&self, variable: &str, hint: &str) -> ResolvedVariable
Resolve a variable with a hint about the expected parent path segment
For example, if the variable is chroot and the hint is image,
prefer values.controller.image.chroot over other paths.
Sourcepub fn extract_macros(content: &str) -> Vec<MacroDefinition>
pub fn extract_macros(content: &str) -> Vec<MacroDefinition>
Extract all macro definitions from a template
Sourcepub fn find_bare_variables(macro_body: &str) -> Vec<String>
pub fn find_bare_variables(macro_body: &str) -> Vec<String>
Find bare variable references in a macro body
Returns variable names that are:
- Not prefixed with
values.,release.,pack.,capabilities.,_with_ctx. - Not Jinja2 keywords or builtin functions
- Inside expressions ({{ }}) or control structures ({% %})
- Not loop or set variable declarations