Skip to content
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 internal/campaigns/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func detectBestWorkspaceCreator(ctx context.Context, steps []Step) workspaceCrea
}

uids[uid] = struct{}{}
if len(uids) > 1 {
if len(uids) > 1 || uid != 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ugly, but simplifies the revert later.

return workspaceCreatorBind
}
}
Expand Down
7 changes: 3 additions & 4 deletions internal/campaigns/workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ func TestBestWorkspaceCreator(t *testing.T) {
"same user": {
behaviours: map[string]expect.Behaviour{
"foo": {Stdout: []byte("1000\n")},
"bar": {Stdout: []byte("1000\n")},
},
want: workspaceCreatorVolume,
want: workspaceCreatorBind,
},
"different user": {
behaviours: map[string]expect.Behaviour{
"foo": {Stdout: []byte("1000\n")},
"bar": {Stdout: []byte("0\n")},
"foo": {Stdout: []byte("0\n")},
"bar": {Stdout: []byte("1000\n")},
},
want: workspaceCreatorBind,
},
Expand Down