From 8cbba392f4330cabd4e6afab2619ec65e4aa7fd3 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 5 Dec 2021 13:54:39 +0100 Subject: [PATCH] fix: find db images with all kinds of tags --- dump.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dump.go b/dump.go index f7e4f70..8661cc7 100644 --- a/dump.go +++ b/dump.go @@ -11,12 +11,13 @@ type Dumper interface { } func NewDumperFromContainer(container *types.ContainerJSON) Dumper { - switch container.Config.Image { - case "mysql": - fallthrough - case "mariadb": + + // Containers contain the tags, therefore we need to check them one by one + if strings.HasPrefix(container.Config.Image, "mysql") || strings.HasPrefix(container.Config.Image, "mariadb") { return NewMysqlDumper(container) - case "postgres": + } + + if strings.HasPrefix(container.Config.Image, "postgres") { return NewPostgresDumper(container) }