Skip to content

Commit 2ec7404

Browse files
chore: make owner_name and owner_username consistent (coder#18081)
We've been using owner_name inconsistently as username. So this PR fixes it by making the attribute naming more consistent.
1 parent 3a2e362 commit 2ec7404

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+151
-131
lines changed

agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ func (a *agent) createOrUpdateNetwork(manifestOK, networkOK *checkpoint) func(co
12001200
network := a.network
12011201
a.closeMutex.Unlock()
12021202
if network == nil {
1203-
keySeed, err := SSHKeySeed(manifest.OwnerName, manifest.WorkspaceName, manifest.AgentName)
1203+
keySeed, err := SSHKeySeed(manifest.OwnerUsername, manifest.WorkspaceName, manifest.AgentName)
12041204
if err != nil {
12051205
return xerrors.Errorf("generate SSH key seed: %w", err)
12061206
}

cli/exp_scaletest.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,8 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
10271027
BytesPerTick: bytesPerTick,
10281028
Duration: strategy.timeout,
10291029
TickInterval: tickInterval,
1030-
ReadMetrics: metrics.ReadMetrics(ws.OwnerName, ws.Name, agent.Name),
1031-
WriteMetrics: metrics.WriteMetrics(ws.OwnerName, ws.Name, agent.Name),
1030+
ReadMetrics: metrics.ReadMetrics(ws.OwnerUsername, ws.Name, agent.Name),
1031+
WriteMetrics: metrics.WriteMetrics(ws.OwnerUsername, ws.Name, agent.Name),
10321032
SSH: ssh,
10331033
Echo: ssh,
10341034
App: appConfig,
@@ -1420,7 +1420,7 @@ func isScaleTestUser(user codersdk.User) bool {
14201420
}
14211421

14221422
func isScaleTestWorkspace(workspace codersdk.Workspace) bool {
1423-
return strings.HasPrefix(workspace.OwnerName, "scaletest-") ||
1423+
return strings.HasPrefix(workspace.OwnerUsername, "scaletest-") ||
14241424
strings.HasPrefix(workspace.Name, "scaletest-")
14251425
}
14261426

@@ -1592,7 +1592,7 @@ func createWorkspaceAppConfig(client *codersdk.Client, appHost, app string, work
15921592

15931593
c.URL = fmt.Sprintf("%s://%s", client.URL.Scheme, strings.Replace(appHost, "*", agent.Apps[i].SubdomainName, 1))
15941594
} else {
1595-
c.URL = fmt.Sprintf("%s/@%s/%s.%s/apps/%s", client.URL.String(), workspace.OwnerName, workspace.Name, agent.Name, agent.Apps[i].Slug)
1595+
c.URL = fmt.Sprintf("%s/@%s/%s.%s/apps/%s", client.URL.String(), workspace.OwnerUsername, workspace.Name, agent.Name, agent.Apps[i].Slug)
15961596
}
15971597

15981598
return c, nil

cli/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func workspaceListRowFromWorkspace(now time.Time, workspace codersdk.Workspace)
5454
if workspace.Favorite {
5555
favIco = "★"
5656
}
57-
workspaceName := favIco + " " + workspace.OwnerName + "/" + workspace.Name
57+
workspaceName := favIco + " " + workspace.OwnerUsername + "/" + workspace.Name
5858
return workspaceListRow{
5959
Favorite: workspace.Favorite,
6060
Workspace: workspace,

cli/open.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ func buildVSCodeWorkspaceLink(
403403
) (*url.URL, url.Values) {
404404
qp := url.Values{}
405405
qp.Add("url", clientURL)
406-
qp.Add("owner", workspace.OwnerName)
406+
qp.Add("owner", workspace.OwnerUsername)
407407
qp.Add("workspace", workspace.Name)
408408
qp.Add("agent", workspaceAgent.Name)
409409

@@ -435,7 +435,7 @@ func buildVSCodeWorkspaceDevContainerLink(
435435

436436
qp := url.Values{}
437437
qp.Add("url", clientURL)
438-
qp.Add("owner", workspace.OwnerName)
438+
qp.Add("owner", workspace.OwnerUsername)
439439
qp.Add("workspace", workspace.Name)
440440
qp.Add("agent", workspaceAgent.Name)
441441
qp.Add("devContainerName", containerName)
@@ -596,7 +596,7 @@ func buildAppLinkURL(baseURL *url.URL, workspace codersdk.Workspace, agent coder
596596
u.Path = fmt.Sprintf(
597597
"%s/@%s/%s.%s/apps/%s/",
598598
preferredPathBase,
599-
workspace.OwnerName,
599+
workspace.OwnerUsername,
600600
workspace.Name,
601601
agent.Name,
602602
url.PathEscape(app.Slug),
@@ -606,7 +606,7 @@ func buildAppLinkURL(baseURL *url.URL, workspace codersdk.Workspace, agent coder
606606
u.Path = fmt.Sprintf(
607607
"%s/@%s/%s.%s/terminal",
608608
preferredPathBase,
609-
workspace.OwnerName,
609+
workspace.OwnerUsername,
610610
workspace.Name,
611611
agent.Name,
612612
)

cli/open_internal_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ func Test_buildAppLinkURL(t *testing.T) {
9191
name: "without subdomain",
9292
baseURL: "https://coder.tld",
9393
workspace: codersdk.Workspace{
94-
Name: "Test-Workspace",
95-
OwnerName: "username",
94+
Name: "Test-Workspace",
95+
OwnerUsername: "username",
9696
},
9797
agent: codersdk.WorkspaceAgent{
9898
Name: "a-workspace-agent",
@@ -108,8 +108,8 @@ func Test_buildAppLinkURL(t *testing.T) {
108108
name: "with command",
109109
baseURL: "https://coder.tld",
110110
workspace: codersdk.Workspace{
111-
Name: "Test-Workspace",
112-
OwnerName: "username",
111+
Name: "Test-Workspace",
112+
OwnerUsername: "username",
113113
},
114114
agent: codersdk.WorkspaceAgent{
115115
Name: "a-workspace-agent",
@@ -123,8 +123,8 @@ func Test_buildAppLinkURL(t *testing.T) {
123123
name: "with subdomain",
124124
baseURL: "ftps://coder.tld",
125125
workspace: codersdk.Workspace{
126-
Name: "Test-Workspace",
127-
OwnerName: "username",
126+
Name: "Test-Workspace",
127+
OwnerUsername: "username",
128128
},
129129
agent: codersdk.WorkspaceAgent{
130130
Name: "a-workspace-agent",
@@ -141,8 +141,8 @@ func Test_buildAppLinkURL(t *testing.T) {
141141
name: "with subdomain, but not apps host",
142142
baseURL: "https://coder.tld",
143143
workspace: codersdk.Workspace{
144-
Name: "Test-Workspace",
145-
OwnerName: "username",
144+
Name: "Test-Workspace",
145+
OwnerUsername: "username",
146146
},
147147
agent: codersdk.WorkspaceAgent{
148148
Name: "a-workspace-agent",

cli/restart_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ func TestRestartWithParameters(t *testing.T) {
342342
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
343343
defer cancel()
344344

345-
workspace, err := client.WorkspaceByOwnerAndName(ctx, workspace.OwnerName, workspace.Name, codersdk.WorkspaceOptions{})
345+
workspace, err := client.WorkspaceByOwnerAndName(ctx, workspace.OwnerUsername, workspace.Name, codersdk.WorkspaceOptions{})
346346
require.NoError(t, err)
347347
actualParameters, err := client.WorkspaceBuildParameters(ctx, workspace.LatestBuild.ID)
348348
require.NoError(t, err)
@@ -393,7 +393,7 @@ func TestRestartWithParameters(t *testing.T) {
393393
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
394394
defer cancel()
395395

396-
workspace, err := client.WorkspaceByOwnerAndName(ctx, workspace.OwnerName, workspace.Name, codersdk.WorkspaceOptions{})
396+
workspace, err := client.WorkspaceByOwnerAndName(ctx, workspace.OwnerUsername, workspace.Name, codersdk.WorkspaceOptions{})
397397
require.NoError(t, err)
398398
actualParameters, err := client.WorkspaceBuildParameters(ctx, workspace.LatestBuild.ID)
399399
require.NoError(t, err)

cli/schedule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func scheduleListRowFromWorkspace(now time.Time, workspace codersdk.Workspace) s
327327
}
328328
}
329329
return scheduleListRow{
330-
WorkspaceName: workspace.OwnerName + "/" + workspace.Name,
330+
WorkspaceName: workspace.OwnerUsername + "/" + workspace.Name,
331331
StartsAt: autostartDisplay,
332332
StartsNext: nextStartDisplay,
333333
StopsAfter: autostopDisplay,

cli/schedule_test.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ func setupTestSchedule(t *testing.T, sched *cron.Schedule) (ownerClient, memberC
7171
// Ensure same order as in CLI output
7272
ws = resp.Workspaces
7373
sort.Slice(ws, func(i, j int) bool {
74-
a := ws[i].OwnerName + "/" + ws[i].Name
75-
b := ws[j].OwnerName + "/" + ws[j].Name
74+
a := ws[i].OwnerUsername + "/" + ws[i].Name
75+
b := ws[j].OwnerUsername + "/" + ws[j].Name
7676
return a < b
7777
})
7878

@@ -102,13 +102,13 @@ func TestScheduleShow(t *testing.T) {
102102

103103
// Then: they should see their own workspaces.
104104
// 1st workspace: a-owner-ws1 has both autostart and autostop enabled.
105-
pty.ExpectMatch(ws[0].OwnerName + "/" + ws[0].Name)
105+
pty.ExpectMatch(ws[0].OwnerUsername + "/" + ws[0].Name)
106106
pty.ExpectMatch(sched.Humanize())
107107
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
108108
pty.ExpectMatch("8h")
109109
pty.ExpectMatch(ws[0].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
110110
// 2nd workspace: b-owner-ws2 has only autostart enabled.
111-
pty.ExpectMatch(ws[1].OwnerName + "/" + ws[1].Name)
111+
pty.ExpectMatch(ws[1].OwnerUsername + "/" + ws[1].Name)
112112
pty.ExpectMatch(sched.Humanize())
113113
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
114114
})
@@ -123,21 +123,21 @@ func TestScheduleShow(t *testing.T) {
123123

124124
// Then: they should see all workspaces
125125
// 1st workspace: a-owner-ws1 has both autostart and autostop enabled.
126-
pty.ExpectMatch(ws[0].OwnerName + "/" + ws[0].Name)
126+
pty.ExpectMatch(ws[0].OwnerUsername + "/" + ws[0].Name)
127127
pty.ExpectMatch(sched.Humanize())
128128
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
129129
pty.ExpectMatch("8h")
130130
pty.ExpectMatch(ws[0].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
131131
// 2nd workspace: b-owner-ws2 has only autostart enabled.
132-
pty.ExpectMatch(ws[1].OwnerName + "/" + ws[1].Name)
132+
pty.ExpectMatch(ws[1].OwnerUsername + "/" + ws[1].Name)
133133
pty.ExpectMatch(sched.Humanize())
134134
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
135135
// 3rd workspace: c-member-ws3 has only autostop enabled.
136-
pty.ExpectMatch(ws[2].OwnerName + "/" + ws[2].Name)
136+
pty.ExpectMatch(ws[2].OwnerUsername + "/" + ws[2].Name)
137137
pty.ExpectMatch("8h")
138138
pty.ExpectMatch(ws[2].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
139139
// 4th workspace: d-member-ws4 has neither autostart nor autostop enabled.
140-
pty.ExpectMatch(ws[3].OwnerName + "/" + ws[3].Name)
140+
pty.ExpectMatch(ws[3].OwnerUsername + "/" + ws[3].Name)
141141
})
142142

143143
t.Run("OwnerSearchByName", func(t *testing.T) {
@@ -150,22 +150,22 @@ func TestScheduleShow(t *testing.T) {
150150

151151
// Then: they should see workspaces matching that query
152152
// 2nd workspace: b-owner-ws2 has only autostart enabled.
153-
pty.ExpectMatch(ws[1].OwnerName + "/" + ws[1].Name)
153+
pty.ExpectMatch(ws[1].OwnerUsername + "/" + ws[1].Name)
154154
pty.ExpectMatch(sched.Humanize())
155155
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
156156
})
157157

158158
t.Run("OwnerOneArg", func(t *testing.T) {
159159
// When: owner asks for a specific workspace by name
160-
inv, root := clitest.New(t, "schedule", "show", ws[2].OwnerName+"/"+ws[2].Name)
160+
inv, root := clitest.New(t, "schedule", "show", ws[2].OwnerUsername+"/"+ws[2].Name)
161161
//nolint:gocritic // Testing that owner user sees all
162162
clitest.SetupConfig(t, ownerClient, root)
163163
pty := ptytest.New(t).Attach(inv)
164164
require.NoError(t, inv.Run())
165165

166166
// Then: they should see that workspace
167167
// 3rd workspace: c-member-ws3 has only autostop enabled.
168-
pty.ExpectMatch(ws[2].OwnerName + "/" + ws[2].Name)
168+
pty.ExpectMatch(ws[2].OwnerUsername + "/" + ws[2].Name)
169169
pty.ExpectMatch("8h")
170170
pty.ExpectMatch(ws[2].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
171171
})
@@ -179,11 +179,11 @@ func TestScheduleShow(t *testing.T) {
179179

180180
// Then: they should see their own workspaces
181181
// 1st workspace: c-member-ws3 has only autostop enabled.
182-
pty.ExpectMatch(ws[2].OwnerName + "/" + ws[2].Name)
182+
pty.ExpectMatch(ws[2].OwnerUsername + "/" + ws[2].Name)
183183
pty.ExpectMatch("8h")
184184
pty.ExpectMatch(ws[2].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
185185
// 2nd workspace: d-member-ws4 has neither autostart nor autostop enabled.
186-
pty.ExpectMatch(ws[3].OwnerName + "/" + ws[3].Name)
186+
pty.ExpectMatch(ws[3].OwnerUsername + "/" + ws[3].Name)
187187
})
188188

189189
t.Run("MemberAll", func(t *testing.T) {
@@ -200,11 +200,11 @@ func TestScheduleShow(t *testing.T) {
200200

201201
// Then: they should only see their own
202202
// 1st workspace: c-member-ws3 has only autostop enabled.
203-
pty.ExpectMatch(ws[2].OwnerName + "/" + ws[2].Name)
203+
pty.ExpectMatch(ws[2].OwnerUsername + "/" + ws[2].Name)
204204
pty.ExpectMatch("8h")
205205
pty.ExpectMatch(ws[2].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
206206
// 2nd workspace: d-member-ws4 has neither autostart nor autostop enabled.
207-
pty.ExpectMatch(ws[3].OwnerName + "/" + ws[3].Name)
207+
pty.ExpectMatch(ws[3].OwnerUsername + "/" + ws[3].Name)
208208
})
209209

210210
t.Run("JSON", func(t *testing.T) {
@@ -231,25 +231,25 @@ func TestScheduleShow(t *testing.T) {
231231
return a < b
232232
})
233233
// 1st workspace: a-owner-ws1 has both autostart and autostop enabled.
234-
assert.Equal(t, ws[0].OwnerName+"/"+ws[0].Name, parsed[0]["workspace"])
234+
assert.Equal(t, ws[0].OwnerUsername+"/"+ws[0].Name, parsed[0]["workspace"])
235235
assert.Equal(t, sched.Humanize(), parsed[0]["starts_at"])
236236
assert.Equal(t, sched.Next(now).In(loc).Format(time.RFC3339), parsed[0]["starts_next"])
237237
assert.Equal(t, "8h", parsed[0]["stops_after"])
238238
assert.Equal(t, ws[0].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339), parsed[0]["stops_next"])
239239
// 2nd workspace: b-owner-ws2 has only autostart enabled.
240-
assert.Equal(t, ws[1].OwnerName+"/"+ws[1].Name, parsed[1]["workspace"])
240+
assert.Equal(t, ws[1].OwnerUsername+"/"+ws[1].Name, parsed[1]["workspace"])
241241
assert.Equal(t, sched.Humanize(), parsed[1]["starts_at"])
242242
assert.Equal(t, sched.Next(now).In(loc).Format(time.RFC3339), parsed[1]["starts_next"])
243243
assert.Empty(t, parsed[1]["stops_after"])
244244
assert.Empty(t, parsed[1]["stops_next"])
245245
// 3rd workspace: c-member-ws3 has only autostop enabled.
246-
assert.Equal(t, ws[2].OwnerName+"/"+ws[2].Name, parsed[2]["workspace"])
246+
assert.Equal(t, ws[2].OwnerUsername+"/"+ws[2].Name, parsed[2]["workspace"])
247247
assert.Empty(t, parsed[2]["starts_at"])
248248
assert.Empty(t, parsed[2]["starts_next"])
249249
assert.Equal(t, "8h", parsed[2]["stops_after"])
250250
assert.Equal(t, ws[2].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339), parsed[2]["stops_next"])
251251
// 4th workspace: d-member-ws4 has neither autostart nor autostop enabled.
252-
assert.Equal(t, ws[3].OwnerName+"/"+ws[3].Name, parsed[3]["workspace"])
252+
assert.Equal(t, ws[3].OwnerUsername+"/"+ws[3].Name, parsed[3]["workspace"])
253253
assert.Empty(t, parsed[3]["starts_at"])
254254
assert.Empty(t, parsed[3]["starts_next"])
255255
assert.Empty(t, parsed[3]["stops_after"])
@@ -272,61 +272,61 @@ func TestScheduleModify(t *testing.T) {
272272
t.Run("SetStart", func(t *testing.T) {
273273
// When: we set the start schedule
274274
inv, root := clitest.New(t,
275-
"schedule", "start", ws[3].OwnerName+"/"+ws[3].Name, "7:30AM", "Mon-Fri", "Europe/Dublin",
275+
"schedule", "start", ws[3].OwnerUsername+"/"+ws[3].Name, "7:30AM", "Mon-Fri", "Europe/Dublin",
276276
)
277277
//nolint:gocritic // this workspace is not owned by the same user
278278
clitest.SetupConfig(t, ownerClient, root)
279279
pty := ptytest.New(t).Attach(inv)
280280
require.NoError(t, inv.Run())
281281

282282
// Then: the updated schedule should be shown
283-
pty.ExpectMatch(ws[3].OwnerName + "/" + ws[3].Name)
283+
pty.ExpectMatch(ws[3].OwnerUsername + "/" + ws[3].Name)
284284
pty.ExpectMatch(sched.Humanize())
285285
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
286286
})
287287

288288
t.Run("SetStop", func(t *testing.T) {
289289
// When: we set the stop schedule
290290
inv, root := clitest.New(t,
291-
"schedule", "stop", ws[2].OwnerName+"/"+ws[2].Name, "8h30m",
291+
"schedule", "stop", ws[2].OwnerUsername+"/"+ws[2].Name, "8h30m",
292292
)
293293
//nolint:gocritic // this workspace is not owned by the same user
294294
clitest.SetupConfig(t, ownerClient, root)
295295
pty := ptytest.New(t).Attach(inv)
296296
require.NoError(t, inv.Run())
297297

298298
// Then: the updated schedule should be shown
299-
pty.ExpectMatch(ws[2].OwnerName + "/" + ws[2].Name)
299+
pty.ExpectMatch(ws[2].OwnerUsername + "/" + ws[2].Name)
300300
pty.ExpectMatch("8h30m")
301301
pty.ExpectMatch(ws[2].LatestBuild.Deadline.Time.In(loc).Format(time.RFC3339))
302302
})
303303

304304
t.Run("UnsetStart", func(t *testing.T) {
305305
// When: we unset the start schedule
306306
inv, root := clitest.New(t,
307-
"schedule", "start", ws[1].OwnerName+"/"+ws[1].Name, "manual",
307+
"schedule", "start", ws[1].OwnerUsername+"/"+ws[1].Name, "manual",
308308
)
309309
//nolint:gocritic // this workspace is owned by owner
310310
clitest.SetupConfig(t, ownerClient, root)
311311
pty := ptytest.New(t).Attach(inv)
312312
require.NoError(t, inv.Run())
313313

314314
// Then: the updated schedule should be shown
315-
pty.ExpectMatch(ws[1].OwnerName + "/" + ws[1].Name)
315+
pty.ExpectMatch(ws[1].OwnerUsername + "/" + ws[1].Name)
316316
})
317317

318318
t.Run("UnsetStop", func(t *testing.T) {
319319
// When: we unset the stop schedule
320320
inv, root := clitest.New(t,
321-
"schedule", "stop", ws[0].OwnerName+"/"+ws[0].Name, "manual",
321+
"schedule", "stop", ws[0].OwnerUsername+"/"+ws[0].Name, "manual",
322322
)
323323
//nolint:gocritic // this workspace is owned by owner
324324
clitest.SetupConfig(t, ownerClient, root)
325325
pty := ptytest.New(t).Attach(inv)
326326
require.NoError(t, inv.Run())
327327

328328
// Then: the updated schedule should be shown
329-
pty.ExpectMatch(ws[0].OwnerName + "/" + ws[0].Name)
329+
pty.ExpectMatch(ws[0].OwnerUsername + "/" + ws[0].Name)
330330
})
331331
}
332332

@@ -359,15 +359,15 @@ func TestScheduleOverride(t *testing.T) {
359359

360360
// When: we override the stop schedule
361361
inv, root := clitest.New(t,
362-
"schedule", tt.command, ws[0].OwnerName+"/"+ws[0].Name, "10h",
362+
"schedule", tt.command, ws[0].OwnerUsername+"/"+ws[0].Name, "10h",
363363
)
364364

365365
clitest.SetupConfig(t, ownerClient, root)
366366
pty := ptytest.New(t).Attach(inv)
367367
require.NoError(t, inv.Run())
368368

369369
// Then: the updated schedule should be shown
370-
pty.ExpectMatch(ws[0].OwnerName + "/" + ws[0].Name)
370+
pty.ExpectMatch(ws[0].OwnerUsername + "/" + ws[0].Name)
371371
pty.ExpectMatch(sched.Humanize())
372372
pty.ExpectMatch(sched.Next(now).In(loc).Format(time.RFC3339))
373373
pty.ExpectMatch("8h")

cli/ssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (r *RootCmd) ssh() *serpent.Command {
305305
return xerrors.Errorf("get agent connection info: %w", err)
306306
}
307307
coderConnectHost := fmt.Sprintf("%s.%s.%s.%s",
308-
workspaceAgent.Name, workspace.Name, workspace.OwnerName, connInfo.HostnameSuffix)
308+
workspaceAgent.Name, workspace.Name, workspace.OwnerUsername, connInfo.HostnameSuffix)
309309
exists, _ := workspacesdk.ExistsViaCoderConnect(ctx, coderConnectHost)
310310
if exists {
311311
defer cancel()
@@ -1022,7 +1022,7 @@ func verifyWorkspaceOutdated(client *codersdk.Client, workspace codersdk.Workspa
10221022

10231023
// Build the user workspace link which navigates to the Coder web UI.
10241024
func buildWorkspaceLink(serverURL *url.URL, workspace codersdk.Workspace) *url.URL {
1025-
return serverURL.ResolveReference(&url.URL{Path: fmt.Sprintf("@%s/%s", workspace.OwnerName, workspace.Name)})
1025+
return serverURL.ResolveReference(&url.URL{Path: fmt.Sprintf("@%s/%s", workspace.OwnerUsername, workspace.Name)})
10261026
}
10271027

10281028
// runLocal runs a command on the local machine.

0 commit comments

Comments
 (0)