Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Commit e121d56

Browse files
committed
Change naming of DatabaseHostname to LocalHostname
1 parent 34b5a4d commit e121d56

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

strata/cmd/mongo/lreplica_drivers/lrazureblobdriver/lrazureblobdriver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (factory DriverFactory) Driver() (*strata.Driver, error) {
5454

5555
replica, err := lreplica.NewLocalReplica(
5656
options.Replica.MaxBackgroundCopies,
57-
options.Replica.DatabaseHostname,
57+
options.Replica.LocalHostname,
5858
strconv.Itoa(options.Replica.Port),
5959
options.Replica.Username,
6060
options.Replica.Password,

strata/cmd/mongo/lreplica_drivers/lrldriver/lrldriver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (factory DriverFactory) Driver() (*strata.Driver, error) {
4646

4747
replica, err := lreplica.NewLocalReplica(
4848
options.Replica.MaxBackgroundCopies,
49-
options.Replica.DatabaseHostname,
49+
options.Replica.LocalHostname,
5050
strconv.Itoa(options.Replica.Port),
5151
options.Replica.Username,
5252
options.Replica.Password,

strata/cmd/mongo/lreplica_drivers/lrminiodriver/lrminiodriver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (factory DriverFactory) Driver() (*strata.Driver, error) {
8080

8181
replica, err := lreplica.NewLocalReplica(
8282
options.Replica.MaxBackgroundCopies,
83-
options.Replica.DatabaseHostname,
83+
options.Replica.LocalHostname,
8484
strconv.Itoa(options.Replica.Port),
8585
options.Replica.Username,
8686
options.Replica.Password,

strata/cmd/mongo/lreplica_drivers/lrs3driver/lrs3driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type AWSOptions struct {
2727

2828
// ReplicaOptions are used for commands like backup and restore
2929
type ReplicaOptions struct {
30-
DatabaseHostname string `long:"database-hostname" default:"localhost" description:"Database hostname can be override with a specific hostname in most cases localhost is sufficient"`
30+
LocalHostname string `long:"local-hostname" default:"localhost" description:"'localhost' or a hostname that is accessible on the local machine via e.g. kubernetes network"`
3131
MaxBackgroundCopies int `long:"max-background-copies" default:"16" description:"Backup and restore actions will use up to this many goroutines to copy files"`
3232
Port int `long:"port" default:"27017" description:"Backup should look for a mongod instance that is listening on this port"`
3333
Username string `long:"username" description:"If auth is configured, specify the username with admin privileges here"`
@@ -72,7 +72,7 @@ func (factory DriverFactory) Driver() (*strata.Driver, error) {
7272
}
7373
replica, err := lreplica.NewLocalReplica(
7474
options.Replica.MaxBackgroundCopies,
75-
options.Replica.DatabaseHostname,
75+
options.Replica.LocalHostname,
7676
strconv.Itoa(options.Replica.Port),
7777
options.Replica.Username,
7878
options.Replica.Password,

strata/mongo/lreplica/replica.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ import (
2525
)
2626

2727
type sessionGetter interface {
28-
get(sslAllowInvalidCertificates bool, databaseHostname, port, username, password string) (*mgo.Session, error)
28+
get(sslAllowInvalidCertificates bool, localHostname, port, username, password string) (*mgo.Session, error)
2929
}
3030

3131
type localSessionGetter struct{}
3232

3333
// port could be the empty string
34-
func (l *localSessionGetter) get(sslAllowInvalidCertificates bool, databaseHostname, port, username, password string) (*mgo.Session, error) {
35-
addr := databaseHostname
34+
func (l *localSessionGetter) get(sslAllowInvalidCertificates bool, localHostname, port, username, password string) (*mgo.Session, error) {
35+
addr := localHostname
3636
if port != "" {
3737
addr += ":" + port
3838
}
@@ -68,7 +68,7 @@ func (l *localSessionGetter) get(sslAllowInvalidCertificates bool, databaseHostn
6868
// LocalReplica is a replica where all methods that take a ReplicaID must be
6969
// run on the host corresponding to ReplicaID
7070
type LocalReplica struct {
71-
databaseHostname string
71+
localHostname string
7272
port string
7373
username string
7474
password string
@@ -78,11 +78,11 @@ type LocalReplica struct {
7878
}
7979

8080
// NewLocalReplica constructs a LocalReplica
81-
func NewLocalReplica(maxBackgroundCopies int, databaseHostname, port, username, password string, sslAllowInvalidCertificates bool) (*LocalReplica, error) {
81+
func NewLocalReplica(maxBackgroundCopies int, localHostname, port, username, password string, sslAllowInvalidCertificates bool) (*LocalReplica, error) {
8282
return &LocalReplica{
8383
sessionGetter: &localSessionGetter{},
8484
maxBackgroundCopies: maxBackgroundCopies,
85-
databaseHostname: databaseHostname,
85+
localHostname: localHostname,
8686
port: port,
8787
username: username,
8888
password: password,
@@ -198,7 +198,7 @@ func nestedBsonMapGet(m bson.M, arg string, moreArgs ...string) (interface{}, er
198198
// TODO(agf): Have a way to pass in tags
199199
func (r *LocalReplica) CreateSnapshot(replicaID, snapshotID string) (*strata.Snapshot, error) {
200200
strata.Log("Getting session for CreateSnapshot()")
201-
session, err := r.sessionGetter.get(r.sslAllowInvalidCertificates, r.databaseHostname, r.port, r.username, r.password)
201+
session, err := r.sessionGetter.get(r.sslAllowInvalidCertificates, r.localHostname, r.port, r.username, r.password)
202202
if err != nil {
203203
return nil, err
204204
}

0 commit comments

Comments
 (0)