diff --git a/go/cmd/vtctldclient/command/topology.go b/go/cmd/vtctldclient/command/topology.go index a03ce403eb8..24d0da85c55 100644 --- a/go/cmd/vtctldclient/command/topology.go +++ b/go/cmd/vtctldclient/command/topology.go @@ -102,8 +102,8 @@ var writeTopologyPathOptions = struct { }{} func commandWriteTopologyPath(cmd *cobra.Command, args []string) error { - file := cmd.Flags().Arg(0) - path := cmd.Flags().Arg(1) + path := cmd.Flags().Arg(0) + file := cmd.Flags().Arg(1) ts, err := topo.OpenServer(topoOptions.implementation, strings.Join(topoOptions.globalServerAddresses, ","), topoOptions.globalRoot) if err != nil { return fmt.Errorf("failed to connect to the topology server: %v", err) diff --git a/go/test/endtoend/tabletmanager/custom_rule_topo_test.go b/go/test/endtoend/tabletmanager/custom_rule_topo_test.go index c393e7c4646..74ad4b65c28 100644 --- a/go/test/endtoend/tabletmanager/custom_rule_topo_test.go +++ b/go/test/endtoend/tabletmanager/custom_rule_topo_test.go @@ -54,7 +54,7 @@ func TestTopoCustomRule(t *testing.T) { require.NoError(t, err) // Copy config file into topo. - err = clusterInstance.VtctldClientProcess.ExecuteCommand("--server", "internal", "WriteTopologyPath", topoCustomRuleFile, topoCustomRulePath) + err = clusterInstance.VtctldClientProcess.ExecuteCommand("--server", "internal", "WriteTopologyPath", topoCustomRulePath, topoCustomRuleFile) require.Nil(t, err, "error should be Nil") // Set extra tablet args for topo custom rule @@ -100,7 +100,7 @@ func TestTopoCustomRule(t *testing.T) { err = os.WriteFile(topoCustomRuleFile, data, 0777) require.NoError(t, err) - err = clusterInstance.VtctldClientProcess.ExecuteCommand("--server", "internal", "WriteTopologyPath", topoCustomRuleFile, topoCustomRulePath) + err = clusterInstance.VtctldClientProcess.ExecuteCommand("--server", "internal", "WriteTopologyPath", topoCustomRulePath, topoCustomRuleFile) require.Nil(t, err, "error should be Nil") // And wait until the query fails with the right error.