Skip to content

yaml: phase 2 DBConfigs#6094

Merged
sougou merged 10 commits intovitessio:masterfrom
planetscale:ss-dbconfigs-yaml
Apr 21, 2020
Merged

yaml: phase 2 DBConfigs#6094
sougou merged 10 commits intovitessio:masterfrom
planetscale:ss-dbconfigs-yaml

Conversation

@sougou
Copy link
Copy Markdown
Contributor

@sougou sougou commented Apr 19, 2020

We continue to support backward compatibility.

@sougou sougou requested a review from morgo as a code owner April 19, 2020 21:22
@sougou sougou requested a review from harshit-gangal April 19, 2020 21:22
@sougou sougou force-pushed the ss-dbconfigs-yaml branch from 612bee9 to 7b4f88a Compare April 19, 2020 21:23
sougou added 9 commits April 20, 2020 19:54
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou force-pushed the ss-dbconfigs-yaml branch from 7b4f88a to 0a7860c Compare April 21, 2020 02:54
Comment on lines +140 to +144
flag.StringVar(&uc.User, "db-config-"+userKey+"-uname", "vt_"+userKey, "deprecated: use "+newUserFlag)
flag.StringVar(&uc.User, newUserFlag, "vt_"+userKey, "db "+userKey+" user userKey")

newPasswordFlag := "db_" + userKey + "_password"
flag.StringVar(&dbc.param.Pass, "db-config-"+userKey+"-pass", "", "db "+userKey+" deprecated: use "+newPasswordFlag)
flag.StringVar(&dbc.param.Pass, newPasswordFlag, "", "db "+userKey+" password")

flag.BoolVar(&dbc.useSSL, "db_"+userKey+"_use_ssl", true, "Set this flag to false to make the "+userKey+" connection to not use ssl")

flag.StringVar(&dbc.param.Host, "db-config-"+userKey+"-host", "", "deprecated: use db_host")
flag.IntVar(&dbc.param.Port, "db-config-"+userKey+"-port", 0, "deprecated: use db_port")
flag.StringVar(&dbc.param.UnixSocket, "db-config-"+userKey+"-unixsocket", "", "deprecated: use db_socket")
flag.StringVar(&dbc.param.Charset, "db-config-"+userKey+"-charset", "utf8", "deprecated: use db_charset")
flag.Uint64Var(&dbc.param.Flags, "db-config-"+userKey+"-flags", 0, "deprecated: use db_flags")
flag.StringVar(&dbc.param.SslCa, "db-config-"+userKey+"-ssl-ca", "", "deprecated: use db_ssl_ca")
flag.StringVar(&dbc.param.SslCaPath, "db-config-"+userKey+"-ssl-ca-path", "", "deprecated: use db_ssl_ca_path")
flag.StringVar(&dbc.param.SslCert, "db-config-"+userKey+"-ssl-cert", "", "deprecated: use db_ssl_cert")
flag.StringVar(&dbc.param.SslKey, "db-config-"+userKey+"-ssl-key", "", "deprecated: use db_ssl_key")
flag.StringVar(&dbc.param.ServerName, "db-config-"+userKey+"-server_name", "", "deprecated: use db_server_name")
flag.StringVar(&dbc.param.Flavor, "db-config-"+userKey+"-flavor", "", "deprecated: use db_flavor")

flag.StringVar(&dbc.param.DeprecatedDBName, "db-config-"+userKey+"-dbname", "", "deprecated: dbname does not need to be explicitly configured")
flag.StringVar(&uc.Password, "db-config-"+userKey+"-pass", "", "db "+userKey+" deprecated: use "+newPasswordFlag)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making deprecated flag with recent flag backward compatible :)

Comment on lines +313 to +318
dbcfgs.App.Password = "****"
dbcfgs.Dba.Password = "****"
dbcfgs.Filtered.Password = "****"
dbcfgs.Repl.Password = "****"
dbcfgs.Appdebug.Password = "****"
dbcfgs.Allprivs.Password = "****"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fun.. does this needs to be done for ssl connections?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just general safety whether it's SSL or not.

Comment on lines +182 to +183
// Clone dbcfgs and override SidecarDBName because there will be one for each db.
copydbcfgs := dbcfgs.Clone()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the cloning required? SidecarDBName setting is removed in the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's safer. I also think the DBName will get set differently for each tablet.

Comment on lines +17 to +19
// Package yaml2 ensures that the right yaml package gets imported.
// The default package that goimports adds is not the one we want to use.
package yaml2
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice hack.

@harshit-gangal
Copy link
Copy Markdown
Member

We continue to support backward compatibility.

should be we continue to support backward compatibility on deprecated db config flags as well.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou merged commit e9f07a4 into vitessio:master Apr 21, 2020
@sougou sougou deleted the ss-dbconfigs-yaml branch April 22, 2020 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants