Skip to content

Commit e4c8769

Browse files
author
cdosso
committed
Add resources fallback if workspace latestBuild is empty
1 parent f0b57cd commit e4c8769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ open class CoderRestClient(
182182
// It is possible for there to be resources with duplicate names so we
183183
// need to use a set.
184184
return workspaces.flatMap { ws ->
185-
ws.latestBuild.resources.filter { it.agents != null }.flatMap { it.agents!! }.map {
185+
ws.latestBuild.resources.ifEmpty { resources(ws) }.filter { it.agents != null }.flatMap { it.agents!! }.map {
186186
"${ws.name}.${it.name}"
187187
}
188188
}.toSet()

0 commit comments

Comments
 (0)