Skip to content

Conversation

@spikecurtis
Copy link
Contributor

@spikecurtis spikecurtis commented Apr 16, 2025

Adds a new hidden subcommand coder connect exists <hostname> that checks if the name exists via Coder Connect. This will be used in SSH config to match only if Coder Connect is unavailable for the hostname in question, so that the SSH client will directly dial the workspace over an existing Coder Connect tunnel.

Also refactors the way we inject a test DNS resolver into the lookup functions so that we can test from outside the workspacesdk package.

Copy link
Contributor Author

spikecurtis commented Apr 16, 2025

@spikecurtis spikecurtis marked this pull request as ready for review April 16, 2025 13:26
@spikecurtis spikecurtis force-pushed the spike/connect-exists-cmd branch from ecef684 to 169ab02 Compare April 16, 2025 13:30
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏻

//nolint:revive,gocritic
os.Exit(code)
}
if errors.Is(err, ErrSilent) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&exitError{code: 1} could potentially be used instead, but I see other uses of it have disappeared from the code base.

@spikecurtis spikecurtis force-pushed the spike/connect-exists-cmd branch from 169ab02 to a89e1c3 Compare April 17, 2025 06:57
@spikecurtis spikecurtis force-pushed the spike/connect-exists-cmd branch from a89e1c3 to dc5fab3 Compare April 17, 2025 07:12
@spikecurtis spikecurtis merged commit 3b54254 into main Apr 17, 2025
30 checks passed
Copy link
Contributor Author

Merge activity

  • Apr 17, 3:23 AM EDT: A user merged this pull request with Graphite.

@spikecurtis spikecurtis deleted the spike/connect-exists-cmd branch April 17, 2025 07:23
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants