From 1e825ca29b166b03975ada6d49b73f6e537e0cfd Mon Sep 17 00:00:00 2001 From: devad Date: Mon, 18 Dec 2023 11:49:21 +0800 Subject: [PATCH] =?UTF-8?q?cloud=E8=A1=A8namespace=E5=8F=96nsID=E7=9A=84?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: devad Former-commit-id: 33a134e92fc39c41e0db3d5c1cac037617f818c4 --- pkg/scheduler/cloudScheduler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/scheduler/cloudScheduler.go b/pkg/scheduler/cloudScheduler.go index 915a66df..e2e17fc3 100644 --- a/pkg/scheduler/cloudScheduler.go +++ b/pkg/scheduler/cloudScheduler.go @@ -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) { cloud := cs.UnMarshalK8sStruct(resource, task.TaskId, task.NsID) cloud.Id = utils.GenSnowflakeID() - cloud.YamlString = resource cloud.NsID = task.NsID cloud.ParticipantId = participantId @@ -93,6 +92,9 @@ func (cs *cloudScheduler) UnMarshalK8sStruct(yamlString string, taskId int64, ns if len(unstructureObj.GetNamespace()) == 0 { cloud.Namespace = "default" } + //unstructureObj转成string + unString, _ := unstructureObj.MarshalJSON() + cloud.YamlString = string(unString) } return cloud }