From 2ac379f6891954266edfde683efb1193b3cdfbe9 Mon Sep 17 00:00:00 2001 From: Caleb Brose <5447118+cmbrose@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:54:07 -0500 Subject: [PATCH] Comment --- pkg/cmd/codespace/ssh.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 3072d251b..5ded0a8a7 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -251,6 +251,9 @@ func setupAutomaticSSHKeys(sshContext ssh.Context) (*ssh.KeyPair, error) { return keyPair, nil } +// checkAndUpdateOldKeyPair handles backward compatibility with the old keypair names. +// If the old public and private keys both exist they are renamed to the new name. +// The return value is non-nil only if the rename happens. func checkAndUpdateOldKeyPair(sshContext ssh.Context) *ssh.KeyPair { publicKeys, err := sshContext.LocalPublicKeys() if err != nil {