Skip to content

Commit

Permalink
cluster/clean: update variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Dec 16, 2020
1 parent a191867 commit 4842c6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/cluster/manager/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (m *Manager) CleanCluster(name string, gOpt operator.Options, cleanOpt oper
}

// calculate file paths to be deleted before the prompt
delFileMaps := make(map[string]set.StringSet)
delFileMap := make(map[string]set.StringSet)
for _, com := range topo.ComponentsByStopOrder() {
instances := com.Instances()
retainDataRoles := set.NewStringSet(cleanOpt.RetainDataRoles...)
Expand Down Expand Up @@ -75,10 +75,10 @@ func (m *Manager) CleanCluster(name string, gOpt operator.Options, cleanOpt oper
}
}

if delFileMaps[ins.GetHost()] == nil {
delFileMaps[ins.GetHost()] = set.NewStringSet()
if delFileMap[ins.GetHost()] == nil {
delFileMap[ins.GetHost()] = set.NewStringSet()
}
delFileMaps[ins.GetHost()].Join(logPaths).Join(dataPaths)
delFileMap[ins.GetHost()].Join(logPaths).Join(dataPaths)
}
}

Expand All @@ -95,7 +95,7 @@ func (m *Manager) CleanCluster(name string, gOpt operator.Options, cleanOpt oper

// build file list string
delFileList := ""
for host, fileList := range delFileMaps {
for host, fileList := range delFileMap {
delFileList += fmt.Sprintf("\n%s:", color.CyanString(host))
for _, dfp := range fileList.Slice() {
delFileList += fmt.Sprintf("\n %s", dfp)
Expand All @@ -121,7 +121,7 @@ func (m *Manager) CleanCluster(name string, gOpt operator.Options, cleanOpt oper
return operator.Stop(ctx, topo, operator.Options{}, tlsCfg)
}).
Func("CleanupCluster", func(ctx *task.Context) error {
return operator.CleanupComponent(ctx, delFileMaps)
return operator.CleanupComponent(ctx, delFileMap)
}).
Build()

Expand Down

0 comments on commit 4842c6f

Please sign in to comment.