Update go version, modules and remove ioutil

This commit is contained in:
Ricardo Katz 2021-08-06 11:18:17 -03:00
parent 6f0401fc73
commit d226d831bd
31 changed files with 576 additions and 288 deletions

View file

@ -17,7 +17,7 @@ limitations under the License.
package controller
import (
"io/ioutil"
"io"
"net/http"
admissionv1 "k8s.io/api/admission/v1"
@ -61,7 +61,7 @@ func NewAdmissionControllerServer(ac AdmissionController) *AdmissionControllerSe
func (acs *AdmissionControllerServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
defer req.Body.Close()
data, err := ioutil.ReadAll(req.Body)
data, err := io.ReadAll(req.Body)
if err != nil {
klog.ErrorS(err, "Failed to read request body")
w.WriteHeader(http.StatusBadRequest)