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 {