Merge pull request #519 from fanyangyang/issue/449

fix import app error
This commit is contained in:
barnettZQG 2019-11-01 06:28:42 -05:00 committed by GitHub
commit 5181967f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,9 +339,11 @@ func (i *ImportApp) importPlugins() error {
return image
}
if oldimage, ok := plugin.CheckGet("share_image"); ok {
appKey, _ := plugin.Get("service_key").String()
i.oldPluginPath[appKey], _ = oldimage.String()
pluginID, _ := plugin.Get("plugin_id").String()
i.oldPluginPath[pluginID], _ = oldimage.String()
plugin.Set("share_image", getImageImage())
} else {
logrus.Warnf("plugin do not found share_image, skip it")
}
oldPlugins[index] = plugin
}
@ -387,7 +389,7 @@ func (i *ImportApp) importPlugins() error {
user := plugin.Get("plugin_image.hub_user").String()
pass := plugin.Get("plugin_image.hub_password").String()
// 上传之前先要根据新的仓库地址修改镜像名
image := i.oldPluginPath[plugin.Get("service_key").String()]
image := i.oldPluginPath[plugin.Get("plugin_id").String()]
imageName := sources.ImageNameWithNamespaceHandle(image)
saveImageName := fmt.Sprintf("%s/%s:%s", builder.REGISTRYDOMAIN, imageName.Name, imageName.Tag)
newImageName := plugin.Get("share_image").String()