cert-manager / helm-tool

helm-tool is an internal cert-manager utility (can be broken or removed) which generates Helm docs, schema files and performs linting.
Apache License 2.0
5 stars 3 forks source link

helm-tool inject sometimes omits the context (prefix) of commented out values in the generated markdown #25

Open wallrj opened 8 months ago

wallrj commented 8 months ago

In https://github.com/cert-manager/approver-policy/pull/383 I originally added a new block to the end of the existing values.yaml file:

> podDisruptionBudget:
>   # Enable or disable the PodDisruptionBudget resource.
>   #
>   # This prevents downtime during voluntary disruptions such as during a Node upgrade.
>   # For example, the PodDisruptionBudget blocks `kubectl drain`
>   # if it is used on the Node where the only remaining approver-policy
>   # Pod is currently running.
>   enabled: false
> 
>   # Configures the minimum available pods for disruptions.
>   # Cannot be used if `maxUnavailable` is set.
>   # +docs:property
>   # minAvailable: 1
> 
>   # Configures the maximum unavailable pods for disruptions.
>   # Cannot be used if `minAvailable` is set.
>   # +docs:property
>   # maxUnavailable: 1
> 

But when I ran make generate-helm-docs it added minAvailable and maxUnavailable as global values, rather than prefixed like podDisruptionBudget.minAvailable .

It seemed to only be a problem when the commented out values were the last in the file. Adding a trailing foo: bar or moving the new block above some other existing blocks fixed the problem.

/kind bug

jetstack-bot commented 8 months ago

@wallrj: The label(s) kind/bug cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/cert-manager/helm-tool/issues/25): >In https://github.com/cert-manager/approver-policy/pull/383 I originally added a new block to the end of the existing values.yaml file: >> podDisruptionBudget: >> # Enable or disable the PodDisruptionBudget resource. >> # >> # This prevents downtime during voluntary disruptions such as during a Node upgrade. >> # For example, the PodDisruptionBudget blocks `kubectl drain` >> # if it is used on the Node where the only remaining approver-policy >> # Pod is currently running. >> enabled: false >> >> # Configures the minimum available pods for disruptions. >> # Cannot be used if `maxUnavailable` is set. >> # +docs:property >> # minAvailable: 1 >> >> # Configures the maximum unavailable pods for disruptions. >> # Cannot be used if `minAvailable` is set. >> # +docs:property >> # maxUnavailable: 1 >> > > >But when I ran `make generate-helm-docs` it added `minAvailable` and `maxUnavailable` as *global* values, rather than prefixed like `podDisruptionBudget.minAvailable` . > >It seemed to only be a problem when the commented out values were the last in the file. >Adding a trailing `foo: bar` or moving the new block above some other existing blocks fixed the problem. > >/kind bug Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.