Skip to content

feat: modify config-ssh to set the host suffix #17280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
additional testing
  • Loading branch information
spikecurtis committed Apr 8, 2025
commit 35b4021c9c6250a2986918db2944db3c765bf971
19 changes: 17 additions & 2 deletions cli/configssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
},
},
{
name: "Start/End out of order",
name: "Start/End out of order",
matches: []match{
// {match: "Continue?", write: "yes"},
},
Expand All @@ -524,7 +524,7 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
wantErr: true,
},
{
name: "Multiple sections",
name: "Multiple sections",
matches: []match{
// {match: "Continue?", write: "yes"},
},
Expand Down Expand Up @@ -620,9 +620,24 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
wantErr: false,
hasAgent: true,
wantConfig: wantConfig{
ssh: []string{"Host coder.* *.testy"},
regexMatch: `ProxyCommand .* ssh .* --hostname-suffix testy %h`,
},
},
{
name: "Hostname Prefix and Suffix",
args: []string{
"--yes",
"--ssh-host-prefix", "presto.",
"--hostname-suffix", "testy",
},
wantErr: false,
hasAgent: true,
wantConfig: wantConfig{
ssh: []string{"Host presto.* *.testy"},
regexMatch: `ProxyCommand .* ssh .* --ssh-host-prefix presto\. --hostname-suffix testy %h`,
},
},
}
for _, tt := range tests {
tt := tt
Expand Down