mirror of
https://kolaente.dev/konrad/docker-db-backup.git
synced 2026-01-10 21:10:07 +01:00
fix: find db images with all kinds of tags
This commit is contained in:
11
dump.go
11
dump.go
@@ -11,12 +11,13 @@ type Dumper interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewDumperFromContainer(container *types.ContainerJSON) Dumper {
|
func NewDumperFromContainer(container *types.ContainerJSON) Dumper {
|
||||||
switch container.Config.Image {
|
|
||||||
case "mysql":
|
// Containers contain the tags, therefore we need to check them one by one
|
||||||
fallthrough
|
if strings.HasPrefix(container.Config.Image, "mysql") || strings.HasPrefix(container.Config.Image, "mariadb") {
|
||||||
case "mariadb":
|
|
||||||
return NewMysqlDumper(container)
|
return NewMysqlDumper(container)
|
||||||
case "postgres":
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(container.Config.Image, "postgres") {
|
||||||
return NewPostgresDumper(container)
|
return NewPostgresDumper(container)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user