From 702daf18ccbdd5beb1dfcc7ba92dd41992789769 Mon Sep 17 00:00:00 2001 From: Stefan Benz Date: Tue, 7 Apr 2020 09:06:08 +0200 Subject: [PATCH] fix(grafana): fixed use of secret for grafana admin Signed-off-by: Stefan Benz --- docs/crd.md | 2 +- internal/bundle/application/applications/grafana/helm.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/crd.md b/docs/crd.md index a2612fa..b15aa2a 100644 --- a/docs/crd.md +++ b/docs/crd.md @@ -62,7 +62,7 @@ | `admin` | Spec for the definition of the admin account | nil | | `admin.existingSecret` | Name of the secret which contains the admin account | | | `admin.userKey` | Key of the username in the secret | | -| `admin.PasswordKey` | Key of the password in the secret | | +| `admin.passwordKey` | Key of the password in the secret | | | `admin` | Spec for the definition of the admin account | | | `datasources` | Spec for additional datasources | nil | | `datasources.name` | Name of the datasource | | diff --git a/internal/bundle/application/applications/grafana/helm.go b/internal/bundle/application/applications/grafana/helm.go index 534e48a..d4f3922 100644 --- a/internal/bundle/application/applications/grafana/helm.go +++ b/internal/bundle/application/applications/grafana/helm.go @@ -118,10 +118,13 @@ func (g *Grafana) SpecToHelmValues(monitor mntr.Monitor, toolset *toolsetsv1beta } if toolset.Grafana.Admin != nil { - values.Grafana.Admin.ExistingSecret = toolset.Grafana.Admin.ExistingSecret - values.Grafana.Admin.UserKey = toolset.Grafana.Admin.UserKey - values.Grafana.Admin.PasswordKey = toolset.Grafana.Admin.PasswordKey + values.Grafana.Admin = &helm.Admin{ + ExistingSecret: toolset.Grafana.Admin.ExistingSecret, + UserKey: toolset.Grafana.Admin.UserKey, + PasswordKey: toolset.Grafana.Admin.PasswordKey, + } } + if toolset.Grafana.Storage != nil { values.Grafana.Persistence.Enabled = true values.Grafana.Persistence.Size = toolset.Grafana.Storage.Size