diff --git a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml index 3c644c5684a..c636ea8d8bb 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml @@ -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/ diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/README.md b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/README.md new file mode 100644 index 00000000000..3da0c315c4e --- /dev/null +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/README.md @@ -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 /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:////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 +``` diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/bin/file.ps1 b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/bin/file.ps1 new file mode 100755 index 00000000000..9655e8b225d --- /dev/null +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/bin/file.ps1 @@ -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 diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/plugin.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/plugin.yaml new file mode 100644 index 00000000000..5e330d714ed --- /dev/null +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/file-plugin/plugin.yaml @@ -0,0 +1,7 @@ +name: file +version: 0.1 +description: Enables file:// protocol for helm repositories +downloaders: + - command: "bin/file.ps1" + protocols: + - "file"