From 04b40474a7b96eaa85f006fa85dff3211c169096 Mon Sep 17 00:00:00 2001 From: zeromake Date: Mon, 26 Aug 2024 14:06:20 +0800 Subject: [PATCH] feat: use version default use 1.40 --- internal/config/version-0.7.10.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 internal/config/version-0.7.10.go diff --git a/internal/config/version-0.7.10.go b/internal/config/version-0.7.10.go new file mode 100644 index 0000000..1be7a40 --- /dev/null +++ b/internal/config/version-0.7.10.go @@ -0,0 +1,28 @@ +package config + +import ( + "github.com/blang/semver" + "github.com/docker/docker/api" +) + +// Up000710 update version 0.7.10 +func Up000710(conf *Config) error { + for _, c := range conf.DockerConfig { + // 强制切换为 1.40 + if c.Version == "" || c.Version == api.DefaultVersion { + c.Version = "1.40" + } + } + return nil +} + +func init() { + v, err := semver.Parse("0.7.10") + if err != nil { + return + } + migrationArr = append(migrationArr, &migration{ + Up: Up000710, + Version: v, + }) +}