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
2 changes: 1 addition & 1 deletion cli/pbmctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func startBackup(ctx context.Context, apiClient pbapi.ApiClient, opts *cliOption
case "hot":
msg.BackupType = pbapi.BackupType_BACKUP_TYPE_HOTBACKUP
default:
return fmt.Errorf("backup type %q is invalid", opts.backupType)
return fmt.Errorf("backup type %q is invalid", *opts.backupType)
}

switch *opts.destinationType {
Expand Down
12 changes: 6 additions & 6 deletions cli/pbmctl/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"github.com/percona/percona-backup-mongodb/internal/templates"
"github.com/percona/percona-backup-mongodb/internal/testutils"
testGrpc "github.com/percona/percona-backup-mongodb/internal/testutils/grpc"
"github.com/percona/percona-backup-mongodb/proto/api"
pb "github.com/percona/percona-backup-mongodb/proto/messages"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -43,12 +43,12 @@ func TestListAgents(t *testing.T) {
tmpDir := path.Join(os.TempDir(), "dump_test")
defer os.RemoveAll(tmpDir) // Clean up after testing.
l := log.New()
d, err := testutils.NewGrpcDaemon(context.Background(), tmpDir, t, l)
d, err := testGrpc.NewGrpcDaemon(context.Background(), tmpDir, t, l)
if err != nil {
t.Fatalf("cannot start a new gRPC daemon/clients group: %s", err)
}

serverAddr := "127.0.0.1:" + testutils.TEST_GRPC_API_PORT
serverAddr := "127.0.0.1:" + testGrpc.TEST_GRPC_API_PORT
conn, err := getApiConn(&cliOptions{ServerAddr: serverAddr})
if err != nil {
t.Fatalf("Cannot connect to the API: %s", err)
Expand Down Expand Up @@ -155,10 +155,10 @@ func getApiConn(opts *cliOptions) (*grpc.ClientConn, error) {
}

if opts.TLS {
if opts.CAFile == "" {
opts.CAFile = testdata.Path("ca.pem")
if opts.TLSCAFile == "" {
opts.TLSCAFile = testdata.Path("ca.pem")
}
creds, err := credentials.NewClientTLSFromFile(opts.CAFile, "")
creds, err := credentials.NewClientTLSFromFile(opts.TLSCAFile, "")
if err != nil {
log.Fatalf("Failed to create TLS credentials %v", err)
}
Expand Down