Skip to content

Commit

Permalink
Update juju/replicaset/v2 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyworld committed Nov 26, 2021
1 parent 2022315 commit 80b8602
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/jujud/agent/agenttest/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func InstallFakeEnsureMongo(suite patchingSuite) *FakeEnsureMongo {
ServiceInstalled: true,
}
suite.PatchValue(&mongo.IsServiceInstalled, f.IsServiceInstalled)
suite.PatchValue(&replicaset.CurrentConfig, f.CurrentConfig)
suite.PatchValue(&mongo.CurrentReplicasetConfig, f.CurrentConfig)
suite.PatchValue(&cmdutil.EnsureMongoServer, f.EnsureMongo)
return f
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/jujud/agent/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/juju/mgo/v2"
"github.com/juju/names/v4"
"github.com/juju/pubsub/v2"
"github.com/juju/replicaset/v2"
"github.com/juju/utils/v2"
"github.com/juju/utils/v2/symlink"
"github.com/juju/utils/v2/voyeur"
Expand Down Expand Up @@ -125,7 +124,7 @@ func init() {
safe := mgo.Safe{}
if ProductionMongoWriteConcern {
safe.J = true
_, err := replicaset.CurrentConfig(session)
_, err := mongo.CurrentReplicasetConfig(session)
if err == nil {
// set mongo to write-majority (writes only returned after
// replicated to a majority of replica-set members).
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ require (
github.com/juju/proxy v0.0.0-20210817195502-c6015cfe0258
github.com/juju/pubsub/v2 v2.0.0-20210804115646-050d38a80f5b
github.com/juju/ratelimit v1.0.2-0.20191002062651-f60b32039441
github.com/juju/replicaset/v2 v2.0.1-0.20210310024806-bbbdc5f31eb3
github.com/juju/replicaset/v2 v2.0.1-0.20211125220232-7967ce535201
github.com/juju/retry v0.0.0-20180821225755-9058e192b216
github.com/juju/rfc/v2 v2.0.0-20210319034215-ed820200fad3
github.com/juju/romulus v0.0.0-20210309074704-4fa3bbd32568
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ github.com/juju/raft-boltdb v0.0.0-20200518034108-40b112c917c5 h1:+eWzUG6XLDSdcz
github.com/juju/raft-boltdb v0.0.0-20200518034108-40b112c917c5/go.mod h1:F7wHQBX+lEJkv9PhNCgNJgCeI+GISZW2RefLINbmgXU=
github.com/juju/ratelimit v1.0.2-0.20191002062651-f60b32039441 h1:b5Jqi7ir58EzfeZDyp7OSYQG/IVgyY4JWfHuJUF2AZI=
github.com/juju/ratelimit v1.0.2-0.20191002062651-f60b32039441/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk=
github.com/juju/replicaset/v2 v2.0.1-0.20210310024806-bbbdc5f31eb3 h1:PYmT5m/07JtXv8/DfSSw3bwD/1TpA9E83//jZldR8l4=
github.com/juju/replicaset/v2 v2.0.1-0.20210310024806-bbbdc5f31eb3/go.mod h1:NRTC6FXOBX/+Usgl6GjqU2VUcReSG8Odml56qE4bZ/g=
github.com/juju/replicaset/v2 v2.0.1-0.20211125220232-7967ce535201 h1:K8kT6VLLEpzdWaFPLL82Mv9weftax63lRa1SsV+ExNg=
github.com/juju/replicaset/v2 v2.0.1-0.20211125220232-7967ce535201/go.mod h1:NRTC6FXOBX/+Usgl6GjqU2VUcReSG8Odml56qE4bZ/g=
github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4=
github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4=
github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU=
Expand Down
5 changes: 5 additions & 0 deletions mongo/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,3 +771,8 @@ func providesMongoAsSnap(mongoDep packaging.Dependency, series string) bool {
}
return false
}

// CurrentReplicasetConfig is overridden in tests.
var CurrentReplicasetConfig = func(session *mgo.Session) (*replicaset.Config, error) {
return replicaset.CurrentConfig(session)
}

0 comments on commit 80b8602

Please sign in to comment.