From 4853e46ad855d3451f24fd578ed4db5d98116a4a Mon Sep 17 00:00:00 2001 From: 9547 Date: Sun, 13 Dec 2020 17:02:01 +0800 Subject: [PATCH] typo(cluster): nodesID -> nodesIDs --- pkg/cluster/manager/destroy.go | 5 ++++- pkg/cluster/task/builder.go | 4 ++-- pkg/cluster/task/update_meta.go | 6 +++--- pkg/cluster/task/update_topology.go | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pkg/cluster/manager/destroy.go b/pkg/cluster/manager/destroy.go index da41f9fc75..55bc5c63d0 100644 --- a/pkg/cluster/manager/destroy.go +++ b/pkg/cluster/manager/destroy.go @@ -133,7 +133,10 @@ func (m *Manager) DestroyTombstone( UpdateTopology(name, m.specManager.Path(name), clusterMeta, nodes) regenConfigTasks, _ := buildRegenConfigTasks(m, name, topo, base, nodes) - t := b.ParallelStep("+ Refresh instance configs", true, regenConfigTasks...).Parallel(true, buildDynReloadPromTasks(metadata.GetTopology())...).Build() + t := b. + ParallelStep("+ Refresh instance configs", true, regenConfigTasks...). + Parallel(true, buildDynReloadPromTasks(metadata.GetTopology())...). + Build() if err := t.Execute(task.NewContext()); err != nil { if errorx.Cast(err) != nil { // FIXME: Map possible task errors and give suggestions. diff --git a/pkg/cluster/task/builder.go b/pkg/cluster/task/builder.go index c605e39c29..a42dcc4d16 100644 --- a/pkg/cluster/task/builder.go +++ b/pkg/cluster/task/builder.go @@ -112,7 +112,7 @@ func (b *Builder) UpdateMeta(cluster string, metadata *spec.ClusterMeta, deleted b.tasks = append(b.tasks, &UpdateMeta{ cluster: cluster, metadata: metadata, - deletedNodesID: deletedNodeIds, + deletedNodeIDs: deletedNodeIds, }) return b } @@ -123,7 +123,7 @@ func (b *Builder) UpdateTopology(cluster, profile string, metadata *spec.Cluster metadata: metadata, cluster: cluster, profileDir: profile, - deletedNodesID: deletedNodeIds, + deletedNodeIDs: deletedNodeIds, }) return b } diff --git a/pkg/cluster/task/update_meta.go b/pkg/cluster/task/update_meta.go index 8fe272d1c7..813255892d 100644 --- a/pkg/cluster/task/update_meta.go +++ b/pkg/cluster/task/update_meta.go @@ -25,7 +25,7 @@ import ( type UpdateMeta struct { cluster string metadata *spec.ClusterMeta - deletedNodesID []string + deletedNodeIDs []string } // Execute implements the Task interface @@ -33,7 +33,7 @@ type UpdateMeta struct { // the other callers point to this field by a pointer, // so we should update the original topology directly, and don't make a copy func (u *UpdateMeta) Execute(ctx *Context) error { - deleted := set.NewStringSet(u.deletedNodesID...) + deleted := set.NewStringSet(u.deletedNodeIDs...) topo := u.metadata.Topology tidbServers := make([]spec.TiDBSpec, 0) @@ -154,5 +154,5 @@ func (u *UpdateMeta) Rollback(ctx *Context) error { // String implements the fmt.Stringer interface func (u *UpdateMeta) String() string { - return fmt.Sprintf("UpdateMeta: cluster=%s, deleted=`'%s'`", u.cluster, strings.Join(u.deletedNodesID, "','")) + return fmt.Sprintf("UpdateMeta: cluster=%s, deleted=`'%s'`", u.cluster, strings.Join(u.deletedNodeIDs, "','")) } diff --git a/pkg/cluster/task/update_topology.go b/pkg/cluster/task/update_topology.go index 6def0bcdd7..562db6184d 100644 --- a/pkg/cluster/task/update_topology.go +++ b/pkg/cluster/task/update_topology.go @@ -17,7 +17,7 @@ type UpdateTopology struct { cluster string profileDir string metadata *spec.ClusterMeta - deletedNodesID []string + deletedNodeIDs []string } // String implements the fmt.Stringer interface @@ -41,7 +41,7 @@ func (u *UpdateTopology) Execute(ctx *Context) error { topo := u.metadata.Topology - deleted := set.NewStringSet(u.deletedNodesID...) + deleted := set.NewStringSet(u.deletedNodeIDs...) var ops []clientv3.Op var instances []spec.Instance