jenkins-x-plugins / jenkins-x-plugins/jx-gitops
Path naming issue in gitops helm mirror command
- Dominant language
- Go
- Stars
- 35
- Forks
- 53
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
During mirroring of Helm repositories based on charts/repositories.yml file the repositories listed in that file get downloaded into temporary directory.
Assuming that following entry is present in `repositories.yml` :
```yaml
repositories:
- prefix: banzaicloud-stable
urls:
- https://kubernetes-charts.banzaicloud.com
```
then this content would be mirrored into directories named:
`/gh-pages-tmp-/banzaicloud-stable/https:/kubernetes-charts.banzaicloud.com/charts/-.tgz`
Now locally this leads to directory structure which has folder named `https:` with further subfolders.
This seems incorrect to me because:
- If we want to mirror a repository, then I would expect the result also to be proper repository structure
- In `mirror.go` on line 206 in function `DownloadIndex` the name of the variable is `name` and not `url`, which kind of implies that the code writer was actually meaning to use a name and not an URL.
Expected behavior:
In this case I would expect the repository to be mirrored in following directory structure:
`/gh-pages-/banzaicloud-stable//-.tgz`
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect mirror.go around DownloadIndex, noted at line 206, and review the repositories.yml mirror input first. Run the gitops Helm mirror command and verify that the mirrored chart archive is placed under the repository prefix and chart name, without the source URL directories; the expected path is shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, helm
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100