Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/client/db/dbcmd/dbcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ type CLICommandBuilder struct {
}

func NewCmdBuilder(tc *client.TeleportClient, profile *client.ProfileStatus,
db *tlsca.RouteToDatabase, rootClusterName string, opts ...ConnectCommandFunc,
db tlsca.RouteToDatabase, rootClusterName string, opts ...ConnectCommandFunc,
) *CLICommandBuilder {
var options connectionCommandOpts
for _, opt := range opts {
opt(&options)
}

// In TLS routing mode a local proxy is started on demand so connect to it.
host, port := tc.DatabaseProxyHostPort(*db)
host, port := tc.DatabaseProxyHostPort(db)
if options.localProxyPort != 0 && options.localProxyHost != "" {
host = options.localProxyHost
port = options.localProxyPort
Expand All @@ -135,7 +135,7 @@ func NewCmdBuilder(tc *client.TeleportClient, profile *client.ProfileStatus,
return &CLICommandBuilder{
tc: tc,
profile: profile,
db: db,
db: &db,
host: host,
port: port,
options: options,
Expand Down
6 changes: 3 additions & 3 deletions lib/client/db/dbcmd/dbcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ func TestCLICommandBuilderGetConnectCommand(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

database := &tlsca.RouteToDatabase{
database := tlsca.RouteToDatabase{
Protocol: tt.dbProtocol,
Database: tt.databaseName,
Username: "myUser",
Expand Down Expand Up @@ -684,7 +684,7 @@ func TestCLICommandBuilderGetConnectCommandAlternatives(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

database := &tlsca.RouteToDatabase{
database := tlsca.RouteToDatabase{
Protocol: tt.dbProtocol,
Database: tt.databaseName,
Username: "myUser",
Expand Down Expand Up @@ -771,7 +771,7 @@ func TestConvertCommandError(t *testing.T) {
t.Run(tt.desc, func(t *testing.T) {
t.Parallel()

database := &tlsca.RouteToDatabase{
database := tlsca.RouteToDatabase{
Protocol: tt.dbProtocol,
Database: "DBName",
Username: "myUser",
Expand Down
2 changes: 1 addition & 1 deletion lib/teleterm/clusters/dbcmd_cli_command_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (d DbcmdCLICommandProvider) GetCommand(gateway *gateway.Gateway) (*exec.Cmd
Database: gateway.TargetSubresourceName(),
}

cmd, err := dbcmd.NewCmdBuilder(cluster.clusterClient, &cluster.status, &routeToDb,
cmd, err := dbcmd.NewCmdBuilder(cluster.clusterClient, &cluster.status, routeToDb,
// TODO(ravicious): Pass the root cluster name here. cluster.Name returns leaf name for leaf
// clusters.
//
Expand Down
Loading