Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Switch --values-file not supported into .pre-commit-config.yaml configuration #280

Open
1 task done
fmunteanu opened this issue Nov 28, 2024 · 0 comments
Open
1 task done
Assignees
Labels
bug Something isn't working triage Issues that need to be triaged and categorized

Comments

@fmunteanu
Copy link

fmunteanu commented Nov 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

helm-docs has the --values-file switch available. I'm using the following configuration example for .pre-commit-config.yaml:

repos:
  - repo: https://github.com/axivo/k3s-cluster
    rev: v1.0.0
    hooks:
      - id: victoriametrics
        args:
          - --chart-search-root=./roles/victoriametrics
          - --values-file=./defaults/main.yaml 

When I run helm-docs, I get the following warning:

$ helm-docs
INFO[2024-11-27T22:41:56-05:00] Found Chart directories [roles/victoriametrics]
WARN[2024-11-27T22:41:56-05:00] Required chart file roles/victoriametrics/values.yaml missing. Skipping documentation for chart
WARN[2024-11-27T22:41:56-05:00] Error parsing information for chart roles/victoriametrics, skipping: stat roles/victoriametrics/values.yaml: no such file or directory

I fixed the issue easy, by creating a values.yaml soft link, still I would like to know if this might be a bug. If I pass the --values-file flag while executing the command locally, everything works as intended:

$ helm-docs --chart-search-root=./roles/victoriametrics --values-file=./defaults/main.yaml
INFO[2024-11-29T19:23:16-05:00] Found Chart directories [.]
INFO[2024-11-29T19:23:16-05:00] Generating README Documentation for chart roles/victoriametrics

Expected Behavior

The --values-file switch should be detected and applied into .pre-commit-config.yaml configuration. I created a workflow, to make sure the issue is not present on my Mac only, with same result.

Example of workflow execution with values.yaml file missing and present, see Refresh Documentation step.

Reference Chart

I'm using helm-docs in an unconventional way, emulating a Helm chart to render the variables of an Ansible role, into a properly formatted README. It works quite well and saves me an enormous amount of time to generate the documentation.

https://github.com/axivo/k3s-cluster/tree/0ecc6058ac82c5ebf2dc1f64d6683751a667cdab/roles/victoriametrics

Reference Template

No response

Environment

  • Operating system: macOS, helm-docs installed with Homebrew, version 1.14.2
  • Helm version: version.BuildInfo{Version:"v3.16.2", GitCommit:"13654a52f7c70a143b1dd51416d633e1071faffb", GitTreeState:"dirty", GoVersion:"go1.23.2"}
  • GO version (output of go version): go1.23.3 darwin/arm64
  • Method of calling helm-docs (manual, jenkins, github action ...): Tested with manual and GitHub Action

Link to helm-docs Logs

No response

Further Information

Unrelated to the current question, I noticed that markdown format links are not rendered inside chart.valuesTableHtml template, I'm forced to use actual HTML code.

Using a format as detailed below, will not transform the markdown into a HTML link, when using chart.valuesSectionHtml or chart.valuesTableHtml:

      user:
        # -- User name used to access Grafana UI
        # @default -- Set value into [all.yaml](../../inventory/cluster/group_vars/all.yaml) variables
        name:

Same result occurs, if markdown links are inserted into Description column. Is this related to a specific template that needs to be present? From your documentation:

If no template file is provided, the tool has a default internal template that will generate a reasonably formatted README.

@fmunteanu fmunteanu added bug Something isn't working triage Issues that need to be triaged and categorized labels Nov 28, 2024
@fmunteanu fmunteanu changed the title [Question]: Is --values-file switch supported into .pre-commit-config.yaml [Bug]: Switch --values-file not supported into .pre-commit-config.yaml configuration Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issues that need to be triaged and categorized
Projects
None yet
Development

No branches or pull requests

3 participants