Skip to content

Commit

Permalink
typo(cluster): nodesID -> nodesIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa committed Dec 13, 2020
1 parent 91466ae commit 4853e46
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion pkg/cluster/manager/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/task/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/cluster/task/update_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import (
type UpdateMeta struct {
cluster string
metadata *spec.ClusterMeta
deletedNodesID []string
deletedNodeIDs []string
}

// Execute implements the Task interface
// the metadata especially the topology is in wide use,
// 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)
Expand Down Expand Up @@ -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, "','"))
}
4 changes: 2 additions & 2 deletions pkg/cluster/task/update_topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type UpdateTopology struct {
cluster string
profileDir string
metadata *spec.ClusterMeta
deletedNodesID []string
deletedNodeIDs []string
}

// String implements the fmt.Stringer interface
Expand All @@ -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
Expand Down

0 comments on commit 4853e46

Please sign in to comment.