Skip to content

Commit

Permalink
Add helm file plugin and local dependency chart usage readme (#3178)
Browse files Browse the repository at this point in the history
* Add helm file plugin and local dependency chart usage readme

* Revert stress infrastructure to use http repository reference

* Update tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/README.md

Co-authored-by: Albert Cheng <38804567+ckairen@users.noreply.github.com>

* Use 'git root' as placeholder path name

Co-authored-by: Albert Cheng <38804567+ckairen@users.noreply.github.com>
  • Loading branch information
benbp and ckairen authored Apr 20, 2022
1 parent 0ba69f8 commit 5ca493f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ dependencies:
repository: https://charts.chaos-mesh.org
condition: deploy.chaosmesh
- name: stress-test-addons
version: 0.1.12
version: 0.1.16
repository: https://stresstestcharts.blob.core.windows.net/helm/
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Simple helm plugin to enable the file protocol for `helm repo add file://` paths in order to simplify
local development of the stress-test-addon library chart with stress test charts that take it as a dependency.
Requires powershell core.

Example usage to override remove chart dependencies with a local version below.

For a helm chart with a named chart dependency `@stresstestcharts`:

```
$ tail Chart.yaml -n 3
- name: stress-test-addons
version: 0.1.16
repository: "@stresstestcharts"
```

Install named `stresstestcharts` repository from remote ur:

```
helm repo add stresstestcharts https://stresstestcharts.blob.core.windows.net/helm/
```

Install remote library chart from stresstestcharts repositor:

```
helm dependency update
```

Add file plugin to support `file://` repositories, this only has to be done once:

```
helm plugin add <git root>/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin
```

Use local version of named `stresstestcharts` library chart:

```
helm repo add --force-update stresstestcharts file:///<git root>/azure-sdk-tools/tools/stress-cluster/cluster/kubernetes/stress-test-addons
helm dependency update
```

Revert to remote version of library chart

```
helm repo add --force-update stresstestcharts https://stresstestcharts.blob.core.windows.net/helm/
helm dependency update
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env pwsh

# See https://helm.sh/docs/topics/plugins/#downloader-plugins
param(
[string]$certFile,
[string]$keyFile,
[string]$caFile,
[string]$url
)

$path = $url -replace "file://"
Get-Content "$path" -Raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: file
version: 0.1
description: Enables file:// protocol for helm repositories
downloaders:
- command: "bin/file.ps1"
protocols:
- "file"

0 comments on commit 5ca493f

Please sign in to comment.