mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
[FIX] fix bug that slug path not have tenantid
This commit is contained in:
parent
1b5efe94fc
commit
84acfa7f0d
@ -156,14 +156,13 @@ func (s *ServiceAction) buildFromMarketSlug(r *api_model.BuildServiceStruct, ser
|
||||
body["deploy_version"] = r.Body.DeployVersion
|
||||
body["event_id"] = r.Body.EventID
|
||||
body["tenant_name"] = r.Body.TenantName
|
||||
body["tenant_id"] = service.TenantID
|
||||
body["service_id"] = service.ServiceID
|
||||
body["service_alias"] = r.Body.ServiceAlias
|
||||
body["slug_info"] = r.Body.SlugInfo
|
||||
return s.sendTask(body, "build_from_market_slug")
|
||||
}
|
||||
func (s *ServiceAction) buildFromImage(r *api_model.BuildServiceStruct, service *dbmodel.TenantServices) error {
|
||||
if r.Body.EventID == "" {
|
||||
return fmt.Errorf("args error")
|
||||
}
|
||||
dependIds, err := db.GetManager().TenantServiceRelationDao().GetTenantServiceRelations(service.ServiceID)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -100,6 +100,7 @@ func (s *ServiceShareHandle) Share(serviceID string, ss api_model.ServiceShare)
|
||||
"share_info": ss.Body,
|
||||
"service_alias": ss.ServiceAlias,
|
||||
"service_id": serviceID,
|
||||
"tenant_id": tenantID,
|
||||
"tenant_name": ss.TenantName,
|
||||
"image_name": shareImageName,
|
||||
"share_id": shareID,
|
||||
|
@ -124,11 +124,8 @@ func (i *ImageBuildItem) Run(timeout time.Duration) error {
|
||||
|
||||
//ImageNameHandler 根据平台配置处理镜像名称
|
||||
func (i *ImageBuildItem) ImageNameHandler(source string) string {
|
||||
currRegistry := i.Config.Get("publish > image > curr_registry").(string)
|
||||
allRegistry := i.Config.Get("publish > image > all_registry").(string)
|
||||
logrus.Debugf("curr all resigtry is %s, %s", currRegistry, allRegistry)
|
||||
imageModel := sources.ImageNameHandle(source)
|
||||
localImageURL := fmt.Sprintf("%s/%s:%s_%s", currRegistry, imageModel.Name, imageModel.Tag, i.ServiceAlias)
|
||||
localImageURL := fmt.Sprintf("%s/%s:%s", "goodrain.me", imageModel.Name, i.DeployVersion)
|
||||
return localImageURL
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
|
||||
"github.com/twinj/uuid"
|
||||
|
||||
"github.com/goodrain/rainbond/pkg/util"
|
||||
@ -38,6 +40,7 @@ func CopyFileWithProgress(src, dst string, logger event.Logger) error {
|
||||
if logger != nil {
|
||||
logger.Error("打开源文件失败", map[string]string{"step": "share"})
|
||||
}
|
||||
logrus.Errorf("open file %s error", src)
|
||||
return err
|
||||
}
|
||||
defer srcFile.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user