Skip to content

Commit

Permalink
cluster: refactor cross cluster pre-deploy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Jul 31, 2020
1 parent 483133c commit e2b54e2
Show file tree
Hide file tree
Showing 7 changed files with 771 additions and 746 deletions.
9 changes: 6 additions & 3 deletions components/cluster/command/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/joomcode/errorx"
perrs "github.com/pingcap/errors"
"github.com/pingcap/tiup/pkg/cliutil"
"github.com/pingcap/tiup/pkg/cliutil/prepare"
"github.com/pingcap/tiup/pkg/cluster/clusterutil"
operator "github.com/pingcap/tiup/pkg/cluster/operation"
"github.com/pingcap/tiup/pkg/cluster/spec"
Expand Down Expand Up @@ -86,11 +85,15 @@ conflict checks with other clusters`,
return err
}

clusterList, err := tidbSpec.GetAllClusters()
if err != nil {
return err
}
// use a dummy cluster name, the real cluster name is set during deploy
if err := prepare.CheckClusterPortConflict(tidbSpec, "nonexist-dummy-tidb-cluster", &topo); err != nil {
if err := spec.CheckClusterPortConflict(clusterList, "nonexist-dummy-tidb-cluster", &topo); err != nil {
return err
}
if err := prepare.CheckClusterDirConflict(tidbSpec, "nonexist-dummy-tidb-cluster", &topo); err != nil {
if err := spec.CheckClusterDirConflict(clusterList, "nonexist-dummy-tidb-cluster", &topo); err != nil {
return err
}
}
Expand Down
359 changes: 0 additions & 359 deletions pkg/cliutil/prepare/prepare.go

This file was deleted.

Loading

0 comments on commit e2b54e2

Please sign in to comment.