Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: fix cannot check time zone #1925

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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