diff --git a/internal/database/dialect/mariadb.go b/internal/database/dialect/mariadb.go index a3be1494..df714c92 100644 --- a/internal/database/dialect/mariadb.go +++ b/internal/database/dialect/mariadb.go @@ -22,7 +22,7 @@ func (MariaDB) DefaultPort() uint16 { } func (MariaDB) DatabaseEnvNames() []string { - return []string{"MARIADB_DATABASE"} + return []string{"MARIADB_DATABASE", "MYSQL_DATABASE"} } func (MariaDB) ListDatabasesQuery() string { @@ -34,7 +34,7 @@ func (MariaDB) ListTablesQuery() string { } func (MariaDB) UserEnvNames() []string { - return []string{"MARIADB_USER"} + return []string{"MARIADB_USER", "MYSQL_USER"} } func (MariaDB) DefaultUser() string { @@ -55,6 +55,13 @@ func (MariaDB) PodLabels() []kubernetes.LabelQueryable { {Name: "app.kubernetes.io/name", Value: "mariadb"}, {Name: "app.kubernetes.io/component", Value: "primary"}, }, + kubernetes.LabelQueryAnd{ + {Name: "app.kubernetes.io/name", Value: "mariadb-galera"}, + }, + kubernetes.LabelQueryAnd{ + {Name: "app.kubernetes.io/name", Value: "mysql"}, + {Name: "app.kubernetes.io/component", Value: "primary"}, + }, kubernetes.LabelQuery{Name: "app", Value: "mariadb"}, } } @@ -65,9 +72,9 @@ func (MariaDB) FilterPods(ctx context.Context, client kubernetes.KubeClient, pod func (db MariaDB) PasswordEnvNames(c config.Global) []string { if c.Username == db.DefaultUser() { - return []string{"MARIADB_ROOT_PASSWORD"} + return []string{"MARIADB_ROOT_PASSWORD", "MYSQL_ROOT_PASSWORD"} } - return []string{"MARIADB_PASSWORD"} + return []string{"MARIADB_PASSWORD", "MYSQL_PASSWORD"} } func (MariaDB) ExecCommand(conf config.Exec) *command.Builder { diff --git a/internal/database/dialect/mongodb.go b/internal/database/dialect/mongodb.go index 726f3273..29691284 100644 --- a/internal/database/dialect/mongodb.go +++ b/internal/database/dialect/mongodb.go @@ -55,6 +55,10 @@ func (MongoDB) PodLabels() []kubernetes.LabelQueryable { {Name: "app.kubernetes.io/name", Value: "mongodb"}, {Name: "app.kubernetes.io/component", Value: "mongodb"}, }, + kubernetes.LabelQueryAnd{ + {Name: "app.kubernetes.io/name", Value: "mongodb-sharded"}, + {Name: "app.kubernetes.io/component", Value: "mongos"}, + }, kubernetes.LabelQuery{Name: "app", Value: "mongodb"}, } }