Skip to content

Commit 3b1a31c

Browse files
committed
Update the HIP structure to follow the recommended template
Signed-off-by: Dominykas Blyžė <[email protected]>
1 parent 26b5b57 commit 3b1a31c

File tree

1 file changed

+50
-43
lines changed

1 file changed

+50
-43
lines changed

hips/hip-00NN.md

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,88 @@
11
---
22
hip: "00NN"
3-
title: "Helm repo support Git protocol"
4-
authors: [ "yxxhero <[email protected]>" ]
3+
title: "Support Git protocol for installing chart dependencies"
4+
authors: [ "yxxhero <[email protected]>", "Dominykas Blyžė <[email protected]>" ]
55
created: "2021-10-05"
66
type: "feature"
77
status: "draft"
88
---
99

1010
## Abstract
1111

12-
This document describes the introduction of git protocol for helm charts.
12+
Currently, Helm supports installing dependencies from various registries, however that requires the charts to be published there. There are use cases which are cumbersome when registries are involved, for example:
1313

14-
## Audience
14+
- private charts for organizations/individuals who do not have the capacity to maintain the infrastructure required to run a private registry
15+
- testing work-in-progress charts in their umbrella charts
1516

16-
Using a git URL as a repository in requirements.yaml will be a nice-to-have feature for organizations that house their helm charts in a git repository and would like to maintain private access to those charts.
17+
## Motivation
1718

18-
The format supported is:
19+
There are existing ways to achieve installation of charts without using a registry, however they are not very user-friendly and require additional tooling.
20+
21+
- A Helm chart repository is effectively an `index.yaml` with links to downloads. Maintaining such a repository does create a burden of scripts and automation (e.g. Github Actions). This is not always feasible for smaller projects. It also does not really offer an obvious and readily available way of testing pre-releases.
22+
- For the testing use cases, charts can be packaged using `helm package`, however this does introduce manual steps and requires extra work to replicate in CI/CD scenarios.
23+
- There is a [`aslafy-z/helm-git`](https://github.com/aslafy-z/helm-git) plugin available, however using plugins requires additional setup, which may not always be feasible (esp. in more complex team structures and cluster setups with advanced tooling, e.g. ArgoCD). An additional drawback is that the `Chart.yaml` does not provide a way to specify the plugin requirements.
24+
25+
Installing dependencies from git is an established pattern in other ecosystems even when they are registry-based, e.g. npm (Node.js), pipenv (Python), bundler (Gem) have this option - it would make sense to have the behavior replicated in Helm.
26+
27+
## Rationale
28+
29+
(TBD)
30+
31+
## Specification
32+
33+
The `Chart.yaml` should support the following format for `dependencies`:
1934

2035
```
2136
dependencies:
22-
- name: "{dependency name}"
23-
repository: "git://{git repo url}"
24-
version: "{git ref name}"
37+
- name: "<dependency name>"
38+
repository: "<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>"
39+
version: "<commit-ish>"
2540
```
2641
where:
27-
{git repo url} is any url type that a git clone ... command would accept (an ssh location, an https url, etc.).
28-
{git ref name} is an existing tag or branch name on the repo (a commit sha cannot be used at this time)
42+
- `<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or `git+file`.
43+
- `<commit-ish>` is an existing reference (SHA hash, tag or branch name) on the repo.
44+
2945
For example:
3046

3147
```
3248
dependencies:
33-
- name: "a"
34-
repository: "git://https://github.com/rally25rs/helm-test-chart.git"
35-
version: "master"
49+
- name: "jenkins"
50+
repository: "git+https://github.com/jenkinsci/helm-charts.git/charts/jenkins"
51+
version: "main"
3652
```
3753

38-
## Rationale
54+
## Backwards compatibility
3955

40-
What it basically does is, if it find a registry that starts with `git://` then:
41-
* create a temp directory.
42-
* Using `github.com/Masterminds/vcs` to fetch the repo at the specified branch/tag into the temp dir
43-
* Treat the cloned git repo similar to a file:///path/to/temp/dir style requirement; use chart.LoadDir to load that directory (which in turn applied the logic for filtering the files through .helmignore) and archives it to charts/
44-
* Delete the temp dir.
56+
This is backwards compatible from Helm perspective - the existing formats for `dependencies` are still supported.
4557

46-
### Caveats / Known Limitations
47-
* Since this spawns git as a child process, git has to be available on the system and in the path.
48-
* There is currently no handling for forwarding stdin to the git child process, so if git asks for input, helm will likely appear to hang as git tries to prompt for input. It will cause an issue if you are trying to reference a private repo with an SSL cert that needs a password, or with an https url that requires username/password authentication. (yarn package manager, ansible, and other tools have this same issue).
58+
Charts that start using the new format will effectively be changing their minimum required Helm version, i.e. they would be introducing breaking changes and should bump their major version.
4959

50-
## Specification
51-
The specification for this HIP is broken into two (3) major sections:
60+
## Security implications
5261

53-
* Implement Getter
54-
* Definition and identification of GIT protocol format
55-
* As an experimental characteristic
62+
(TBD)
5663

57-
For example:
64+
## How to teach this
5865

59-
```
60-
dependencies:
61-
- name: "a"
62-
repository: "git://https://github.com/rally25rs/helm-test-chart.git"
63-
version: "master"
64-
```
65-
66-
## Backwards compatibility
67-
Experimental state, no affect other logic.
66+
(TBD)
6867

68+
## Reference implementation
6969

70-
## Reference implementation
71-
* [https://github.com/helm/helm/pull/9482](https://github.com/helm/helm/pull/9482)
70+
Multiple implementation attempts available for [a discarded earlier draft of a related HIP](https://github.com/helm/community/pull/214):
7271

72+
- [helm/helm#11258](https://github.com/helm/helm/pull/11258)
73+
- [helm/helm#9482](https://github.com/helm/helm/pull/9482)
74+
- [helm/helm#6734](https://github.com/helm/helm/pull/6734)
7375

74-
## Open issues
75-
The issues below are still unresolved.
76-
* [https://github.com/helm/helm/issues/9461](https://github.com/helm/helm/issues/9461)
76+
## Rejected ideas
7777

78+
- An [earlier draft for solving the issue](https://github.com/helm/community/pull/214) suggested using URLs like `git://https://...`. There were comments about that approach in the reference implementations, with the suggestion to use the conventions which are already established in other ecosystems.
7879

80+
## Open issues
7981

82+
N/A
8083

84+
## References
8185

86+
- [`npm install` documentation](https://docs.npmjs.com/cli/v10/commands/npm-install) (covers the `git+[protocol]` format)
87+
- [Python packaging documentation on version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/) (covers the `VCS+protocol` format)
88+
- [bundler documentation on installing gems from git repositories](https://bundler.io/guides/git.html)

0 commit comments

Comments
 (0)