Skip to content

Commit

Permalink
Rename GetRsaPrivateKeyPath to GetECDSAPrivateKeyPath for backward co…
Browse files Browse the repository at this point in the history
…mpatibility

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.
  • Loading branch information
praveenkumar committed Aug 7, 2024
1 parent a7ee0f5 commit d26876c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/crc/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ func GetHostDockerSocketPath() string {
return filepath.Join(MachineInstanceDir, DefaultName, "docker.sock")
}

// For backward compatibility to v 1.20.0
func GetRsaPrivateKeyPath() string {
return filepath.Join(MachineInstanceDir, DefaultName, "id_rsa")
// For backward compatibility to v 2.40.0
func GetECDSAPrivateKeyPath() string {
return filepath.Join(MachineInstanceDir, DefaultName, "id_ecdsa")
}

func GetKubeAdminPasswordPath() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/machine/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func (client *client) ConnectionDetails() (*types.ConnectionDetails, error) {
IP: ip,
SSHPort: vm.SSHPort(),
SSHUsername: constants.DefaultSSHUser,
SSHKeys: []string{constants.GetPrivateKeyPath(), constants.GetRsaPrivateKeyPath(), vm.bundle.GetSSHKeyPath()},
SSHKeys: []string{constants.GetPrivateKeyPath(), constants.GetECDSAPrivateKeyPath(), vm.bundle.GetSSHKeyPath()},
}, nil
}
2 changes: 1 addition & 1 deletion pkg/crc/machine/virtualmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ func (vm *virtualMachine) SSHRunner() (*ssh.Runner, error) {
if err != nil {
return nil, err
}
return ssh.CreateRunner(ip, vm.SSHPort(), constants.GetPrivateKeyPath(), constants.GetRsaPrivateKeyPath(), vm.bundle.GetSSHKeyPath())
return ssh.CreateRunner(ip, vm.SSHPort(), constants.GetPrivateKeyPath(), constants.GetECDSAPrivateKeyPath(), vm.bundle.GetSSHKeyPath())
}

0 comments on commit d26876c

Please sign in to comment.