carvel-dev / vendir

Easy way to vendor portions of git repos, github releases, helm charts, docker image contents, etc. declaratively
https://carvel.dev/vendir
Apache License 2.0
268 stars 46 forks source link

Problems to init a new package using our Helm repo (Azure Blob) #290

Closed angelhvargas closed 7 months ago

angelhvargas commented 9 months ago

What steps did you take:

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - helmChart:
      name: cert-exporter
      repository:
        url: https://testrepo.blob.core.windows.net/upstream/test-upstream?se=2023-09-21&sp=rl&sv=2022-11-02&sr=c&sig=4yFoaFcmE%2Be41E6jWgXAAAfwklbo06C0ydufiR6EEP%2BU%3D
      version: 3.0.1
    path: .
  path: upstream
kind: Config
minimumRequiredVersion: ""

After executing kctrl package init

[ALL THE kctrl INPUTS GOES HERE]
...

Next step is to run 'vendir sync' to fetch the data from the source to the local
directory.
Vendir will sync the data into the upstream folder.
Running vendir sync
        | $ vendir sync -f vendir.yml

kctrl: Error: Running vendir sync: vendir:
  Error:
    Syncing directory 'upstream':
  Syncing directory 'cert-exporter' with helm chart contents:
    Finding single helm chart:
      Expected single directory in charts directory, but was: [cert-exporter cert-exporter-3.0.1.tgz?se=2023-09-21&sp=rl&sv=2022-11-02&sr=c&sig=[SOME_SIGNATURE_HERE]]

What happened: The command vendir sync -f vendir.yml did not work with our private Helm repository (Azure Blob).

What did you expect:

See the command succeed

Output
Successfully updated package-build.yml
Successfully updated package-resources.yml

Next steps
Created files can be consumed in following ways:
1. `package release` command to release the package.
2. `package release --repo-output repo` to release the package and add it to the
package repository directory.

Anything else you would like to add: Probably because the repo it is in Azure blob?

Environment:

vendir version 0.34.4
MacOS 13.5.2 (22G91) Ventura

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote. 😄

👍 "I would like to see this addressed as soon as possible" 👍 😄 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

joaopapereira commented 9 months ago

Hey From the error and after diving into the code, it looks like that vendir only supports a single folder download for each chart. This looks like a safeguard added to ensure that when you use vendir to get a Chart, you only get a single Chart inside a single folder.

Is it possible that when you download using that URL, you get multiple files/folders?

angelhvargas commented 9 months ago

@joaopapereira I'm not sure why with the Helm client works just fine and with vendir does not,

In our storage account, the Blob has a index.yaml:

  certificate-manager:
  - apiVersion: v2
    created: "2023-01-13T15:09:29.998396143Z"
    description: A Helm chart for Generating Certificates
    digest: 845b7505c93146e9dc1e90446869cb935fbac919807fb6d6cd2885ee5b13e323
    name: certificate-manager
    type: application
    urls:
    - certificate-manager-1.0.7.tgz
    version: 1.0.7
  - apiVersion: v2
    created: "2023-01-12T16:18:04.215433537Z"
    description: A Helm chart for Generating Certificates
    digest: abce69a427805a7a8c568635602badcb8990368ba726655d1ab0c6eb3a592b1a
    name: certificate-manager
    type: application
    urls:
    - certificate-manager-1.0.7-dev.tgz
    version: 1.0.7-dev

This index.yaml as you can see has the information for each helm chart stored within that Azure blob, the files are all at the same dir level with unique names. Screenshot 2023-10-09 at 13 32 52

github-actions[bot] commented 7 months ago

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.