Skip to content

Commit ee36371

Browse files
committed
Rename GetRsaPrivateKeyPath to GetECDSAPrivateKeyPath for backward compatibility
We were using RSA Algo long time ago and this function is used to provide a backward compatibility for that version of crc but since in previous commit we have updated the ssh algo from ecdsa to ed25519, to have the backward compatibility for some released version we are renaming this function.
1 parent 7bb32ee commit ee36371

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/crc/constants/constants.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ func GetHostDockerSocketPath() string {
185185
return filepath.Join(MachineInstanceDir, DefaultName, "docker.sock")
186186
}
187187

188-
// For backward compatibility to v 1.20.0
189-
func GetRsaPrivateKeyPath() string {
190-
return filepath.Join(MachineInstanceDir, DefaultName, "id_rsa")
188+
// For backward compatibility to v 2.40.0
189+
func GetECDSAPrivateKeyPath() string {
190+
return filepath.Join(MachineInstanceDir, DefaultName, "id_ecdsa")
191191
}
192192

193193
func GetKubeAdminPasswordPath() string {

pkg/crc/machine/ip.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ func (client *client) ConnectionDetails() (*types.ConnectionDetails, error) {
2121
IP: ip,
2222
SSHPort: vm.SSHPort(),
2323
SSHUsername: constants.DefaultSSHUser,
24-
SSHKeys: []string{constants.GetPrivateKeyPath(), constants.GetRsaPrivateKeyPath(), vm.bundle.GetSSHKeyPath()},
24+
SSHKeys: []string{constants.GetPrivateKeyPath(), constants.GetECDSAPrivateKeyPath(), vm.bundle.GetSSHKeyPath()},
2525
}, nil
2626
}

pkg/crc/machine/virtualmachine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,5 @@ func (vm *virtualMachine) SSHRunner() (*ssh.Runner, error) {
106106
if err != nil {
107107
return nil, err
108108
}
109-
return ssh.CreateRunner(ip, vm.SSHPort(), constants.GetPrivateKeyPath(), constants.GetRsaPrivateKeyPath(), vm.bundle.GetSSHKeyPath())
109+
return ssh.CreateRunner(ip, vm.SSHPort(), constants.GetPrivateKeyPath(), constants.GetECDSAPrivateKeyPath(), vm.bundle.GetSSHKeyPath())
110110
}

0 commit comments

Comments
 (0)