You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
chore: refactor flags that target workspaces in scaletest (#20537)
For thecoder/internal#913 we are going to be targeting running workspaces. So this PR modularizes the CLI flags and logic that select those targets so we can reuse it.
Description:"Name or ID of the template. Traffic generation will be limited to workspaces created from this template.",
402
+
Value:serpent.StringOf(&f.template),
403
+
},
404
+
serpent.Option{
405
+
Flag:"target-workspaces",
406
+
Env:"CODER_SCALETEST_TARGET_WORKSPACES",
407
+
Description:"Target a specific range of workspaces in the format [START]:[END] (exclusive). Example: 0:10 will target the 10 first alphabetically sorted workspaces (0-9).",
408
+
Value:serpent.StringOf(&f.targetWorkspaces),
409
+
},
410
+
serpent.Option{
411
+
Flag:"use-host-login",
412
+
Env:"CODER_SCALETEST_USE_HOST_LOGIN",
413
+
Default:"false",
414
+
Description:"Connect as the currently logged in user.",
415
+
Value:serpent.BoolOf(&f.useHostLogin),
416
+
},
417
+
)
418
+
}
419
+
420
+
// getTargetedWorkspaces retrieves the workspaces based on the template filter and target range. warnWriter is where to
421
+
// write a warning message if any workspaces were skipped due to ownership mismatch.
cliui.Warnf(warnWriter,"CODER_DISABLE_OWNER_WORKSPACE_ACCESS is set on the deployment.\n\t%d workspace(s) were skipped due to ownership mismatch.\n\tSet --use-host-login to only target workspaces you own.",numSkipped)
cliui.Warnf(inv.Stdout,"CODER_DISABLE_OWNER_WORKSPACE_ACCESS is set on the deployment.\n\t%d workspace(s) were skipped due to ownership mismatch.\n\tSet --use-host-login to only target workspaces you own.",numSkipped)
Description:"Name or ID of the template. Traffic generation will be limited to workspaces created from this template.",
1423
-
Value:serpent.StringOf(&template),
1424
-
},
1425
-
{
1426
-
Flag:"target-workspaces",
1427
-
Env:"CODER_SCALETEST_TARGET_WORKSPACES",
1428
-
Description:"Target a specific range of workspaces in the format [START]:[END] (exclusive). Example: 0:10 will target the 10 first alphabetically sorted workspaces (0-9).",