Skip to content

Commit d256518

Browse files
committed
fix: cross-workspace nameless exec dup issue
when the same nameless exec is used across workspaces, it sometimes may not be the exec returned. this fixes the issue by including the ws in the returned id
1 parent faf86f3 commit d256518

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

types/executable/executable.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,14 @@ func NewExecutableID(workspace, namespace, name string) string {
518518
switch {
519519
case ws == "":
520520
return "" // TODO: return error or log warning
521+
case ns == "" && name == "":
522+
return ws + "/" // nameless executable
521523
case ns != "" && name == "":
522524
return fmt.Sprintf("%s:", ns)
523525
case ns != "":
524526
return fmt.Sprintf("%s/%s:%s", ws, ns, name)
525-
case name != "":
527+
default:
526528
return fmt.Sprintf("%s/%s", ws, name)
527-
default: // ws != "" && ns == "" && name == ""
528-
// for now, exclude the workspace from the string (until we can indicate that it's root / not named in the tui)
529-
return ""
530529
}
531530
}
532531

0 commit comments

Comments
 (0)