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 renderlog_requests_levelwhen it's set and isn'toff.tests/configmap_test.yaml: cover the default, an explicitoff, 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 templatewith defaults renders"log_level"followed directly by"log_format", andconfig.jsonparses as JSON.helm template --set config.logRequestsLevel=infostill 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.
Related issues
Closes #45 (closed)