diff --git a/example-charts/use-yaml-file/Chart.yaml b/example-charts/use-yaml-file/Chart.yaml new file mode 100644 index 0000000..4d3a396 --- /dev/null +++ b/example-charts/use-yaml-file/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +name: no-values +description: A very simple chart that doesn't even need any values for customization +version: "0.2.0" +home: "https://github.com/norwoodj/helm-docs/tree/master/example-charts/no-values" +sources: ["https://github.com/norwoodj/helm-docs/tree/master/example-charts/no-values"] +engine: gotpl +maintainers: + - email: norwood.john.m@gmail.com + name: John Norwood diff --git a/example-charts/use-yaml-file/README.md b/example-charts/use-yaml-file/README.md new file mode 100644 index 0000000..3ae7819 --- /dev/null +++ b/example-charts/use-yaml-file/README.md @@ -0,0 +1,46 @@ +# no-values + +A very simple chart that doesn't even need any values for customization + +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) + +## Additional Information + +### Snapshot classes + +| name | resource group | incremental | +|----------|----------------|-------------| +| azure-incr | true | | +| azure | false | | +| local-incr | true | | +| local | false | | +| mask-data-incr | true | rg-mask-data | +| mask-data | false | rg-mask-data | + +### Default resources + +```yaml +requests: + cpu: 10m + memory: 100m +``` + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm repo add foo-bar http://charts.foo-bar.com +$ helm install my-release foo-bar/no-values +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| resources.requests.cpu | string | `"10m"` | | +| resources.requests.memory | string | `"100m"` | | +| volumeSnapshotClass.azure.parameters | object | `{}` | | +| volumeSnapshotClass.local.parameters | object | `{}` | | +| volumeSnapshotClass.mask-data.parameters.resourceGroup | string | `"rg-mask-data"` | | + diff --git a/example-charts/use-yaml-file/README.md.gotmpl b/example-charts/use-yaml-file/README.md.gotmpl new file mode 100644 index 0000000..9aaebc8 --- /dev/null +++ b/example-charts/use-yaml-file/README.md.gotmpl @@ -0,0 +1,39 @@ +{{ template "chart.header" . }} +{{ template "chart.description" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +## Additional Information + +{{ $values := (.Files.Get "values.yaml") | fromYaml }} + +### Snapshot classes + +| name | resource group | incremental | +|----------|----------------|-------------| +{{- range $name, $spec := $values.volumeSnapshotClass }} +{{- range $parameterIncr := list "true" "false" }} +| {{ $name }}{{- if eq $parameterIncr "true" -}}-incr{{- end }} | {{ $parameterIncr }} | {{ $spec.parameters.resourceGroup | default "" }} | +{{- end }} +{{- end }} + +### Default resources + +```yaml +{{ $values.resources | toYaml }} +``` + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm repo add foo-bar http://charts.foo-bar.com +$ helm install my-release foo-bar/{{ template "chart.name" . }} +``` + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/example-charts/use-yaml-file/values.yaml b/example-charts/use-yaml-file/values.yaml new file mode 100644 index 0000000..e17ab49 --- /dev/null +++ b/example-charts/use-yaml-file/values.yaml @@ -0,0 +1,15 @@ +volumeSnapshotClass: + azure: + parameters: {} + + local: + parameters: {} + + mask-data: + parameters: + resourceGroup: rg-mask-data + +resources: + requests: + cpu: 10m + memory: 100m diff --git a/go.mod b/go.mod index 29292cf..fe15035 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/norwoodj/helm-docs -go 1.22.0 +go 1.22 require ( github.com/Masterminds/sprig/v3 v3.2.3