dadav/helm-schema

Helm dependency that shares the same chart name dont get picked up

Closed this issue · 2 comments

👋 Thanks for creating this project, trying to use it but ran into a minor bug when using dependencies;

If the chart name is the same as the dependency name, helm-schema fails to pick up the dependency;

example if this is my Chart.yaml:

apiVersion: v2
appVersion: 0.1.0
description: A wrapper chart for node-problem-detector
name: node-problem-detector
version: 0.1.0
dependencies:
- name: node-problem-detector
  repository: https://charts.deliveryhero.io
  version: 2.3.11

First I get the dependency

helm dependency build
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading node-problem-detector from repo https://charts.deliveryhero.io
Deleting outdated charts

Then untar the helm chart:

cd charts
tar -xzvf node-problem-detector-2.3.11.tgz
cd ..

then running helm-schema gives me the following:

helm-schema -r  --skip-auto-generation="required" --log-level debug
WARN[2024-05-10T15:27:23-07:00] Could not sort results: circular or missing dependency found: map[node-problem-detector:Set{node-problem-detector}] 
DEBU[2024-05-10T15:27:23-07:00] Processing result for chart: node-problem-detector (Chart.yaml) 
WARN[2024-05-10T15:27:23-07:00] Dependency (node-problem-detector->node-problem-detector) specified but no schema found. If you want to create jsonschemas for external dependencies, you need to run helm dependency build & untar the charts.

If I rename my chart or the dependency, seems to work ok;

I gave it some tries, but I'm not able to fix this. Please use different names for the charts.

The problem is in the TopSort function, if you want to give it a try.