Skip to content
New issue

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

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

Already on GitHub? # to your account

TriggerAuthentication/Vault: add support for vault namespace #2085

Merged
merged 2 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Add Bearer auth for Metrics API scaler ([#2028](https://github.com/kedacore/keda/pull/2028))
- Anonymize the host in case of HTTP failure (RabbitMQ Scaler) ([#2041](https://github.com/kedacore/keda/pull/2041))
- Escape `queueName` and `vhostName` in RabbitMQ Scaler before use them in query string (bug fix) ([#2055](https://github.com/kedacore/keda/pull/2055))
- TriggerAuthentication/Vault: add support for Vault namespace (Vault Enterprise) ([#2085](https://github.com/kedacore/keda/pull/2085))

### Breaking Changes

Expand Down
3 changes: 3 additions & 0 deletions apis/keda/v1alpha1/triggerauthentication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ type HashiCorpVault struct {
Authentication VaultAuthentication `json:"authentication"`
Secrets []VaultSecret `json:"secrets"`

// +optional
Namespace string `json:"namespace,omitempty"`

// +optional
Credential *Credential `json:"credential,omitempty"`

Expand Down
4 changes: 4 additions & 0 deletions pkg/scaling/resolver/hashicorpvault_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (vh *HashicorpVaultHandler) Initialize(logger logr.Logger) error {
return err
}

if len(vh.vault.Namespace) > 0 {
client.SetNamespace(vh.vault.Namespace)
}

token, err := vh.token(client)
if err != nil {
return err
Expand Down