mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
fix wrong service type
This commit is contained in:
parent
e76aa6952e
commit
9b2cd6717e
@ -117,19 +117,19 @@ func (s ServiceType) IsSingleton() bool {
|
||||
|
||||
// TODO fanyangyang 根据组件简单判断是否是有状态
|
||||
// IsState is state service or stateless service
|
||||
func (ts TenantServices) IsState() bool {
|
||||
if ts.ServiceType == "" {
|
||||
func (ts *TenantServices) IsState() bool {
|
||||
if ts.ExtendMethod == "" {
|
||||
return false
|
||||
}
|
||||
return ServiceType(ts.ServiceType).IsState()
|
||||
return ServiceType(ts.ExtendMethod).IsState()
|
||||
}
|
||||
|
||||
// IsSingleton is singleton or multiple service
|
||||
func (ts TenantServices) IsSingleton() bool {
|
||||
if ts.ServiceType == "" {
|
||||
func (ts *TenantServices) IsSingleton() bool {
|
||||
if ts.ExtendMethod == "" {
|
||||
return false
|
||||
}
|
||||
return ServiceType(ts.ServiceType).IsSingleton()
|
||||
return ServiceType(ts.ExtendMethod).IsSingleton()
|
||||
}
|
||||
|
||||
// ServiceTypeUnknown unknown
|
||||
|
@ -111,19 +111,15 @@ func TenantServiceBase(as *v1.AppService, dbmanager db.Manager) error {
|
||||
return nil
|
||||
}
|
||||
//TODO fanyangyang 根据组件类型确定是否支持
|
||||
serviceInfo, err := dbmanager.TenantServiceDao().GetServiceTypeById(as.ServiceID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("get service type info failure %s", err.Error())
|
||||
}
|
||||
label, err := dbmanager.TenantServiceLabelDao().GetLabelByNodeSelectorKey(as.ServiceID, "windows")
|
||||
if label != nil {
|
||||
as.IsWindowsService = true
|
||||
}
|
||||
if serviceInfo == nil || !serviceInfo.IsState() {
|
||||
if tenantService == nil || !tenantService.IsState() {
|
||||
initBaseDeployment(as, tenantService)
|
||||
return nil
|
||||
}
|
||||
if serviceInfo.IsState() {
|
||||
if tenantService.IsState() {
|
||||
initBaseStatefulSet(as, tenantService)
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user