From 2c1247688416b5c5ade50941e33008ed2b25716f Mon Sep 17 00:00:00 2001 From: Sergio Rua Date: Sat, 20 Jan 2024 19:18:34 +0000 Subject: [PATCH] Bugfix: port may not be returned --- charts/vals-operator/Chart.yaml | 4 ++-- charts/vals-operator/README.md | 2 +- vault/vault.go | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/vals-operator/Chart.yaml b/charts/vals-operator/Chart.yaml index 75b0c5a..8433857 100644 --- a/charts/vals-operator/Chart.yaml +++ b/charts/vals-operator/Chart.yaml @@ -16,10 +16,10 @@ kubeVersion: ">= 1.19.0-0" type: application # Chart version -version: 0.7.8 +version: 0.7.9-beta1 # Latest container tag -appVersion: v0.7.8 +appVersion: v0.7.9-beta1 maintainers: - email: info@digitalis.io diff --git a/charts/vals-operator/README.md b/charts/vals-operator/README.md index cfc03bc..6bddfe5 100644 --- a/charts/vals-operator/README.md +++ b/charts/vals-operator/README.md @@ -1,6 +1,6 @@ # vals-operator -![Version: 0.7.8](https://img.shields.io/badge/Version-0.7.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.7.8](https://img.shields.io/badge/AppVersion-v0.7.8-informational?style=flat-square) +![Version: 0.7.9-beta1](https://img.shields.io/badge/Version-0.7.9-beta1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.7.9-beta1](https://img.shields.io/badge/AppVersion-v0.7.9-beta1-informational?style=flat-square) This helm chart installs the Digitalis Vals Operator to manage and sync secrets from supported backends into Kubernetes. ## About Vals-Operator diff --git a/vault/vault.go b/vault/vault.go index cb2c651..27ef518 100644 --- a/vault/vault.go +++ b/vault/vault.go @@ -295,8 +295,10 @@ func GetDbCredentials(role string, mount string) (VaultDbSecret, error) { hosts, _ = conn["hosts"].(string) connectionURL, _ = conn["connection_url"].(string) - port = conn["port"].(json.Number).String() - + _, ok = conn["port"] + if ok { + port = conn["port"].(json.Number).String() + } if connectionURL != "" { connectionURL = strings.Replace(connectionURL, "{{username}}", s.Data["username"].(string), 1) connectionURL = strings.Replace(connectionURL, "{{password}}", s.Data["password"].(string), 1)