commit helm-docs for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package helm-docs for openSUSE:Factory checked in at 2022-06-29 16:01:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/helm-docs (Old) and /work/SRC/openSUSE:Factory/.helm-docs.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "helm-docs" Wed Jun 29 16:01:54 2022 rev:5 rq:985776 version:1.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/helm-docs/helm-docs.changes 2022-05-14 22:58:45.919486079 +0200 +++ /work/SRC/openSUSE:Factory/.helm-docs.new.1548/helm-docs.changes 2022-06-29 16:03:16.892776309 +0200 @@ -1,0 +2,15 @@ +Wed Jun 29 11:19:32 UTC 2022 - kastl@b1-systems.de + +- Update to version 1.11.0: + * fix: fixes file operations to work when not running from the chart root and fixes several tests + * adding ignore-non-descriptions flag + * fix broken file sorting + * Add an option to list charts to generate + * Added file lazy loading + * Improve code according to mjpitz suggestions + * Rename @section to @raw + * Add option for ignoring values + * chore: generate READMEs for example charts with new version + * Added Helm .Files + +------------------------------------------------------------------- Old: ---- helm-docs-1.10.0.tar.gz New: ---- helm-docs-1.11.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ helm-docs.spec ++++++ --- /var/tmp/diff_new_pack.UVhKTj/_old 2022-06-29 16:03:17.364776938 +0200 +++ /var/tmp/diff_new_pack.UVhKTj/_new 2022-06-29 16:03:17.368776943 +0200 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: helm-docs -Version: 1.10.0 +Version: 1.11.0 Release: 0 Summary: A tool for automatically generating markdown documentation for helm charts License: GPL-3.0-only ++++++ _service ++++++ --- /var/tmp/diff_new_pack.UVhKTj/_old 2022-06-29 16:03:17.404776992 +0200 +++ /var/tmp/diff_new_pack.UVhKTj/_new 2022-06-29 16:03:17.408776997 +0200 @@ -3,11 +3,11 @@ <param name="url">https://github.com/norwoodj/helm-docs</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v1.10.0</param> + <param name="revision">v1.11.0</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="match-tag">v1.10.0</param> + <param name="match-tag">v1.11.0</param> </service> <service name="set_version" mode="disabled"> <param name="basename">helm-docs</param> @@ -17,7 +17,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">helm-docs-1.10.0.tar.gz</param> + <param name="archive">helm-docs-1.11.0.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.UVhKTj/_old 2022-06-29 16:03:17.428777024 +0200 +++ /var/tmp/diff_new_pack.UVhKTj/_new 2022-06-29 16:03:17.432777029 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/norwoodj/helm-docs</param> - <param name="changesrevision">93aef0bae5fb78889f8faf21542bc50df47f93d2</param></service></servicedata> + <param name="changesrevision">45f63df3a13c43bdcb30c26a58eeac40fcf87dab</param></service></servicedata> (No newline at EOF) ++++++ helm-docs-1.10.0.tar.gz -> helm-docs-1.11.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/README.md new/helm-docs-1.11.0/README.md --- old/helm-docs-1.10.0/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -128,6 +128,15 @@ many charts can be ignored and none of the charts underneath them will be processed. You may also directly reference the Chart.yaml file for a chart to skip processing for it. +## Generating Doc with Dependency values +Umbrella Helm chart documentation can include dependency values with `document-dependency-values` flag. +All dependency values will be merged into values of umbrella chart documentation. + +If you want to include dependency values, but don't want to generate doc for each dependency: +* set `chart-search-root` parameter to directory that contains umbrella chart and all dependency charts. +* list all charts you want to generate doc using `chart-to-generate` flag +* set `document-dependency-values` flag to true + ## Markdown Rendering There are two important parameters to be aware of when running helm-docs. `--chart-search-root` specifies the directory under which the tool will recursively search for charts to render documentation for. `--template-files` specifies the list @@ -206,7 +215,7 @@ ### values.yaml metadata This tool can parse descriptions and defaults of values from `values.yaml` files. The defaults are pulled directly from -the yaml in the file. +the yaml in the file. It was formerly the case that descriptions had to be specified with the full path of the yaml field. This is no longer the case, although it is still supported. Where before you would document a values.yaml like so: @@ -299,7 +308,7 @@ controller: # -- (int) Number of nginx-ingress pods to load balance between replicas: - + # controller.image -- (string) Number of nginx-ingress pods to load balance between image: ``` @@ -321,6 +330,14 @@ the description for the field. The `@default` comment must follow. See [here](./example-charts/custom-template/values.yaml) for an example. +### Ignoring values +In cases you would like to ignore certain values, you can mark it with @ignored tag: + +```yaml +# @ignored +service: + port: 8080 +``` ### Spaces and Dots in keys In the old-style comment, if a key name contains any "." or " " characters, that section of the path must be quoted in @@ -338,10 +355,10 @@ ``` ### Advanced table rendering -Some helm chart `values.yaml` uses complicated structure for the key/value -pairs. For example, it may uses a multiline string of Go template text instead -of plain strings. Some values might also refer to a certain YAML/JSON object -structure, like internal k8s value type, or an enum. For these use case, +Some helm chart `values.yaml` uses complicated structure for the key/value +pairs. For example, it may uses a multiline string of Go template text instead +of plain strings. Some values might also refer to a certain YAML/JSON object +structure, like internal k8s value type, or an enum. For these use case, a standard markdown table format might be inadequate and you want to use HTML tags to render the table. @@ -358,32 +375,32 @@ 1. Use the HTML value renderer instead of the default markdown format You can use `chart.valuesSectionHtml` to render the values table as HTML tags, -instead of using `chart.valuesSection`. Using HTML tables provides more -flexibility because it can be processed by markdown viewer as a nested blocks, -instead of one row per line. This allows you to customize how each columns in a +instead of using `chart.valuesSection`. Using HTML tables provides more +flexibility because it can be processed by markdown viewer as a nested blocks, +instead of one row per line. This allows you to customize how each columns in a row are rendered. 2. Overriding built-in templates You can always overrides or redefine built-in templates in your own `_templates. -gotmpl` file. The built-in templates can be thought of as a template hook. -For example, if you need to change the HTML table, for example to add a new +gotmpl` file. The built-in templates can be thought of as a template hook. +For example, if you need to change the HTML table, for example to add a new column, or define maximum width/height, you can override `chart.valuesTableHtml`. Your overrides will then be called by `chart.valuesSectionHtml`. -You can add your own rendering logic for each column. For example, we have `chart.valueDefaultColumnRender` that is used to render "default value" column for each rows. If you want to override how helm-docs render the +You can add your own rendering logic for each column. For example, we have `chart.valueDefaultColumnRender` that is used to render "default value" column for each rows. If you want to override how helm-docs render the "type" column, just define your own rendering template and call it from `chart.valuesTableHtml` for each of the rows. 3. Using the metadata of each rows of values -Custom styling and rendering can be done as flexible as you want, but you -still need a metadata that describes each rows of values. You can access +Custom styling and rendering can be done as flexible as you want, but you +still need a metadata that describes each rows of values. You can access this information from the templates. -When you override `chart.valuesTableHtml`, as you can see in the original +When you override `chart.valuesTableHtml`, as you can see in the original definition in `func getValuesTableTemplates()` [pkg/document/template.go](pkg/document/template.go), we iterates each row of values. For each "Value", it is modeled as a struct defined in `valueRow` struct -in [pkg/document/model.go](pkg/document/model.go). You can then use the +in [pkg/document/model.go](pkg/document/model.go). You can then use the fields in your template. Some fields here are directly referenced from `values.yaml`: @@ -398,19 +415,19 @@ 4. Use markdown files generated by helm-docs as intermediary files to be processed further -Public helm charts sometimes needs to be published as static content -instead of just stored in a repository. This is needed for helm users to +Public helm charts sometimes needs to be published as static content +instead of just stored in a repository. This is needed for helm users to be able to view or browse the chart options and dependencies. -It is often more than enough to just browse the chart values options on -git hosting that is able to render markdown files as a nice HTML page, like GitHub or GitLab. -However, for a certain use case, you may want to use your own +It is often more than enough to just browse the chart values options on +git hosting that is able to render markdown files as a nice HTML page, like GitHub or GitLab. +However, for a certain use case, you may want to use your own documentation generator to host or publish the output of helm-docs. -If you use some kind of Jamstack like Gatsby or Hugo, you can use the -output of helm-docs as an input for these doc generator. A typical use -case is to override helm-docs built-in template so that it renders a -markdown or markdownX files to be processed by Gatsby or Hugo into +If you use some kind of Jamstack like Gatsby or Hugo, you can use the +output of helm-docs as an input for these doc generator. A typical use +case is to override helm-docs built-in template so that it renders a +markdown or markdownX files to be processed by Gatsby or Hugo into a static Web/Javascript page. -For a more concrete examples on how to do these custom rendering, see [example here](./example-charts/custom-value-notation-type/README.md) \ No newline at end of file +For a more concrete examples on how to do these custom rendering, see [example here](./example-charts/custom-value-notation-type/README.md) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/cmd/helm-docs/command_line.go new/helm-docs-1.11.0/cmd/helm-docs/command_line.go --- old/helm-docs-1.10.0/cmd/helm-docs/command_line.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/cmd/helm-docs/command_line.go 2022-06-29 12:28:58.000000000 +0200 @@ -46,6 +46,7 @@ logLevelUsage := fmt.Sprintf("Level of logs that should printed, one of (%s)", strings.Join(possibleLogLevels(), ", ")) command.PersistentFlags().StringP("chart-search-root", "c", ".", "directory to search recursively within for charts") command.PersistentFlags().BoolP("dry-run", "d", false, "don't actually render any markdown files just print to stdout passed") + command.PersistentFlags().Bool("ignore-non-descriptions", false, "ignore values without a comment, this values will not be included in the README") command.PersistentFlags().StringP("ignore-file", "i", ".helmdocsignore", "The filename to use as an ignore file to exclude chart directories") command.PersistentFlags().StringP("log-level", "l", "info", logLevelUsage) command.PersistentFlags().StringP("output-file", "o", "README.md", "markdown file path relative to each chart directory to which rendered documentation will be written") @@ -54,6 +55,7 @@ command.PersistentFlags().StringP("badge-style", "b", "flat-square", "badge style to use for charts") command.PersistentFlags().StringP("values-file", "f", "values.yaml", "Path to values file") command.PersistentFlags().BoolP("document-dependency-values", "u", false, "For charts with dependencies, include the dependency values in the chart values documentation") + command.PersistentFlags().StringSliceP("chart-to-generate", "g", []string{}, "List of charts that will have documentation generated. Comma separated, no space. Empty list - generate for all charts in chart-search-root") viper.AutomaticEnv() viper.SetEnvPrefix("HELM_DOCS") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/cmd/helm-docs/main.go new/helm-docs-1.11.0/cmd/helm-docs/main.go --- old/helm-docs-1.10.0/cmd/helm-docs/main.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/cmd/helm-docs/main.go 2022-06-29 12:28:58.000000000 +0200 @@ -95,6 +95,31 @@ return documentationInfoByChartPath, nil } +func getChartToGenerate(documentationInfoByChartPath map[string]helm.ChartDocumentationInfo) map[string]helm.ChartDocumentationInfo { + generateDirectories := viper.GetStringSlice("chart-to-generate") + if len(generateDirectories) == 0 { + return documentationInfoByChartPath + } + documentationInfoToGenerate := make(map[string]helm.ChartDocumentationInfo, len(generateDirectories)) + var skipped = false + for _, chartDirectory := range generateDirectories { + if info, ok := documentationInfoByChartPath[chartDirectory]; ok { + documentationInfoToGenerate[chartDirectory] = info + } else { + log.Warnf("Couldn't find documentation Info for <%s> - skipping", chartDirectory) + skipped = true + } + } + if skipped { + possibleCharts := []string{} + for path := range documentationInfoByChartPath { + possibleCharts = append(possibleCharts, path) + } + log.Warnf("Some charts listed in `chart-to-generate` wasn't found. List of charts to choose: [%s]", strings.Join(possibleCharts, ", ")) + } + return documentationInfoToGenerate +} + func writeDocumentation(chartSearchRoot string, documentationInfoByChartPath map[string]helm.ChartDocumentationInfo, dryRun bool, parallelism int) { templateFiles := viper.GetStringSlice("template-files") badgeStyle := viper.GetString("badge-style") @@ -102,8 +127,9 @@ log.Debugf("Rendering from optional template files [%s]", strings.Join(templateFiles, ", ")) documentDependencyValues := viper.GetBool("document-dependency-values") + documentationInfoToGenerate := getChartToGenerate(documentationInfoByChartPath) - parallelProcessIterable(documentationInfoByChartPath, parallelism, func(elem interface{}) { + parallelProcessIterable(documentationInfoToGenerate, parallelism, func(elem interface{}) { info := documentationInfoByChartPath[elem.(string)] var err error var dependencyValues []document.DependencyValues diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/best-values-example/README.md new/helm-docs-1.11.0/example-charts/best-values-example/README.md --- old/helm-docs-1.10.0/example-charts/best-values-example/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/best-values-example/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -31,4 +31,4 @@ | statefulset.podLabels | object | `{}` | The labels to be applied to instances of the database | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/custom-template/README.md new/helm-docs-1.11.0/example-charts/custom-template/README.md --- old/helm-docs-1.10.0/example-charts/custom-template/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/custom-template/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -59,4 +59,4 @@ | controller.service.type | string | `"LoadBalancer"` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/custom-value-notation-type/README.md new/helm-docs-1.11.0/example-charts/custom-value-notation-type/README.md --- old/helm-docs-1.10.0/example-charts/custom-value-notation-type/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/custom-value-notation-type/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -103,7 +103,7 @@ If you view this README.md files in GitHub and click the value's key, you will be directed to the key location in the `values.yaml` file. -You can also render a raw string into the comments using `@section` annotations. +You can also render a raw string into the comments using `@raw` annotations. You can jump to [sampleYaml](#sampleYaml) key and check it's description where it uses HTML `<summary>` tag to collapse some part of the comments. @@ -996,7 +996,7 @@ Sometimes you need a very long description for your values. -Any comment section for a given key with **@section** attribute +Any comment section for a given key with **@raw** attribute will be treated as raw string and stored as is. Since it generates in Markdown format, you can do something like this: @@ -1104,3 +1104,5 @@ </tbody> </table> +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/custom-value-notation-type/README.md.gotmpl new/helm-docs-1.11.0/example-charts/custom-value-notation-type/README.md.gotmpl --- old/helm-docs-1.10.0/example-charts/custom-value-notation-type/README.md.gotmpl 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/custom-value-notation-type/README.md.gotmpl 2022-06-29 12:28:58.000000000 +0200 @@ -97,7 +97,7 @@ If you view this README.md files in GitHub and click the value's key, you will be directed to the key location in the `values.yaml` file. -You can also render a raw string into the comments using `@section` annotations. +You can also render a raw string into the comments using `@raw` annotations. You can jump to [sampleYaml](#sampleYaml) key and check it's description where it uses HTML `<summary>` tag to collapse some part of the comments. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/custom-value-notation-type/values.yaml new/helm-docs-1.11.0/example-charts/custom-value-notation-type/values.yaml --- old/helm-docs-1.10.0/example-charts/custom-value-notation-type/values.yaml 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/custom-value-notation-type/values.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -201,11 +201,11 @@ # -- (dict) Values with long description -# @section +# @raw # Sometimes you need a very long description # for your values. # -# Any comment section for a given key with **@section** attribute +# Any comment section for a given key with **@raw** attribute # will be treated as raw string and stored as is. # Since it generates in Markdown format, you can do something like this: # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/dos-line-endings/README.md new/helm-docs-1.11.0/example-charts/dos-line-endings/README.md --- old/helm-docs-1.10.0/example-charts/dos-line-endings/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/dos-line-endings/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -14,4 +14,4 @@ | livenessProbe.httpGet.port | string | `"http"` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/Chart.yaml new/helm-docs-1.11.0/example-charts/files-values/Chart.yaml --- old/helm-docs-1.10.0/example-charts/files-values/Chart.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/Chart.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,11 @@ +apiVersion: v2 +name: best-values-example +description: One of the best values parsing example charts here, exhibits several more complicated examples +version: "0.2.0" +home: "https://github.com/norwoodj/helm-docs/tree/master/example-charts/best-values..." +sources: ["https://github.com/norwoodj/helm-docs/tree/master/example-charts/best-values..."] +engine: gotpl +type: application +maintainers: + - email: norwood.john.m@gmail.com + name: John Norwood diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/README.md new/helm-docs-1.11.0/example-charts/files-values/README.md --- old/helm-docs-1.10.0/example-charts/files-values/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,60 @@ +# best-values-example + +One of the best values parsing example charts here, exhibits several more complicated examples + +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-squar...) + +## Additional Information + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore +et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut +aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. + +## 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/best-values-example +``` + +Some file contents: + +``` +some: + data: "test" +``` + +Glob contents as config map: + +``` +apiVersion: v1 +kind: ConfigMap +metadata: + name: test +data: + resource1.yaml: |- + some: + resource: "blah" + resource2.yaml: |- + some: + resource: "blah2" +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| config.databasesToCreate[0] | string | `"postgresql"` | default database for storage of database metadata | +| config.databasesToCreate[1] | string | `"hashbash"` | database for the [hashbash](https://github.com/norwoodj/hashbash) project | +| config.usersToCreate[0] | object | `{"admin":true,"name":"root"}` | admin user | +| config.usersToCreate[1] | object | `{"name":"hashbash","readwriteDatabases":["hashbash"]}` | user with access to the database with the same name | +| statefulset.extraVolumes | list | `[{"emptyDir":{},"name":"data"}]` | Additional volumes to be mounted into the database container | +| statefulset.image.repository | string | `"jnorwood/postgresq"` | Image to use for deploying, must support an entrypoint which creates users/databases from appropriate config files | +| statefulset.image.tag | string | `"11"` | | +| statefulset.livenessProbe | object | `{"enabled":false}` | Configure the healthcheck for the database | +| statefulset.podLabels | object | `{}` | The labels to be applied to instances of the database | + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/README.md.gotmpl new/helm-docs-1.11.0/example-charts/files-values/README.md.gotmpl --- old/helm-docs-1.10.0/example-charts/files-values/README.md.gotmpl 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/README.md.gotmpl 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,46 @@ +{{ template "chart.header" . }} +{{ template "chart.description" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +## Additional Information + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore +et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut +aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. + +## 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" . }} +``` + +Some file contents: + +``` +{{ .Files.Get "somefile.yaml" }} +``` + +Glob contents as config map: + +``` +apiVersion: v1 +kind: ConfigMap +metadata: + name: test +data: +{{ (.Files.Glob "templates/**.yaml").AsConfig | indent 2 }} +dataSecret: +{{ (.Files.Glob "templates/**.yaml").AsSecrets | indent 2 }} +``` + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/somefile.yaml new/helm-docs-1.11.0/example-charts/files-values/somefile.yaml --- old/helm-docs-1.10.0/example-charts/files-values/somefile.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/somefile.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,2 @@ +some: + data: "test" \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/templates/resource1.yaml new/helm-docs-1.11.0/example-charts/files-values/templates/resource1.yaml --- old/helm-docs-1.10.0/example-charts/files-values/templates/resource1.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/templates/resource1.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,2 @@ +some: + resource: "blah" \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/templates/resource2.yaml new/helm-docs-1.11.0/example-charts/files-values/templates/resource2.yaml --- old/helm-docs-1.10.0/example-charts/files-values/templates/resource2.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/templates/resource2.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,2 @@ +some: + resource: "blah2" \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/files-values/values.yaml new/helm-docs-1.11.0/example-charts/files-values/values.yaml --- old/helm-docs-1.10.0/example-charts/files-values/values.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/files-values/values.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,32 @@ +statefulset: + image: + # -- Image to use for deploying, must support an entrypoint which creates users/databases from appropriate config files + repository: jnorwood/postgresq + tag: "11" + + # -- Additional volumes to be mounted into the database container + extraVolumes: + - name: data + emptyDir: {} + + # -- Configure the healthcheck for the database + livenessProbe: + enabled: false + + # -- The labels to be applied to instances of the database + podLabels: {} + +config: + databasesToCreate: + # -- default database for storage of database metadata + - postgresql + + # -- database for the [hashbash](https://github.com/norwoodj/hashbash) project + - hashbash + + usersToCreate: + # -- admin user + - {name: root, admin: true} + + # -- user with access to the database with the same name + - {name: hashbash, readwriteDatabases: [hashbash]} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/full-template/README.md new/helm-docs-1.11.0/example-charts/full-template/README.md --- old/helm-docs-1.10.0/example-charts/full-template/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/full-template/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -163,4 +163,4 @@ | controller.service.type | string | `"LoadBalancer"` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/funky-version/README.md new/helm-docs-1.11.0/example-charts/funky-version/README.md --- old/helm-docs-1.10.0/example-charts/funky-version/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/funky-version/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -17,4 +17,4 @@ * <https://github.com/norwoodj/helm-docs/tree/master/example-charts/funky-version> ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/helm-3/README.md new/helm-docs-1.11.0/example-charts/helm-3/README.md --- old/helm-docs-1.10.0/example-charts/helm-3/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/helm-3/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -41,4 +41,4 @@ | controller.service.type | string | `"LoadBalancer"` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/ignored-values-example/Chart.yaml new/helm-docs-1.11.0/example-charts/ignored-values-example/Chart.yaml --- old/helm-docs-1.10.0/example-charts/ignored-values-example/Chart.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/ignored-values-example/Chart.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,11 @@ +apiVersion: v2 +name: ignored-values-example +description: Based on best-values-example +version: "0.1.0" +home: "https://github.com/norwoodj/helm-docs/tree/master/example-charts/ignored-val..." +sources: ["https://github.com/norwoodj/helm-docs/tree/master/example-charts/ignored-val..."] +engine: gotpl +type: application +maintainers: + - email: jakub.buczak@gmail.com + name: Jakub Buczak diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/ignored-values-example/README.md new/helm-docs-1.11.0/example-charts/ignored-values-example/README.md --- old/helm-docs-1.10.0/example-charts/ignored-values-example/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/ignored-values-example/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,35 @@ +# ignored-values-example + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-squar...) + +Based on best-values-example + +**Homepage:** <https://github.com/norwoodj/helm-docs/tree/master/example-charts/ignored-values-example> + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Jakub Buczak | <jakub.buczak@gmail.com> | | + +## Source Code + +* <https://github.com/norwoodj/helm-docs/tree/master/example-charts/ignored-values-example> + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| config.databasesToCreate[0] | string | `"postgresql"` | default database for storage of database metadata | +| config.databasesToCreate[1] | string | `"hashbash"` | database for the [hashbash](https://github.com/norwoodj/hashbash) project | +| config.usersToCreate[0] | object | `{"admin":true,"name":"root"}` | admin user | +| config.usersToCreate[1] | object | `{"name":"hashbash","readwriteDatabases":["hashbash"]}` | user with access to the database with the same name | +| configWithAllValuesIgnored | object | `{}` | | +| statefulset.extraVolumes | list | `[{"emptyDir":{},"name":"data"}]` | Additional volumes to be mounted into the database container | +| statefulset.image.repository | string | `"jnorwood/postgresq"` | Image to use for deploying, must support an entrypoint which creates users/databases from appropriate config files | +| statefulset.image.tag | string | `"11"` | | +| statefulset.livenessProbe | object | `{"enabled":false}` | Configure the healthcheck for the database | +| statefulset.podLabels | object | `{}` | The labels to be applied to instances of the database | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/ignored-values-example/values.yaml new/helm-docs-1.11.0/example-charts/ignored-values-example/values.yaml --- old/helm-docs-1.10.0/example-charts/ignored-values-example/values.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/example-charts/ignored-values-example/values.yaml 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,51 @@ +statefulset: + image: + # -- Image to use for deploying, must support an entrypoint + # which creates users/databases from appropriate config files + repository: jnorwood/postgresq + tag: "11" + + # -- Additional volumes to be mounted into the database container + extraVolumes: + - name: data + emptyDir: {} + + # -- Configure the healthcheck for the database + livenessProbe: + enabled: false + + # -- The labels to be applied to instances of the database + podLabels: {} + +config: + databasesToCreate: + # -- default database for storage of database metadata + - postgresql + + # -- database for the [hashbash](https://github.com/norwoodj/hashbash) project + - hashbash + + usersToCreate: + # -- admin user + - {name: root, admin: true} + + # -- user with access to the database with the same name + - {name: hashbash, readwriteDatabases: [hashbash]} + + # @ignore test + - {name: test, readDatabases: [test]} + +# @ignore +internalConfig: + rpcPort: 8080 + # -- this should also be ignored + generateData: true + +# @ignore +ignoredConfig: 6 + +configWithAllValuesIgnored: + # @ignore + ignoredOne: true + # @ignore + ignoredTwo: "?" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/most-empty/README.md new/helm-docs-1.11.0/example-charts/most-empty/README.md --- old/helm-docs-1.10.0/example-charts/most-empty/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/most-empty/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -21,4 +21,4 @@ ``` ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/nginx-ingress/README.md new/helm-docs-1.11.0/example-charts/nginx-ingress/README.md --- old/helm-docs-1.10.0/example-charts/nginx-ingress/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/nginx-ingress/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -41,4 +41,4 @@ | controller.service.type | string | `"LoadBalancer"` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/nginx-ingress-but-auto-comments/README.md new/helm-docs-1.11.0/example-charts/nginx-ingress-but-auto-comments/README.md --- old/helm-docs-1.10.0/example-charts/nginx-ingress-but-auto-comments/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/nginx-ingress-but-auto-comments/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -41,4 +41,4 @@ | controller.service.type | string | `"LoadBalancer"` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/no-requirements/README.md new/helm-docs-1.11.0/example-charts/no-requirements/README.md --- old/helm-docs-1.10.0/example-charts/no-requirements/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/no-requirements/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -26,4 +26,4 @@ | rules.statusCodes.codes.5xx.threshold | float | `1.5` | Threshold percentage of 5xx responses above which the alert will fire | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/no-values/README.md new/helm-docs-1.11.0/example-charts/no-values/README.md --- old/helm-docs-1.10.0/example-charts/no-values/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/no-values/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -17,4 +17,4 @@ * <https://github.com/norwoodj/helm-docs/tree/master/example-charts/no-values> ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/special-characters/README.md new/helm-docs-1.11.0/example-charts/special-characters/README.md --- old/helm-docs-1.10.0/example-charts/special-characters/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/special-characters/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -27,4 +27,4 @@ | htmlSnippets.two | string | `""` | Let's put it in the description <html></html> | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/special-characters-but-auto-comments/README.md new/helm-docs-1.11.0/example-charts/special-characters-but-auto-comments/README.md --- old/helm-docs-1.10.0/example-charts/special-characters-but-auto-comments/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/special-characters-but-auto-comments/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -27,4 +27,4 @@ | htmlSnippets.two | string | `""` | Let's put it in the description <html></html> | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/umbrella/README.md new/helm-docs-1.11.0/example-charts/umbrella/README.md --- old/helm-docs-1.10.0/example-charts/umbrella/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/umbrella/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -25,4 +25,4 @@ | sub-b.mySubKeyB | string | `"my-sub-value-b"` | Value for sub-chart B | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/umbrella/charts/sub-a/README.md new/helm-docs-1.11.0/example-charts/umbrella/charts/sub-a/README.md --- old/helm-docs-1.10.0/example-charts/umbrella/charts/sub-a/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/umbrella/charts/sub-a/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -19,4 +19,4 @@ | mySubKeyA | string | `"my-sub-value-a"` | Value for sub-chart A | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/umbrella/charts/sub-b/README.md new/helm-docs-1.11.0/example-charts/umbrella/charts/sub-b/README.md --- old/helm-docs-1.10.0/example-charts/umbrella/charts/sub-b/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/umbrella/charts/sub-b/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -18,4 +18,4 @@ | mySubKeyB | string | `"my-sub-value-b"` | Value for sub-chart B | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/example-charts/umbrella/charts/sub-c/README.md new/helm-docs-1.11.0/example-charts/umbrella/charts/sub-c/README.md --- old/helm-docs-1.10.0/example-charts/umbrella/charts/sub-c/README.md 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/example-charts/umbrella/charts/sub-c/README.md 2022-06-29 12:28:58.000000000 +0200 @@ -17,4 +17,4 @@ | global | object | `{}` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) +Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/go.mod new/helm-docs-1.11.0/go.mod --- old/helm-docs-1.10.0/go.mod 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/go.mod 2022-06-29 12:28:58.000000000 +0200 @@ -4,6 +4,7 @@ require ( github.com/Masterminds/sprig/v3 v3.2.2 + github.com/gobwas/glob v0.2.3 github.com/sirupsen/logrus v1.2.0 github.com/spf13/cobra v0.0.5 github.com/spf13/viper v1.4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/go.sum new/helm-docs-1.11.0/go.sum --- old/helm-docs-1.10.0/go.sum 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/go.sum 2022-06-29 12:28:58.000000000 +0200 @@ -34,6 +34,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/document/files.go new/helm-docs-1.11.0/pkg/document/files.go --- old/helm-docs-1.10.0/pkg/document/files.go 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/pkg/document/files.go 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,144 @@ +package document + +import ( + "encoding/base64" + "io/ioutil" + "os" + "path" + "path/filepath" + "strings" + + "github.com/gobwas/glob" + log "github.com/sirupsen/logrus" + "gopkg.in/yaml.v3" +) + +type files struct { + baseDir string + foundFiles map[string]*fileEntry +} + +type fileEntry struct { + Path string + data []byte +} + +func getFiles(dir string) (files, error) { + result := files{ + baseDir: dir, + foundFiles: make(map[string]*fileEntry), + } + + err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if info.IsDir() { + return nil + } + + result.foundFiles[path] = &fileEntry{Path: path} + return nil + }) + + if err != nil { + return files{}, err + } + + return result, nil +} + +func (f *fileEntry) GetData() []byte { + if f.data == nil { + data, err := ioutil.ReadFile(f.Path) + if err != nil { + log.Warnf("Error reading file contents for %s: %s", f.Path, err.Error()) + return []byte{} + } + f.data = data + } + + return f.data +} + +func (f files) GetBytes(name string) []byte { + if v, ok := f.foundFiles[filepath.Join(f.baseDir, name)]; ok { + return v.GetData() + } + return []byte{} +} + +func (f files) Get(name string) string { + return string(f.GetBytes(name)) +} + +func (f files) Glob(pattern string) files { + result := files{ + baseDir: f.baseDir, + foundFiles: make(map[string]*fileEntry), + } + g, err := glob.Compile(filepath.Join(f.baseDir, pattern), filepath.Separator) + if err != nil { + log.Warnf("Error compiling Glob patten %s: %s", pattern, err.Error()) + return result + } + + for filePath, entry := range f.foundFiles { + if g.Match(filePath) { + result.foundFiles[filePath] = entry + } + } + + return result +} + +func (f files) AsConfig() string { + if len(f.foundFiles) == 0 { + return "" + } + + m := make(map[string]string) + + // Explicitly convert to strings, and file names + for k, v := range f.foundFiles { + m[path.Base(k)] = string(v.GetData()) + } + + return toYAML(m) +} + +func (f files) AsSecrets() string { + if len(f.foundFiles) == 0 { + return "" + } + + m := make(map[string]string) + + for k, v := range f.foundFiles { + m[path.Base(k)] = base64.StdEncoding.EncodeToString(v.GetData()) + } + + return toYAML(m) +} + +func (f files) Lines(path string) []string { + if len(f.foundFiles) == 0 { + return []string{} + } + entry, exists := f.foundFiles[path] + if !exists { + return []string{} + } + + return strings.Split(string(entry.GetData()), "\n") +} + +func toYAML(v interface{}) string { + data, err := yaml.Marshal(v) + if err != nil { + // Swallow errors inside a template. + return "" + } + return strings.TrimSuffix(string(data), "\n") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/document/files_test.go new/helm-docs-1.11.0/pkg/document/files_test.go --- old/helm-docs-1.10.0/pkg/document/files_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-docs-1.11.0/pkg/document/files_test.go 2022-06-29 12:28:58.000000000 +0200 @@ -0,0 +1,138 @@ +package document + +import ( + "github.com/stretchr/testify/assert" + "os" + "path" + "testing" +) + +// As the interface has been kept the same as in Helm, the tests also work here. +// Tests similar to https://github.com/helm/helm/blob/main/pkg/engine/files_test.go. + +var cases = []struct { + path, data string +}{ + {"ship/captain.txt", "The Captain"}, + {"ship/stowaway.txt", "Legatt"}, + {"story/name.txt", "The Secret Sharer"}, + {"story/author.txt", "Joseph Conrad"}, + {"multiline/test.txt", "bar\nfoo"}, +} + +func getTestFiles() files { + a := files{ + baseDir: "", + foundFiles: make(map[string]*fileEntry), + } + for _, c := range cases { + a.foundFiles[c.path] = &fileEntry{ + Path: c.path, + data: []byte(c.data), + } + } + + return a +} + +func TestNewFiles(t *testing.T) { + files := getTestFiles() + + if len(files.foundFiles) != len(cases) { + t.Errorf("Expected len() = %d, got %d", len(cases), len(files.foundFiles)) + } + + for i, f := range cases { + if got := string(files.GetBytes(f.path)); got != f.data { + t.Errorf("%d: expected %q, got %q", i, f.data, got) + } + if got := files.Get(f.path); got != f.data { + t.Errorf("%d: expected %q, got %q", i, f.data, got) + } + } +} + +func TestFileGlob(t *testing.T) { + as := assert.New(t) + + f := getTestFiles() + + matched := f.Glob("story/**") + + as.Len(matched.foundFiles, 2, "Should be two files in glob story/**") + as.Equal("Joseph Conrad", matched.Get("story/author.txt")) +} + +func TestToConfig(t *testing.T) { + as := assert.New(t) + + f := getTestFiles() + out := f.Glob("**/captain.txt").AsConfig() + as.Equal("captain.txt: The Captain", out) + + out = f.Glob("ship/**").AsConfig() + as.Equal("captain.txt: The Captain\nstowaway.txt: Legatt", out) +} + +func TestToSecret(t *testing.T) { + as := assert.New(t) + + f := getTestFiles() + + out := f.Glob("ship/**").AsSecrets() + as.Equal("captain.txt: VGhlIENhcHRhaW4=\nstowaway.txt: TGVnYXR0", out) +} + +func TestLines(t *testing.T) { + as := assert.New(t) + + f := getTestFiles() + + out := f.Lines("multiline/test.txt") + as.Len(out, 2) + + as.Equal("bar", out[0]) +} + +func TestGetFiles(t *testing.T) { + chartDir, err := os.MkdirTemp("", "*-helm-docs-chart") + if err != nil { + t.Fatal(err) + } + + t.Cleanup(func() { + _ = os.RemoveAll(chartDir) + }) + + testFiles := getTestFiles() + for filePath, entry := range testFiles.foundFiles { + fullPath := path.Join(chartDir, filePath) + baseDir := path.Dir(fullPath) + if err = os.MkdirAll(baseDir, 0o755); err != nil { + t.Fatal(err) + } + data := entry.GetData() + + if err = os.WriteFile(fullPath, data, 0o644); err != nil { + t.Fatal(err) + } + } + + chartFiles, err := getFiles(chartDir) + if err != nil { + t.Fatal(err) + } + + if len(chartFiles.foundFiles) != len(testFiles.foundFiles) { + t.Errorf("chart files: expected %d, got %d", len(chartFiles.foundFiles), len(testFiles.foundFiles)) + } + + // Sanity check the files have been read + for filePath, entry := range chartFiles.foundFiles { + data := entry.GetData() + + if len(data) == 0 { + t.Errorf("%s: expected file contents, got 0 bytes", filePath) + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/document/model.go new/helm-docs-1.11.0/pkg/document/model.go --- old/helm-docs-1.10.0/pkg/document/model.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/pkg/document/model.go 2022-06-29 12:28:58.000000000 +0200 @@ -30,6 +30,7 @@ helm.ChartDocumentationInfo HelmDocsVersion string Values []valueRow + Files files } func sortValueRows(valueRows []valueRow) { @@ -65,7 +66,7 @@ if valueRows[i].LineNumber == valueRows[j].LineNumber { return valueRows[i].Column < valueRows[j].Column } - return valueRows[i].LineNumber < valueRows[i].LineNumber + return valueRows[i].LineNumber < valueRows[j].LineNumber case AlphaNumSortOrder: return valueRows[i].Key < valueRows[j].Key default: @@ -97,6 +98,10 @@ return chartTemplateData{}, err } + if viper.GetBool("ignore-non-descriptions") { + valuesTableRows = removeRowsWithoutDescription(valuesTableRows) + } + if len(dependencyValues) > 0 { seenGlobalKeys := make(map[string]bool) for i, row := range valuesTableRows { @@ -131,9 +136,26 @@ sortValueRows(valuesTableRows) + files, err := getFiles(info.ChartDirectory) + if err != nil { + return chartTemplateData{}, err + } + return chartTemplateData{ ChartDocumentationInfo: info, HelmDocsVersion: helmDocsVersion, Values: valuesTableRows, + Files: files, }, nil } + +func removeRowsWithoutDescription(valuesTableRows []valueRow) []valueRow { + + var valuesTableRowsWithoutDescription []valueRow + for i := range valuesTableRows { + if valuesTableRows[i].AutoDescription != "" || valuesTableRows[i].Description != "" { + valuesTableRowsWithoutDescription = append(valuesTableRowsWithoutDescription, valuesTableRows[i]) + } + } + return valuesTableRowsWithoutDescription +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/document/values.go new/helm-docs-1.11.0/pkg/document/values.go --- old/helm-docs-1.10.0/pkg/document/values.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/pkg/document/values.go 2022-06-29 12:28:58.000000000 +0200 @@ -127,7 +127,7 @@ return helm.ChartValueDescription{} } - if !strings.Contains(node.HeadComment, "# --") { + if !strings.Contains(node.HeadComment, helm.PrefixComment) { return helm.ChartValueDescription{} } commentLines := strings.Split(node.HeadComment, "\n") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/document/values_test.go new/helm-docs-1.11.0/pkg/document/values_test.go --- old/helm-docs-1.10.0/pkg/document/values_test.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/pkg/document/values_test.go 2022-06-29 12:28:58.000000000 +0200 @@ -1440,11 +1440,11 @@ assert.Equal(t, "Bar!", valuesRows[0].AutoDescription) } -func TestMultilineDescriptionSection(t *testing.T) { +func TestMultilineRawDescription(t *testing.T) { helmValues := parseYamlValues(` animals: # -- (list) I mean, dogs are quite nice too... - # @section + # @raw # # List of default dogs: # - Umbra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/helm/chart_info.go new/helm-docs-1.11.0/pkg/helm/chart_info.go --- old/helm-docs-1.10.0/pkg/helm/chart_info.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/pkg/helm/chart_info.go 2022-06-29 12:28:58.000000000 +0200 @@ -16,7 +16,7 @@ ) var valuesDescriptionRegex = regexp.MustCompile("^\\s*#\\s*(.*)\\s+--\\s*(.*)$") -var sectionDescriptionRegex = regexp.MustCompile("^\\s*#\\s+@section") +var rawDescriptionRegex = regexp.MustCompile("^\\s*#\\s+@raw") var commentContinuationRegex = regexp.MustCompile("^\\s*#(\\s?)(.*)$") var defaultValueRegex = regexp.MustCompile("^\\s*# @default -- (.*)$") var valueTypeRegex = regexp.MustCompile("^\\((.*?)\\)\\s*(.*)$") @@ -146,6 +146,21 @@ return chartRequirements, nil } +func removeIgnored(rootNode *yaml.Node, parentKind yaml.Kind) { + newContent := make([]*yaml.Node, 0, len(rootNode.Content)) + for i := 0; i < len(rootNode.Content); i++ { + node := rootNode.Content[i] + if !strings.Contains(node.HeadComment, "@ignore") { + removeIgnored(node, node.Kind) + newContent = append(newContent, node) + } else if parentKind == yaml.MappingNode { + // for parentKind each yaml key is represented by two nodes + i++ + } + } + rootNode.Content = newContent +} + func parseChartValuesFile(chartDirectory string) (yaml.Node, error) { valuesPath := filepath.Join(chartDirectory, viper.GetString("values-file")) yamlFileContents, err := getYamlFileContents(valuesPath) @@ -156,6 +171,7 @@ } err = yaml.Unmarshal(yamlFileContents, &values) + removeIgnored(&values, values.Kind) return values, err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-docs-1.10.0/pkg/helm/comment.go new/helm-docs-1.11.0/pkg/helm/comment.go --- old/helm-docs-1.10.0/pkg/helm/comment.go 2022-05-10 13:08:56.000000000 +0200 +++ new/helm-docs-1.11.0/pkg/helm/comment.go 2022-06-29 12:28:58.000000000 +0200 @@ -4,6 +4,10 @@ "strings" ) +const ( + PrefixComment = "# --" +) + func ParseComment(commentLines []string) (string, ChartValueDescription) { var valueKey string var c ChartValueDescription @@ -13,7 +17,7 @@ // the last "group" of comment lines starting with '# --'. lastIndex := 0 for i, v := range commentLines { - if strings.HasPrefix(v, "# --") { + if strings.HasPrefix(v, PrefixComment) { lastIndex = i } } @@ -40,15 +44,15 @@ c.Description = valueTypeMatch[2] } - var isSection = false + var isRaw = false for _, line := range commentLines[docStartIdx+1:] { - sectionFlagMatch := sectionDescriptionRegex.FindStringSubmatch(line) + rawFlagMatch := rawDescriptionRegex.FindStringSubmatch(line) defaultCommentMatch := defaultValueRegex.FindStringSubmatch(line) notationTypeCommentMatch := valueNotationTypeRegex.FindStringSubmatch(line) - if !isSection && len(sectionFlagMatch) == 1 { - isSection = true + if !isRaw && len(rawFlagMatch) == 1 { + isRaw = true continue } @@ -64,7 +68,7 @@ commentContinuationMatch := commentContinuationRegex.FindStringSubmatch(line) - if isSection { + if isRaw { if len(commentContinuationMatch) > 1 { c.Description += "\n" + commentContinuationMatch[2] ++++++ vendor.tar.gz ++++++ ++++ 3101 lines of diff (skipped)
participants (1)
-
Source-Sync