Skip to content

Commit

Permalink
Merge pull request #770 from testwill/ioutil
Browse files Browse the repository at this point in the history
chore: remove refs to deprecated io/ioutil
  • Loading branch information
k8s-ci-robot authored Jun 26, 2023
2 parents d605f87 + 1ccff37 commit fd51f17
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/e2e/lib/ssh/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
mathrand "math/rand"
"net"
"net/http"
Expand Down Expand Up @@ -234,7 +233,7 @@ func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer,

func MakePrivateKeySignerFromFile(key string) (ssh.Signer, error) {
// Create an actual signer.
buffer, err := ioutil.ReadFile(key)
buffer, err := os.ReadFile(key)
if err != nil {
return nil, fmt.Errorf("error reading SSH key %s: '%v'", key, err)
}
Expand All @@ -250,7 +249,7 @@ func MakePrivateKeySignerFromBytes(buffer []byte) (ssh.Signer, error) {
}

func ParsePublicKeyFromFile(keyFile string) (*rsa.PublicKey, error) {
buffer, err := ioutil.ReadFile(keyFile)
buffer, err := os.ReadFile(keyFile)
if err != nil {
return nil, fmt.Errorf("error reading SSH key %s: '%v'", keyFile, err)
}
Expand Down

0 comments on commit fd51f17

Please sign in to comment.