From a246cfa88f8b8d0027d6223604e70b16301dd312 Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Tue, 12 Jan 2021 19:57:50 +0800 Subject: [PATCH] Fix the issue that dm grafana doen't has home.json (#1056) Introduced by https://github.com/pingcap/tiup/pull/982 Close https://github.com/pingcap/tiup/issues/1055 Co-authored-by: Ti Prow Robot <71242396+ti-community-prow-bot@users.noreply.github.com> --- pkg/cluster/spec/grafana.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/spec/grafana.go b/pkg/cluster/spec/grafana.go index 6d9dd1f3bd..ac403bd472 100644 --- a/pkg/cluster/spec/grafana.go +++ b/pkg/cluster/spec/grafana.go @@ -208,7 +208,7 @@ func (i *GrafanaInstance) initDashboards(e executor.Executor, spec GrafanaSpec, cmds := []string{ "mkdir -p %[1]s", - `find %[1]s -type f -name "*.json" -delete`, + `find %[1]s -maxdepth 1 -type f -name "*.json" -delete`, "cp %[2]s/bin/*.json %[1]s", } _, stderr, err := e.Execute(fmt.Sprintf(strings.Join(cmds, " && "), dashboardsDir, paths.Deploy), false) @@ -266,7 +266,7 @@ func (i *GrafanaInstance) installDashboards(e executor.Executor, deployDir, clus targetDir := filepath.Join(deployDir, "bin") cmds := []string{ "mkdir -p %[1]s", - `find %[1]s -type f -name "*.json" -delete`, + `find %[1]s -maxdepth 1 -type f -name "*.json" -delete`, "cp %[2]s/dm-master/scripts/*.json %[1]s", "rm -rf %[2]s", }