mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-29 18:27:58 +08:00
Fix the inconsistency between the console and cluster data after opening the plug-in for the component
This commit is contained in:
parent
8af5fe8bff
commit
07dc0719b4
@ -154,14 +154,22 @@ func (s *ServiceAction) SetTenantServicePluginRelation(tenantID, serviceID strin
|
||||
tx.Rollback()
|
||||
return nil, util.CreateAPIHandleErrorFromDBError("set service plugin env error ", err)
|
||||
}
|
||||
tsprCPU := pluginversion.ContainerCPU
|
||||
tsprMemory := pluginversion.ContainerMemory
|
||||
if pss.Body.PluginCPU != 0 {
|
||||
tsprCPU = pss.Body.PluginCPU
|
||||
}
|
||||
if pss.Body.PluginMemory != 0 {
|
||||
tsprMemory = pss.Body.PluginMemory
|
||||
}
|
||||
relation := &dbmodel.TenantServicePluginRelation{
|
||||
VersionID: pss.Body.VersionID,
|
||||
ServiceID: serviceID,
|
||||
PluginID: pss.Body.PluginID,
|
||||
Switch: pss.Body.Switch,
|
||||
PluginModel: plugin.PluginModel,
|
||||
ContainerCPU: pluginversion.ContainerCPU,
|
||||
ContainerMemory: pluginversion.ContainerMemory,
|
||||
ContainerCPU: tsprCPU,
|
||||
ContainerMemory: tsprMemory,
|
||||
}
|
||||
if err := db.GetManager().TenantServicePluginRelationDaoTransactions(tx).AddModel(relation); err != nil {
|
||||
tx.Rollback()
|
||||
|
Loading…
Reference in New Issue
Block a user