Skip to content

Noksa/helm-resolve-deps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 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:

  1. 🔍 Discover all local dependencies recursively
  2. 📦 Resolve grandchild-chart dependencies first
  3. 🔗 Resolve child-chart dependencies (including grandchild)
  4. 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 --untar to inspect and modify dependent charts directly in the charts/ 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

About

A Helm plugin to properly resolve local chain dependencies in charts

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors