Skip to content

Commit 85fe799

Browse files
authored
Add support for Helm charts from OCI registries (#834)
* Add support for Helm charts from OCI registries * Add information about Helm charts on OCI registries in documentation
1 parent 2a738c5 commit 85fe799

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/external_dependencies.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ Fetches helm charts and any specific subcharts in the `requirements.yaml` file.
176176
It defaults to the value of the `KAPITAN_HELM_PATH` environment var or simply to `helm` if neither is set.
177177
You should specify only if you don't want the default behavior.
178178

179+
`source` can be either the URL to a chart repository, or the URL to a chart on an OCI registry (supported since Helm 3.8.0).
180+
179181
### Usage
180182

181183
```yaml
@@ -184,7 +186,7 @@ parameters:
184186
dependencies:
185187
- type: helm
186188
output_path: path/to/chart
187-
source: http[s]://<helm_chart_repository_url>
189+
source: http[s]|oci://<helm_chart_repository_url>
188190
version: <specific chart version>
189191
chart_name: <name of chart>
190192
helm_path: <helm binary>

kapitan/dependency_manager/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,18 @@ def fetch_helm_archive(helm_path, repo, chart_name, version, save_path):
248248
logger.info("Dependency helm chart %s and version %s: fetching now", chart_name, version or "latest")
249249
# Fetch archive and untar it into parent dir
250250
save_dir = os.path.dirname(save_path)
251-
args = ["pull", "--destination", save_dir, "--untar", "--repo", repo]
251+
args = ["pull", "--destination", save_dir, "--untar"]
252252

253253
if version:
254254
args.append("--version")
255255
args.append(version)
256256

257-
args.append(chart_name)
257+
if repo.startswith("oci://"):
258+
args.append(repo)
259+
else:
260+
args.append("--repo")
261+
args.append(repo)
262+
args.append(chart_name)
258263

259264
response = helm_cli(helm_path, args)
260265
if response != "":

0 commit comments

Comments
 (0)