Skip to content

Commit

Permalink
cluster: fix cannot check time zone (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar authored Jun 16, 2022
1 parent 00a67b8 commit 568324c
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions pkg/cluster/manager/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ func checkSystemInfo(
opt *CheckOptions,
) error {
var (
collectTasks []*task.StepDisplay
checkSysTasks []*task.StepDisplay
cleanTasks []*task.StepDisplay
applyFixTasks []*task.StepDisplay
downloadTasks []*task.StepDisplay
collectTasks []*task.StepDisplay
checkTimeZoneTasks []*task.StepDisplay
checkSysTasks []*task.StepDisplay
cleanTasks []*task.StepDisplay
applyFixTasks []*task.StepDisplay
downloadTasks []*task.StepDisplay
)
logger := ctx.Value(logprinter.ContextKeyLogger).(*logprinter.Logger)
insightVer := spec.TiDBComponentVersion(spec.ComponentCheckCollector, "")
Expand Down Expand Up @@ -317,28 +318,34 @@ func checkSystemInfo(
BuildAsStep(fmt.Sprintf(" - Getting system info of %s:%d", inst.GetHost(), inst.GetSSHPort()))
collectTasks = append(collectTasks, t2)

// build checking tasks
t1 = t1.
// check for general system info
t4 := task.NewBuilder(logger).
// check for time zone
CheckSys(
inst.GetHost(),
"",
task.CheckTypeSystemInfo,
task.CheckTypeTimeZone,
topo,
opt.Opr,
).
)
checkTimeZoneTasks = append(
checkTimeZoneTasks,
t4.BuildAsStep(fmt.Sprintf(" - Checking node %s", inst.GetHost())),
)

// build checking tasks
t1 = t1.
// check for general system info
CheckSys(
inst.GetHost(),
"",
task.CheckTypePartitions,
task.CheckTypeSystemInfo,
topo,
opt.Opr,
).
// check for time zone
CheckSys(
inst.GetHost(),
"",
task.CheckTypeTimeZone,
task.CheckTypePartitions,
topo,
opt.Opr,
).
Expand Down Expand Up @@ -440,6 +447,7 @@ func checkSystemInfo(
t := task.NewBuilder(logger).
ParallelStep("+ Download necessary tools", false, downloadTasks...).
ParallelStep("+ Collect basic system information", false, collectTasks...).
ParallelStep("+ Check time zone", false, checkTimeZoneTasks...).
ParallelStep("+ Check system requirements", false, checkSysTasks...).
ParallelStep("+ Cleanup check files", false, cleanTasks...).
Build()
Expand Down

0 comments on commit 568324c

Please sign in to comment.