A Helm plugin to properly resolve local chain dependencies in charts
๐ helm-resolve-deps
โก A Helm plugin that properly resolves local chain dependencies in charts
๐ค Why?
Helm's built-in helm dependency update doesn't handle transitive local dependencies well. If you have charts with file:// dependencies that themselves have dependencies, Helm won't resolve the entire chain correctly.
helm-resolve-deps solves this by recursively resolving all local dependencies in the correct order.
Inspired by helm/helm#2247
๐ Note: I've created an issue and a pull request to fix this in Helm itself. Until it's merged, this plugin provides the solution.
โจ Key Benefits
| Feature | Description | |--------------------------------|----------------------------------------------------------| | ๐ Chain Resolution | Recursively resolves local (file://) dependencies | | โก Parallel Processing | Bounded-concurrency dependency resolution (errgroup) | | ๐ฆ Unpack Mode | Extract .tgz archives for debugging | | ๐งน Clean Mode | Remove old dependencies before updating | | ๐ Cycle Detection | Fast-fails on circular file:// chains with a chain trace | | โ Cancellable | Ctrl-C propagates to running helm/tar sub-processes |
๐ Requirements
- ๐ฏ Helm 3 installed on host machine
๐ Installation
(helm plugin uninstall resolve-deps || true) && helm plugin install https://github.com/Noksa/helm-resolve-deps.git
๐ก Helm 4 users: Add --verify=false flag to the install command
๐ Usage
๐ Getting Help
helm resolve-deps --help
๐ฏ Basic Syntax
helm resolve-deps [PATH] [FLAGS]
๐ง Available Flags
| Flag | Short | Description | |-----------------------|-------|----------------------------------------------------------| | --untar | -u | Unpack dependent charts as directories instead of .tgz | | --clean | -c | Remove charts/, tmpcharts/, and Chart.lock | | --skip-refresh | | Skip fetching updates from Helm repositories | | --skip-refresh-in | | Deprecated, no-op. Retained for backwards compatibility | | --threads | | Number of parallel workers (default: CPU count - 1, min 1) | | --help | -h | Show help | | --version | -v | Show version |
Anything passed after -- is forwarded verbatim to every recursive helm dependency update invocation.
โ๏ธ How It Works
Given this structure:
parent-chart/ โโโ Chart.yaml (depends on child-chart via file://) โโโ charts/ โโโ child-chart/ โโโ Chart.yaml (depends on grandchild-chart via file://)
Running helm resolve-deps parent-chart will:
- ๐ Discover all local dependencies recursively
- ๐ฆ Resolve grandchild-chart dependencies first
- ๐ Resolve child-chart dependencies (including grandchild)
- โ Resolve parent-chart dependencies (including entire chain)
๐ก Examples
๐ Basic Operations
Resolve dependencies in current directory
helm resolve-deps .
Resolve with repository refresh skipped
helm resolve-deps . --skip-refresh
๐งน Clean Operations
Clean before resolving
helm resolve-deps . --clean
Clean and unpack dependencies
helm resolve-deps . --clean --untar
โก Performance Optimization
Use multiple threads
# Use 4 parallel workers helm resolve-deps . --threads 4
Skip refresh for specific charts
# Skip refresh for chart1 and chart2 helm resolve-deps . --skip-refresh-in chart1,chart2
๐ง Advanced Usage
Unpack dependencies for debugging
# Extract all .tgz files to directories helm resolve-deps ~/charts/my-chart --untar
๐ก Tip: Use--untarto inspect and modify dependent charts directly in thecharts/directory
Pass additional flags to helm dependency update
# Everything after -- is forwarded verbatim to "helm dependency update" helm resolve-deps . -- --kubeconfig myconfig helm resolve-deps . -- --debug
Full example with all options
helm resolve-deps ~/charts/my-chart \ --clean \ --untar \ --threads 4 \ -- --debug
๐ Cycle Detection
If the chart graph contains a cycle (e.g. A depends on B and B depends on A via file://), the plugin fails immediately with the offending chain:
Error: cyclic chart dependency detected: /path/to/a -> /path/to/b -> /path/to/a
No deadlocks, no infinite recursion.
๐งช Testing
make test
๐ Linting
make lint