From 235c85e317d5b1503b51ba121a3baf0d9a5b4d25 Mon Sep 17 00:00:00 2001 From: kaaaaaaang Date: Fri, 8 Nov 2024 11:08:44 +0800 Subject: [PATCH] cluster: fix # cannot be included in grafana password (#2468) * fix # cannot be included in grafana password * fix Signed-off-by: xhe --------- Signed-off-by: xhe Co-authored-by: xhe --- embed/templates/config/grafana.ini.tpl | 2 +- pkg/cluster/spec/grafana_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/embed/templates/config/grafana.ini.tpl b/embed/templates/config/grafana.ini.tpl index 9cc5140901..602cbce620 100644 --- a/embed/templates/config/grafana.ini.tpl +++ b/embed/templates/config/grafana.ini.tpl @@ -129,7 +129,7 @@ check_for_updates = true admin_user = {{.Username}} # default admin password, can be changed before first start of grafana, or in profile settings -admin_password = {{.Password}} +admin_password = `{{.Password}}` # used for signing ;secret_key = SW2YcwTIb9zpOOhoPsMm diff --git a/pkg/cluster/spec/grafana_test.go b/pkg/cluster/spec/grafana_test.go index 802c179e82..d15ec09ccd 100644 --- a/pkg/cluster/spec/grafana_test.go +++ b/pkg/cluster/spec/grafana_test.go @@ -81,7 +81,7 @@ func TestMergeAdditionalGrafanaConf(t *testing.T) { ;enabled = false ;host = localhost:25 ;user = -;password = +password = ` + "`1#2`" + ` ;cert_file = ;key_file = ;skip_verify = false @@ -113,12 +113,12 @@ level = info expected := `# ################################### SMTP / Emailing ########################## [smtp] -enabled = true - ; enabled = false ; host = localhost:25 ; user = -; password = +password = ` + "`1#2`" + ` +enabled = true + ; cert_file = ; key_file = ; skip_verify = false