mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 17:29:00 +00:00
replace deprecated io/ioutil with os and io for cmd
This commit is contained in:
@@ -24,7 +24,7 @@ import (
|
||||
"crypto/x509/pkix"
|
||||
"encoding/json"
|
||||
"encoding/pem"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"math/big"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
@@ -48,7 +48,7 @@ import (
|
||||
// manager that will use the bootstrap client until we get a valid cert, then use our
|
||||
// provided identity on subsequent requests.
|
||||
func Test_buildClientCertificateManager(t *testing.T) {
|
||||
testDir, err := ioutil.TempDir("", "kubeletcert")
|
||||
testDir, err := os.MkdirTemp("", "kubeletcert")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -134,7 +134,7 @@ func Test_buildClientCertificateManager(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_buildClientCertificateManager_populateCertDir(t *testing.T) {
|
||||
testDir, err := ioutil.TempDir("", "kubeletcert")
|
||||
testDir, err := os.MkdirTemp("", "kubeletcert")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -215,7 +215,7 @@ func getCSR(req *http.Request) (*certapi.CertificateSigningRequest, error) {
|
||||
if req.Body == nil {
|
||||
return nil, nil
|
||||
}
|
||||
body, err := ioutil.ReadAll(req.Body)
|
||||
body, err := io.ReadAll(req.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user