pcm-openstack/internal/pkg/cron/taskcron.go

33 lines
713 B
Go

package cron
import (
"context"
"github.com/zeromicro/go-zero/core/logx"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore"
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc"
"gitlink.org.cn/jcce-pcm/utils/tool"
)
func SyncTask(svc *svc.ServiceContext) {
participantId, err := tool.GetParticipantId("etc/kubernetes.yaml")
if err != nil {
return
}
// 查询core端分发下来的任务列表
infoReq := pcmCore.InfoListReq{
Kind: "cloud",
ParticipantId: participantId,
}
_, err = svc.PcmCoreRpc.InfoList(context.Background(), &infoReq)
if err != nil {
logx.Error(err)
return
}
// 提交任务
// 查询Deployment列表
// 遍历core端任务列表信息
}