Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make new workunit backward compatible #1232

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/workceptor/remote_work.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
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]+)\.`)

Check warning on line 187 in pkg/workceptor/remote_work.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/remote_work.go#L187

Added line #L187 was not covered by tests
match := submitIDRegex.FindSubmatch([]byte(response))
if match == nil || len(match) != 2 {
return fmt.Errorf("could not parse response: %s", strings.TrimRight(response, "\n"))
Expand Down
3 changes: 2 additions & 1 deletion pkg/workceptor/workceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os"
"path"
"reflect"
"regexp"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -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
Expand Down
Loading