mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 10:48:15 +08:00
fix install volume bugs
This commit is contained in:
parent
998b61d949
commit
29a7d3e36a
@ -554,11 +554,18 @@ func (s *ServiceAction) ServiceCreate(sc *api_model.ServiceStruct) error {
|
||||
v.HostPath = fmt.Sprintf("%s/tenant/%s/service/%s%s", sharePath, sc.TenantID, ts.ServiceID, volumn.VolumePath)
|
||||
//本地文件存储
|
||||
case dbmodel.LocalVolumeType.String():
|
||||
if sc.ExtendMethod != "state" {
|
||||
if !dbmodel.ServiceType(sc.ExtendMethod).IsState() {
|
||||
tx.Rollback()
|
||||
return util.CreateAPIHandleError(400, fmt.Errorf("应用类型不为有状态应用.不支持本地存储"))
|
||||
return util.CreateAPIHandleError(400, fmt.Errorf("应用类型为无状态组件.不支持本地存储"))
|
||||
}
|
||||
v.HostPath = fmt.Sprintf("%s/tenant/%s/service/%s%s", localPath, sc.TenantID, ts.ServiceID, volumn.VolumePath)
|
||||
case dbmodel.ConfigFileVolumeType.String(), dbmodel.MemoryFSVolumeType.String():
|
||||
logrus.Debug("simple volume type : ", volumn.VolumeType)
|
||||
default:
|
||||
if !dbmodel.ServiceType(sc.ExtendMethod).IsState() {
|
||||
tx.Rollback()
|
||||
return util.CreateAPIHandleError(400, fmt.Errorf("应用类型为无状态组件.不支持自定义存储"))
|
||||
}
|
||||
}
|
||||
}
|
||||
if volumn.VolumeName == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user