Skip to content

Commit

Permalink
refine: distro type (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
shhdgit authored Jul 23, 2021
1 parent 384cc68 commit 58aa412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/distro/default_distro_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package distro

var Resource = map[string]interface{}{
var Resource = map[string]string{
"tidb": "TiDB",
"tikv": "TiKV",
"tiflash": "TiFlash",
Expand Down
6 changes: 3 additions & 3 deletions pkg/utils/distro/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"sync/atomic"
)

type introData map[string]interface{}
type introData map[string]string

var data atomic.Value

Expand All @@ -28,8 +28,8 @@ func Replace(distro introData) {

func Data(k string) string {
d := data.Load().(introData)
if d[k] == nil {
if d[k] == "" {
return k
}
return d[k].(string)
return d[k]
}

0 comments on commit 58aa412

Please sign in to comment.