cloud表namespace取nsID的值
Signed-off-by: devad <cossjie@foxmail.com> Former-commit-id: 33a134e92fc39c41e0db3d5c1cac037617f818c4
This commit is contained in:
parent
cefbf7ecf5
commit
1e825ca29b
|
@ -49,7 +49,6 @@ func (cs *cloudScheduler) pickOptimalStrategy(task *algo.Task, providers ...*alg
|
||||||
func (cs *cloudScheduler) getNewStructForDb(task *response.TaskInfo, resource string, participantId int64) (interface{}, error) {
|
func (cs *cloudScheduler) getNewStructForDb(task *response.TaskInfo, resource string, participantId int64) (interface{}, error) {
|
||||||
cloud := cs.UnMarshalK8sStruct(resource, task.TaskId, task.NsID)
|
cloud := cs.UnMarshalK8sStruct(resource, task.TaskId, task.NsID)
|
||||||
cloud.Id = utils.GenSnowflakeID()
|
cloud.Id = utils.GenSnowflakeID()
|
||||||
cloud.YamlString = resource
|
|
||||||
cloud.NsID = task.NsID
|
cloud.NsID = task.NsID
|
||||||
|
|
||||||
cloud.ParticipantId = participantId
|
cloud.ParticipantId = participantId
|
||||||
|
@ -93,6 +92,9 @@ func (cs *cloudScheduler) UnMarshalK8sStruct(yamlString string, taskId int64, ns
|
||||||
if len(unstructureObj.GetNamespace()) == 0 {
|
if len(unstructureObj.GetNamespace()) == 0 {
|
||||||
cloud.Namespace = "default"
|
cloud.Namespace = "default"
|
||||||
}
|
}
|
||||||
|
//unstructureObj转成string
|
||||||
|
unString, _ := unstructureObj.MarshalJSON()
|
||||||
|
cloud.YamlString = string(unString)
|
||||||
}
|
}
|
||||||
return cloud
|
return cloud
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue