Skip to content

Commit

Permalink
feat: helm-manager支持配置mongodb副本集名称 (#3641)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyudeqiu authored Dec 18, 2024
1 parent 1535138 commit 916976f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func main() {
// init mongo options
mongoOptions := &mongo.Options{
Hosts: strings.Split(C.Mongo.Address, ","),
Replicaset: C.Mongo.Replicaset,
ConnectTimeoutSeconds: int(C.Mongo.ConnectTimeout),
AuthDatabase: C.Mongo.AuthDatabase,
Database: C.Mongo.Database,
Expand Down
2 changes: 1 addition & 1 deletion bcs-services/bcs-helm-manager/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ replace (
)

require (
github.com/Tencent/bk-bcs/bcs-common v0.0.0-20240418123107-72b120390195
github.com/Tencent/bk-bcs/bcs-common v0.0.0-20241213022113-d2cc3e32d60c
github.com/Tencent/bk-bcs/bcs-common/common/encryptv2 v0.0.0-20230911112816-85f490b1c029
github.com/Tencent/bk-bcs/bcs-services/pkg v0.0.0-20240418123107-72b120390195
github.com/chartmuseum/helm-push v0.10.4
Expand Down
1 change: 1 addition & 0 deletions bcs-services/bcs-helm-manager/internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func (hm *HelmManager) initModel() error {
}
mongoOptions := &mongo.Options{
Hosts: strings.Split(hm.opt.Mongo.Address, ","),
Replicaset: hm.opt.Mongo.Replicaset,
ConnectTimeoutSeconds: int(hm.opt.Mongo.ConnectTimeout),
AuthDatabase: hm.opt.Mongo.AuthDatabase,
Database: hm.opt.Mongo.Database,
Expand Down
1 change: 1 addition & 0 deletions bcs-services/bcs-helm-manager/internal/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type ServerConfig struct {
// MongoConfig option for mongo
type MongoConfig struct {
Address string `json:"address" yaml:"address"`
Replicaset string `json:"replicaset" yaml:"replicaset"`
ConnectTimeout uint `json:"connectTimeout" yaml:"connectTimeout"`
AuthDatabase string `json:"authDatabase" yaml:"authDatabase"`
Database string `json:"database" yaml:"database"`
Expand Down

0 comments on commit 916976f

Please sign in to comment.