Omit log_requests_level when logRequestsLevel is off

What does this MR do?

Stops the chart rendering log_requests_level into the OpenBao config when config.logRequestsLevel is off, which is the default.

OpenBao doesn't accept off for this setting. In OpenBao v2.6.2 vault/core.go, both configureLogRequestsLevel (startup) and ReloadLogRequestsLevel (reload) only store levels between NoLevel and Off, and log invalid log_requests_level for any other non-empty value. So with the chart defaults, every OpenBao start logs that warning.

Leaving the key out gives the same behaviour (no request logging) without the warning. Any other level, for example info, is rendered as before.

Changes

  • templates/_openbao_config_helpers.tpl: only render log_requests_level when it's set and isn't off.
  • tests/configmap_test.yaml: cover the default, an explicit off, and an explicit level. The default case also checks the JSON around the removed key is still valid.

No values or schema changes. off stays in the enum, so existing values files keep working.

Test plan

  • helm unittest -f tests/configmap_test.yaml . passes (27 tests).
  • helm template with defaults renders "log_level" followed directly by "log_format", and config.json parses as JSON.
  • helm template --set config.logRequestsLevel=info still renders "log_requests_level": "info".

Longer term, OpenBao could treat off as valid itself. I haven't raised that upstream yet.

I used Claude to help prepare this change.

Author's Checklist

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Ensure a release milestone is set.
  • MR title and description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline on GitLab.com.
  • When ready for review, MR is labeled workflowready for review per the MR workflow

Expected

  • Test plan indicating conditions for success has been posted and passes.
  • Documentation is created or updated. No user-facing docs change: the value and its options are unchanged.
  • Tests are added.

Closes #45 (closed)

Edited by Fabien Catteau

Merge request reports

Loading
Loading