mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 23:34:18 +02:00
replace & with new()
This commit is contained in:
@@ -29,12 +29,12 @@ func ClusterRerouteMove(conf *cfg.Config, index string) error {
|
||||
move := conf.DefaultCluster.ES().Cluster.Reroute()
|
||||
|
||||
commands := esdsl.NewCommand()
|
||||
moveCommand := &types.CommandMoveAction{
|
||||
moveCommand := new(types.CommandMoveAction{
|
||||
Shard: conf.Shards,
|
||||
FromNode: conf.FromNode,
|
||||
ToNode: conf.ToNode,
|
||||
Index: index,
|
||||
}
|
||||
})
|
||||
|
||||
commands.CommandCaster().Move = moveCommand
|
||||
|
||||
@@ -52,11 +52,11 @@ func ClusterRerouteAllocateReplica(conf *cfg.Config, index string) error {
|
||||
move := conf.DefaultCluster.ES().Cluster.Reroute()
|
||||
|
||||
commands := esdsl.NewCommand()
|
||||
allocCommand := &types.CommandAllocateReplicaAction{
|
||||
allocCommand := new(types.CommandAllocateReplicaAction{
|
||||
Shard: conf.Shards,
|
||||
Node: conf.ToNode,
|
||||
Index: index,
|
||||
}
|
||||
})
|
||||
|
||||
commands.CommandCaster().AllocateReplica = allocCommand
|
||||
|
||||
@@ -74,12 +74,12 @@ func ClusterRerouteCancel(conf *cfg.Config, index string) error {
|
||||
move := conf.DefaultCluster.ES().Cluster.Reroute()
|
||||
|
||||
commands := esdsl.NewCommand()
|
||||
cancelCommand := &types.CommandCancelAction{
|
||||
cancelCommand := new(types.CommandCancelAction{
|
||||
Shard: conf.Shards,
|
||||
Node: conf.ToNode,
|
||||
Index: index,
|
||||
AllowPrimary: &conf.AllowPrimary,
|
||||
}
|
||||
})
|
||||
|
||||
commands.CommandCaster().Cancel = cancelCommand
|
||||
|
||||
@@ -97,12 +97,12 @@ func ClusterRerouteAllocatePrimary(conf *cfg.Config, index string, stale bool) e
|
||||
move := conf.DefaultCluster.ES().Cluster.Reroute()
|
||||
|
||||
commands := esdsl.NewCommand()
|
||||
allocCommand := &types.CommandAllocatePrimaryAction{
|
||||
allocCommand := new(types.CommandAllocatePrimaryAction{
|
||||
Shard: conf.Shards,
|
||||
Node: conf.ToNode,
|
||||
Index: index,
|
||||
AcceptDataLoss: conf.AcceptDataLoss,
|
||||
}
|
||||
})
|
||||
|
||||
if stale {
|
||||
commands.CommandCaster().AllocateStalePrimary = allocCommand
|
||||
|
||||
Reference in New Issue
Block a user