Skip to content

Commit

Permalink
fix getWorkerID when mac addresses have captalized letters
Browse files Browse the repository at this point in the history
Signed-off-by: Moath Qasim <[email protected]>
  • Loading branch information
moadqassem committed Apr 22, 2021
1 parent 89f7a80 commit dea02b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ func getWorkerIDbyIP(ctx context.Context, db *sql.DB, ip string) (string, error)
}

func getWorkerID(ctx context.Context, db *sql.DB, addr string) (string, error) {
_, err := net.ParseMAC(addr)
parsedMAC, err := net.ParseMAC(addr)
if err != nil {
ip := net.ParseIP(addr)
if ip == nil || ip.To4() == nil {
Expand All @@ -772,7 +772,7 @@ func getWorkerID(ctx context.Context, db *sql.DB, addr string) (string, error) {
return id, errors.WithMessage(err, "no worker found")

}
id, err := getWorkerIDbyMac(ctx, db, addr)
id, err := getWorkerIDbyMac(ctx, db, parsedMAC.String())
return id, errors.WithMessage(err, "no worker found")
}

Expand Down

0 comments on commit dea02b3

Please sign in to comment.