8000 fix: Clean up `coder config-ssh` dry-run behavior by mafredri · Pull Request #3660 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: Clean up coder config-ssh dry-run behavior #3660

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 4 commits into from
Aug 24, 2022

Conversation

mafredri
Copy link
Member
@mafredri mafredri commented Aug 24, 2022

Now the dry-run won't ask for a final confirm at the end, it has felt weird every time I've used it.

This commit also drops old deprecated code.

Dry run:

❯ ./coder config-ssh -o ForwardAgent=yes -n
> New options differ from previous options:

  New options:
    * ssh-option: ForwardAgent=yes

  Previous options:
    * ssh-option: ForwardAgent=no

  Use new options? (yes/no) yes

Dry run, the following changes would be made to your SSH configuration:

  * Use new SSH option
  * Update the coder section in /home/maf/.ssh/config

--- /home/maf/.ssh/config
+++ /home/maf/.ssh/config
@@ -20,10 +20,10 @@
 # changes will be lost when running "coder config-ssh".
 #
 # Last config-ssh options:
-# :ssh-option=ForwardAgent=no
+# :ssh-option=ForwardAgent=yes
 #
 Host coder.test
-	ForwardAgent=no
+	ForwardAgent=yes
 	HostName coder.test
 	ConnectTimeout=0
 	StrictHostKeyChecking=no

Run that made changes:

❯ ./coder config-ssh -o ForwardAgent=yes -y
You should now be able to ssh into your workspace.
For example, try running:

	$ ssh coder.test

No changes:

❯ ./coder config-ssh -o ForwardAgent=yes -y
No changes to make.

Fixes #2982

@mafredri mafredri self-assigned this Aug 24, 2022
@mafredri mafredri requested a review from a team August 24, 2022 12:28
Copy link
Member
@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

Makes sense 👍

@mafredri mafredri merged commit 343d118 into main Aug 24, 2022
@mafredri mafredri deleted the mafredri/config-ssh-dry-run-cleanup branch August 24, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: coder config-ssh --dry-run suggests to connect to workspace even config was not updated yet
3 participants
0