Skip to content

Commit a918cca

Browse files
committed
refactor: better method naming
1 parent 8cb49d1 commit a918cca

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/main/kotlin/com/coder/toolbox/sdk/CoderRestClient.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,9 @@ open class CoderRestClient(
192192
}
193193

194194
/**
195-
* Retrieves all the agent names for all workspaces, including those that
196-
* are off. Meant to be used when configuring SSH.
195+
* Maps the list of workspaces to the associated agents.
197196
*/
198-
suspend fun withAgents(workspaces: List<Workspace>): Set<Pair<Workspace, WorkspaceAgent>> {
197+
suspend fun groupByAgents(workspaces: List<Workspace>): Set<Pair<Workspace, WorkspaceAgent>> {
199198
// It is possible for there to be resources with duplicate names so we
200199
// need to use a set.
201200
return workspaces.flatMap { ws ->

src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ open class CoderProtocolHandler(
162162
}
163163

164164
context.logger.info("Configuring Coder CLI...")
165-
cli.configSsh(restClient.withAgents(workspaces))
165+
cli.configSsh(restClient.groupByAgents(workspaces))
166166

167167
if (shouldWaitForAutoLogin) {
168168
isInitialized.waitForTrue()

0 commit comments

Comments
 (0)