Skip to content

Commit

Permalink
fixed mac reference not found
Browse files Browse the repository at this point in the history
  • Loading branch information
kqdeng committed Apr 28, 2020
1 parent 668d830 commit 7288c61
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions db/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 := `
Expand All @@ -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 := `
{
Expand Down

0 comments on commit 7288c61

Please sign in to comment.