Skip to content

Make injector.external(Bao|Vault)Addr take precendence over global.external(Bao|Vault)Addr#158

Open
baurmatt wants to merge 3 commits intoopenbao:mainfrom
syseleven:157-injector.externalBaoAddr
Open

Make injector.external(Bao|Vault)Addr take precendence over global.external(Bao|Vault)Addr#158
baurmatt wants to merge 3 commits intoopenbao:mainfrom
syseleven:157-injector.externalBaoAddr

Conversation

@baurmatt
Copy link
Copy Markdown

Description

Previously it used to be the other way around. This had multiple disadvantages:

  1. More specific configuration should override broader values.
  2. Setting the injector specific config (injector.external(Bao|Vault)Addr) led to server being disabled.
  3. Injector cannot be configured to connected to a external (e.g. Proxy) URL while still having OpenBao run in-cluster.

Rationale

Fixes #157.

Checklist

  • This PR contains a description of the changes I'm making
  • I read the CONTRIBUTING.md guide
  • I updated the version in Chart.yaml if feasible according to Semantic versioning
  • I updated the changelog with an artifacthub.io/changes annotation in Chart.yaml
  • I update the changelog in CHANGELOG.md
  • I updated applicable README.md files using helm-docs
  • By contributing this change, I certify I have signed-off on the
    DCO ownership statement
    and this change did not use post-BUSL-licensed code from HashiCorp.
    Existing MPL-licensed code is still allowed, subject to attribution.
    Code authored by yourself and submitted to HashiCorp for inclusion is
    also allowed.

…ternal(Bao|Vault)Addr

Previously it used to be the other way around. This had multiple
disadvantages:

1. More specific configuration should override broader values.
2. Setting the injector specific config (injector.external(Bao|Vault)Addr)
   led to server being disabled.
3. Injector cannot be configured to connected to a external (e.g. Proxy)
   URL while still having OpenBao run in-cluster.

Fixes openbao#157.

Signed-off-by: Matthias Baur <m.baur@syseleven.de>
@baurmatt baurmatt requested review from a team as code owners March 20, 2026 15:24
@baurmatt baurmatt changed the title Draft: Make injector.external(Bao|Vault)Addr take precendence over global.external(Bao|Vault)Addr Make injector.external(Bao|Vault)Addr take precendence over global.external(Bao|Vault)Addr Mar 23, 2026
@eyenx eyenx self-requested a review March 25, 2026 11:51
}

@test "injector/deployment: global.externalBaoAddr takes precendence over injector.externalVaultAddr" {
@test "injector/deployment: injector.externalVaultAddr takes precendence over global.externalBaoAddr" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @baurmatt

Thanks for your PR.

Please change the check to check precedence of injector.externalBaoAddr over global.externalBaoAddr and add second test checking precedence of injector.externalBaoAddr over injector.externalVaultAddr

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, added! :)

*/}}

{{- define "openbao.externalAddr" -}}
{{- define "openbao.global.externalAddr" -}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking myself if we should even change this to openbao.global. or jst keep the openbao.externalAddr and have the addiional openbao.injector.externalAddr just take precedence.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baurmatt is there a specific reason for the global prefix?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the global prefix to make it clearer why variable to function works with. I personally would mix up global and injector addr in this function. It's currently a clean way to work around the "legacy" vault variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Agent Injector Vault Address Environment Variable Options #789

2 participants