File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
src/main/kotlin/com/coder/gateway/util Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -327,17 +327,16 @@ internal fun getMatchingAgent(
327
327
}
328
328
329
329
// If the agent is missing and the workspace has only one, use that.
330
- // Prefer the ID over the name if both are set.
331
- val agent =
332
- if (! parameters.agentID().isNullOrBlank()) {
333
- agents.firstOrNull { it.id.toString() == parameters.agentID() }
334
- } else if (! parameters.agentName().isNullOrBlank()) {
335
- agents.firstOrNull { it.name == parameters.agentName() }
336
- } else if (agents.size == 1 ) {
337
- agents.first()
338
- } else {
339
- null
340
- }
330
+ // Prefer the name over the id if both are set.
331
+ val agent = if (! parameters.agentName().isNullOrBlank()) {
332
+ agents.firstOrNull { it.name == parameters.agentName() }
333
+ } else if (! parameters.agentID().isNullOrBlank()) {
334
+ agents.firstOrNull { it.id.toString() == parameters.agentID() }
335
+ } else if (agents.size == 1 ) {
336
+ agents.first()
337
+ } else {
338
+ null
339
+ }
341
340
342
341
if (agent == null ) {
343
342
if (! parameters.agentID().isNullOrBlank()) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ fun Map<String, String>.owner() = this[OWNER]
29
29
30
30
fun Map <String , String ?>.agentName () = this [AGENT_NAME ]
31
31
32
+ @Deprecated(" Use the agent name instead" )
32
33
fun Map <String , String ?>.agentID () = this [AGENT_ID ]
33
34
34
35
fun Map <String , String >.folder () = this [FOLDER ]
You can’t perform that action at this time.
0 commit comments