1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 14:21:55 +00:00

bugfix, hostname

This commit is contained in:
Newnius 2019-06-14 11:10:07 +08:00
parent 622040ecf3
commit ad1497bfbd
3 changed files with 10 additions and 14 deletions

View File

@ -55,8 +55,6 @@ func (jm *JobManager) start() {
v.Set("cpu_limit", strconv.Itoa(jm.job.Tasks[i].NumberCPU))
v.Set("network", network)
fmt.Println(v.Encode())
resp, err := doRequest("POST", "http://"+jm.resources[i].ClientHost+":8000/create", strings.NewReader(v.Encode()), "application/x-www-form-urlencoded", "")
if err != nil {
log.Println(err.Error())
@ -70,8 +68,6 @@ func (jm *JobManager) start() {
return
}
log.Println(string(body))
var res MsgCreate
err = json.Unmarshal([]byte(string(body)), &res)
if err != nil {

View File

@ -150,7 +150,6 @@ func (pool *ResourcePool) acquireNetwork() string {
v := url.Values{}
v.Set("name", network)
resp, err := doRequest("POST", "http://yao-agent-master:8000/create", strings.NewReader(v.Encode()), "application/x-www-form-urlencoded", "")
fmt.Print(resp, err)
if err != nil {
log.Println(err.Error())
continue

View File

@ -92,7 +92,7 @@ type MsgCreate struct {
type TaskStatus struct {
Id string `json:"id"`
Name string `json:"name"`
HostName string `json:"hostname"`
Node string `json:"node"`
Image string `json:"image"`
ImageDigest string `json:"image_digest"`
@ -100,6 +100,7 @@ type TaskStatus struct {
CreatedAt string `json:"created_at"`
FinishedAt string `json:"finished_at"`
Status string `json:"status"`
State map[string]interface{} `json:"state"`
}
type JobStatus struct {