[FIX] fix builder service id is empty bug

This commit is contained in:
barnett 2018-11-27 10:55:01 +08:00
parent 69750ab5d4
commit 42aeae9c66
2 changed files with 1 additions and 3 deletions

View File

@ -64,6 +64,7 @@ func NewImageBuildItem(in []byte) *ImageBuildItem {
Namespace: gjson.GetBytes(in, "namespace").String(),
TenantName: gjson.GetBytes(in, "tenant_name").String(),
ServiceAlias: gjson.GetBytes(in, "service_alias").String(),
ServiceID: gjson.GetBytes(in, "service_id").String(),
Image: gjson.GetBytes(in, "image").String(),
DeployVersion: gjson.GetBytes(in, "deploy_version").String(),
HubUser: gjson.GetBytes(in, "user").String(),

View File

@ -91,9 +91,6 @@ func (c *VersionInfoDaoImpl) GetVersionByEventID(eventID string) (*model.Version
func (c *VersionInfoDaoImpl) GetVersionByDeployVersion(version, serviceID string) (*model.VersionInfo, error) {
var result model.VersionInfo
if err := c.DB.Where("build_version =? and service_id = ?", version, serviceID).Find(&result).Error; err != nil {
if err == gorm.ErrRecordNotFound {
return nil, err
}
return nil, err
}
return &result, nil