Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ce2aa1

Browse files
authored
fix: improve ssh config logic when workspaces change (#59)
- previously, ssh reconfiguration was triggered only when new workspaceswere added, andthe ssh config was generated only with the additional environmentsremoving the configurationfor the previous ones. This means that when a new workspace is createdfrom the web dashboard, the old workspaces are no longer accessible via ssh from Toolbox- now, the logic ensures ssh reconfiguration happens whenever the set ofenvironments changes(including additions or removals), making it more robust, andconfiguration happens for all valid workspaces.-resolves#14
1 parentddfffe1 commit2ce2aa1

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
##Unreleased
44

5+
###Fixed
6+
7+
- SSH config is regenerated correctly when Workspaces are added or removed
8+
59
##0.1.0 - 2025-04-01
610

711
###Added

‎src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,9 @@ class CoderRemoteEnvironment(
194194
*/
195195
overridefunequals(other:Any?):Boolean {
196196
if (other==null)returnfalse
197-
if (this=== other)returntrue// Note the triple ===
197+
if (this=== other)returntrue
198198
if (other!isCoderRemoteEnvironment)returnfalse
199-
if (id!= other.id)returnfalse
200-
returntrue
199+
return id== other.id
201200
}
202201

203202
/**

‎src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ class CoderRemoteProvider(
113113
return@launch
114114
}
115115

116-
// Reconfigure if a new environment is found.
117-
// TODO@JB: Should we use the add/remove listeners instead?
118-
val newEnvironments= resolvedEnvironments.subtract(lastEnvironments)
119-
if (newEnvironments.isNotEmpty()) {
120-
context.logger.info("Found new environment(s), reconfiguring CLI:$newEnvironments")
121-
cli.configSsh(newEnvironments.map { it.name }.toSet())
116+
117+
// Reconfigure if environments changed.
118+
if (lastEnvironments.size!= resolvedEnvironments.size|| lastEnvironments!= resolvedEnvironments) {
119+
context.logger.info("Workspaces have changed, reconfiguring CLI:$resolvedEnvironments")
120+
cli.configSsh(resolvedEnvironments.map { it.name }.toSet())
122121
}
123122

124123
environments.update {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp