Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to modify chart in MongoDB and MysqlDB structs #1637

Merged
merged 3 commits into from
Sep 15, 2022
Merged
Changes from 1 commit
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
18 changes: 16 additions & 2 deletions pkg/app/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,19 @@ type MongoDB struct {
chart helm.ChartInfo
}

type MongoDBOptions func(*MongoDB)

func MongoDBChartValues(values map[string]string) MongoDBOptions {
return func(db *MongoDB) {
for k, v := range values {
db.chart.Values[k] = v
}
}
}

// Last tested working version "9.0.0"
func NewMongoDB(name string) App {
return &MongoDB{
func NewMongoDB(name string, opts ...MongoDBOptions) App {
m := MongoDB{
username: "root",
name: name,
chart: helm.ChartInfo{
Expand All @@ -68,6 +78,10 @@ func NewMongoDB(name string) App {
},
},
}
for _, opt := range opts {
opt(&m)
}
return &m
ihcsim marked this conversation as resolved.
Show resolved Hide resolved
}

func (mongo *MongoDB) Init(ctx context.Context) error {
Expand Down