Skip to content

Commit

Permalink
Bind newest stable non-core components (#1129)
Browse files Browse the repository at this point in the history
* Save

* Bind newest stable non-core components

Close #1100

* Fmt

Co-authored-by: Ti Chi Robot <[email protected]>
  • Loading branch information
lucklove and ti-chi-bot authored Feb 22, 2021
1 parent c3f11c5 commit d566de8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
9 changes: 5 additions & 4 deletions components/dm/spec/bindversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package spec
import "github.com/pingcap/tiup/pkg/cluster/spec"

// DMComponentVersion maps the dm version to the third components binding version
// Empty version means the latest stable one
func DMComponentVersion(comp, version string) string {
switch comp {
case spec.ComponentAlertmanager:
return "v0.17.0"
case spec.ComponentGrafana, spec.ComponentPrometheus:
return "v4.0.3"
case spec.ComponentAlertmanager,
spec.ComponentGrafana,
spec.ComponentPrometheus:
return ""
default:
return version
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/embed/autogen_pkger.go

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions pkg/cluster/spec/bindversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@ import (
)

// TiDBComponentVersion maps the TiDB version to the third components binding version
// Empty version should be treate as the the last stable one
func TiDBComponentVersion(comp, version string) string {
switch comp {
case ComponentAlertmanager:
return "v0.17.0"
case ComponentBlackboxExporter:
return "v0.12.0"
case ComponentNodeExporter:
return "v0.17.0"
case ComponentPushwaygate:
return "v0.7.0"
case ComponentCheckCollector:
return "" // empty version should be treate as the the last stable one
case ComponentSpark, ComponentTiSpark:
return "" // empty version should be treate as the the last stable one
case ComponentAlertmanager,
ComponentBlackboxExporter,
ComponentNodeExporter,
ComponentPushwaygate,
ComponentCheckCollector,
ComponentSpark,
ComponentTiSpark:
return ""
default:
return version
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func (i *MonitorInstance) installRules(ctx context.Context, e ctxt.Executor, dep
cmds := []string{
"mkdir -p %[1]s",
`find %[1]s -type f -name "*.rules.yml" -delete`,
`find %[2]s/dm-master/conf -type f -name "*.rules.yml" -exec cp %[1]s \;`,
`find %[2]s/dm-master/conf -type f -name "*.rules.yml" -exec cp {} %[1]s \;`,
"rm -rf %[2]s",
}
_, stderr, err = e.Execute(ctx, fmt.Sprintf(strings.Join(cmds, " && "), targetDir, tmp), false)
Expand Down
3 changes: 0 additions & 3 deletions templates/config/prometheus.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ rule_files:
{{- if .DMWorkerAddrs}}
- 'dm_worker.rules.yml'
{{- end}}
{{- if .DMMasterAddrs}}
- 'dm_master.rules.yml'
{{- end}}
{{- end}}

{{- if .AlertmanagerAddrs}}
Expand Down

0 comments on commit d566de8

Please sign in to comment.