Skip to content

Commit

Permalink
Use internal rather than bundled
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Oct 20, 2023
1 parent 7b37ec8 commit fc385fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/common/scripts/etcd-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sleep 5
# If the node already exists, it's fine, means we used existing data.
echo "add ${cell} CellInfo"
set +e
command vtctldclient --server bundled AddCellInfo \
command vtctldclient --server internal AddCellInfo \
--root "/vitess/${cell}" \
--server-address "${ETCD_SERVER}" \
"${cell}"
Expand Down
11 changes: 5 additions & 6 deletions go/cmd/vtctldclient/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ import (
_ "vitess.io/vitess/go/cmd/vtctldclient/command/vreplication/vdiff"
_ "vitess.io/vitess/go/cmd/vtctldclient/command/vreplication/workflow"

// These imports register the topo factories to use when --server=bundled.
// These imports register the topo factories to use when --server=internal.
_ "vitess.io/vitess/go/vt/topo/consultopo"
_ "vitess.io/vitess/go/vt/topo/etcd2topo"
_ "vitess.io/vitess/go/vt/topo/zk2topo"
)

// The --server value if you want to use a "local"
// vtctld server.
const useBundledVtctld = "bundled"
// The --server value if you want to use a "local" vtctld server.
const useInternalVtctld = "internal"

var (
// VtctldClientProtocol is the protocol to use when creating the vtctldclient.VtctldClient.
Expand Down Expand Up @@ -92,7 +91,7 @@ var (
Long: fmt.Sprintf(`If there are no running vtctld servers -- for example when boostrapping
a new Vitess cluster -- you can specify a --server value of '%s'.
When doing so, you would use the --topo* flags so that the client can
connect directly to the topo server(s).`, useBundledVtctld),
connect directly to the topo server(s).`, useInternalVtctld),
// We use PersistentPreRun to set up the tracer, grpc client, and
// command context for every command.
PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) {
Expand Down Expand Up @@ -187,7 +186,7 @@ func getClientForCommand(cmd *cobra.Command) (vtctldclient.VtctldClient, error)
return nil, errNoServer
}

if server == useBundledVtctld {
if server == useInternalVtctld {
ts, err := topo.OpenServer(topoOptions.implementation, strings.Join(topoOptions.globalServerAddresses, ","), topoOptions.globalRoot)
if err != nil {
return nil, fmt.Errorf("failed to connect to the topology server: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtctldclient.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
If there are no running vtctld servers -- for example when boostrapping
a new Vitess cluster -- you can specify a --server value of 'bundled'.
a new Vitess cluster -- you can specify a --server value of 'internal'.
When doing so, you would use the --topo* flags so that the client can
connect directly to the topo server(s).

Expand Down

0 comments on commit fc385fe

Please sign in to comment.