diff --git a/pkg/cluster/ansible/service.go b/pkg/cluster/ansible/service.go index b93b4a46a8..bd672da8b3 100644 --- a/pkg/cluster/ansible/service.go +++ b/pkg/cluster/ansible/service.go @@ -197,7 +197,7 @@ func parseDirs(ctx context.Context, user string, ins spec.InstanceSpec, sshTimeo tsArg := strings.Split(line, " ")[4] // 4 whitespaces ahead tmpTs, _ := strconv.Atoi(strings.TrimPrefix(tsArg, "--initial-commit-ts=")) newIns.Config = make(map[string]interface{}) - newIns.Config["initial_commit_ts"] = int64(tmpTs) + newIns.Config["initial-commit-ts"] = int64(tmpTs) } } return newIns, nil diff --git a/pkg/cluster/spec/spec.go b/pkg/cluster/spec/spec.go index aec70a09cd..56ec4db237 100644 --- a/pkg/cluster/spec/spec.go +++ b/pkg/cluster/spec/spec.go @@ -870,16 +870,16 @@ func setHostArch(field reflect.Value, hostArch map[string]string) error { return nil } -// when upgrade form old tiup-cluster, replace spec.CommitTS with spec.Config["initial_commit_ts"] +// when upgrade form old tiup-cluster, replace spec.CommitTS with spec.Config["initial-commit-ts"] func (s *Specification) removeCommitTS() { - _, ok1 := s.ServerConfigs.Drainer["initial_commit_ts"] + _, ok1 := s.ServerConfigs.Drainer["initial-commit-ts"] for _, spec := range s.Drainers { - _, ok2 := spec.Config["initial_commit_ts"] + _, ok2 := spec.Config["initial-commit-ts"] if !ok1 && !ok2 && spec.CommitTS != nil && *spec.CommitTS != -1 { if spec.Config == nil { spec.Config = make(map[string]interface{}) } - spec.Config["initial_commit_ts"] = *spec.CommitTS + spec.Config["initial-commit-ts"] = *spec.CommitTS } spec.CommitTS = nil }