From 7288c6153d66502772889d15bef310ee2a88ce66 Mon Sep 17 00:00:00 2001 From: Kelly Deng Date: Tue, 28 Apr 2020 01:12:19 -0400 Subject: [PATCH] fixed mac reference not found --- db/workflow.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/db/workflow.go b/db/workflow.go index b40851ccc..4bca75ac0 100644 --- a/db/workflow.go +++ b/db/workflow.go @@ -149,7 +149,7 @@ func insertActionList(ctx context.Context, db *sql.DB, yamlData string, id uuid. if err != nil { return err } else if workerID == "" { - return fmt.Errorf("Target mentioned with refernece %s not found", task.WorkerAddr) + return fmt.Errorf("Target mentioned with reference %s not found", task.WorkerAddr) } workerUID, err := uuid.FromString(workerID) if err != nil { @@ -724,13 +724,9 @@ func parseYaml(ymlContent []byte) (*wfYamlstruct, error) { func getWorkerIDbyMac(ctx context.Context, db *sql.DB, mac string) (string, error) { arg := ` { - "network_ports": [ - { - "data": { + "dhcp": { "mac": "` + mac + `" - } - } - ] + } } ` query := ` @@ -745,6 +741,7 @@ func getWorkerIDbyMac(ctx context.Context, db *sql.DB, mac string) (string, erro return get(ctx, db, query, arg) } +// TODO: update query for ip addresses as well func getWorkerIDbyIP(ctx context.Context, db *sql.DB, ip string) (string, error) { instance := ` {