diff --git a/pkg/workceptor/remote_work.go b/pkg/workceptor/remote_work.go index b29a8cbc5..7aec7773b 100644 --- a/pkg/workceptor/remote_work.go +++ b/pkg/workceptor/remote_work.go @@ -184,7 +184,7 @@ func (rw *remoteUnit) startRemoteUnit(ctx context.Context, conn net.Conn, reader if err != nil { return fmt.Errorf("read error reading from %s: %s", red.RemoteNode, err) } - submitIDRegex := regexp.MustCompile(`with ID ([.\-_@a-zA-Z0-9]+)\.`) + submitIDRegex := regexp.MustCompile(`with ID ([a-zA-Z0-9]+)\.`) match := submitIDRegex.FindSubmatch([]byte(response)) if match == nil || len(match) != 2 { return fmt.Errorf("could not parse response: %s", strings.TrimRight(response, "\n")) diff --git a/pkg/workceptor/workceptor.go b/pkg/workceptor/workceptor.go index 674ecfc99..199867466 100644 --- a/pkg/workceptor/workceptor.go +++ b/pkg/workceptor/workceptor.go @@ -13,6 +13,7 @@ import ( "os" "path" "reflect" + "regexp" "strings" "sync" "time" @@ -162,7 +163,7 @@ func (w *Workceptor) generateUnitID(lock bool, workUnitID string) (string, error for { if workUnitID == "" { rstr := randstr.RandomString(8) - nid := w.nc.NodeID() + nid := regexp.MustCompile(`[^a-zA-Z0-9 ]+`).ReplaceAllString(w.nc.NodeID(), "") ident = fmt.Sprintf("%s%s", nid, rstr) } else { ident = workUnitID