chore: remove refs to deprecated io/ioutil

This commit is contained in:
guoguangwu
2023-06-25 11:09:17 +08:00
parent dd523a00ef
commit 62c611a51a
2 changed files with 6 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
@@ -108,7 +108,7 @@ func serve(w http.ResponseWriter, r *http.Request, admit admitHandler) {
http.Error(w, msg, http.StatusBadRequest)
}
data, err := ioutil.ReadAll(r.Body)
data, err := io.ReadAll(r.Body)
if err != nil {
msg := fmt.Sprintf("Request could not be decoded: %v", err)
klog.Error(msg)