Bug 2081762

Summary: Umbrella helm charts do not work with the current https://charts.openshift.io/
Product: OpenShift Developer Tools and Services Reporter: jtudelag
Component: HelmAssignee: Martin Mulholland <mmulholl>
Status: CLOSED WONTFIX QA Contact: Pavel Macik <pmacik>
Severity: unspecified Docs Contact: Preeti Chandrashekar <pchandra>
Priority: unspecified    
Version: 4.9CC: bkundu, dperaza
Target Milestone: ---   
Target Release: 4.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-07 22:48:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jtudelag 2022-05-04 14:50:23 UTC
Description of problem:

The current charts.openshift.io helm repo index(https://charts.openshift.io/index.yaml) does not work with the umbrella helm chart pattern because helm repo index keys do not match helm charts names...

As an example, "fiware-orion-ld" is the name of index key of the helm repo, while the chart name is "orion-ld". There must be a local check from the helm cli that checks those should match...

```
fiware-orion-ld:
  - annotations:
      charts.openshift.io/digest: sha256:7e67553ee7d697bed1b7d40a9d1c3ed1d724e32c7894c43629b5c156718aa3dd
      charts.openshift.io/lastCertifiedTimestamp: '2022-01-19T16:19:54.899727+00:00'
      charts.openshift.io/provider: FIWARE FOUNDATION E V
      charts.openshift.io/providerType: partner
      charts.openshift.io/submissionTimestamp: '2022-01-19T16:26:11.553809+00:00'
      charts.openshift.io/supportedOpenShiftVersions: '>=4.6'
      charts.openshift.io/testedOpenShiftVersion: '4.6'
    apiVersion: v2
    appVersion: 1.0.1
    description: A Helm chart for running the fiware orion-ld context broker on kubernetes.
    digest: 1d0303e3045755f86f9065eb4d901fa7364696ddd7e0d164fb3b165ddb3fa0a1
    home: https://github.com/FIWARE/context.Orion-LD
    icon: https://fiware.github.io/catalogue/img/fiware.png
    keywords:
    - fiware
    - orion-ld
    kubeVersion: '>= 1.19'
    maintainers:
    - email: stefan.wiedemann
      name: wistefan
    name: orion-ld
´´´  



Version-Release number of selected component (if applicable):

oc version                                                                                                                          
Client Version: 4.9.31                                                                                                                  
Server Version: 4.9.12                                                                                                                  
Kubernetes Version: v1.22.3+e790d7f

helm version
version.BuildInfo{Version:"v3.8.2", GitCommit:"6e3701edea09e5d55a8ca2aae03a68917630e91b", GitTreeState:"clean", GoVersion:"go1.17.5"}

How reproducible:

Steps to Reproduce:
1. Create the following Chart.yaml following the umbrella pattern (external dependency)

mkdir reproduce
cd reproduce

cat << EOF > Chart.yaml
apiVersion: v2
name: orion-ld
description: Chart holder for FIWARE Orion Context Broker LD

type: application
version: 0.1.0
appVersion: "1.0.2"

dependencies:
- name: fiware-orion-ld
  version: 1.0.2
  repository: https://charts.openshift.io/
EOF


2. Build helm dependency 

helm dependency build                                                                                                               
Getting updates for unmanaged Helm repositories...
...Successfully got an update from the "https://charts.openshift.io/" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading fiware-orion-ld from repo https://charts.openshift.io/
Deleting outdated charts

ls -l charts/
total 16
-rw-r--r--. 1 XXXX XXX 14018 May  4 16:43 fiware-orion-ld-1.0.2.tgz

3. Try to render it

helm template .
Error: An error occurred while checking for chart dependencies. You may need to run `helm dependency build` to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: fiware-orion-ld

Actual results:

helm template .
Error: An error occurred while checking for chart dependencies. You may need to run `helm dependency build` to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: fiware-orion-ld

Expected results:

The chart to be rendered locally properly.

Additional info:

Comment 1 David Peraza 2022-08-16 12:03:50 UTC
We are working with upstream team, but it looks like there is no way to fix this upstream. We are investigating if we can do something downstream. In the mean time you can download dependency charts with out using helm dependency build and name it the same as the chart name under the charts directory.

Comment 2 Martin Mulholland 2022-12-07 22:48:00 UTC
After further investigation we cannot fix this and a work around us needed. Two option are available:

1.Download the chart manually first and add it to the charts directory
2.Specify the dependency as: 
   - name: orion-ld
     version: 1.0.2
     repository: https://charts.openshift.io/

1. Run "helm dependency build" to download the chart.
2. Modify the dependency to:
   - name: orion-ld
     version: 1.0.2
     repository: https://charts.openshift.io/