Skip to content

Commit

Permalink
chore: remove ioutil from controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
  • Loading branch information
sunya-ch committed Feb 4, 2025
1 parent fbde7b5 commit 106070b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions controllers/daemon_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package controllers
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"

"bytes"
Expand Down Expand Up @@ -79,7 +79,7 @@ func (dc DaemonConnector) GetInterfaces(podAddress string) ([]multinicv1.Interfa
return []multinicv1.InterfaceInfoType{}, err
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return []multinicv1.InterfaceInfoType{}, err
}
Expand Down Expand Up @@ -112,7 +112,7 @@ func (dc DaemonConnector) Join(podAddress string, hifs []multinicv1.InterfaceInf
return errors.New(res.Status)
}

_, err = ioutil.ReadAll(res.Body)
_, err = io.ReadAll(res.Body)
if err != nil {
return err
}
Expand Down Expand Up @@ -165,7 +165,7 @@ func (dc DaemonConnector) putRouteRequest(podAddress string, path string, cidrNa
return response, errors.New(res.Status)
}

body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return response, err
}
Expand Down
3 changes: 1 addition & 2 deletions plugin/sriov_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package plugin
import (
"bytes"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -312,7 +311,7 @@ func RenderTemplate(path string, d *RenderData) ([]*unstructured.Unstructured, e
tmpl.Funcs(template.FuncMap{"getOr": getOr, "isSet": isSet})
tmpl.Funcs(sprig.TxtFuncMap())

source, err := ioutil.ReadFile(path)
source, err := os.ReadFile(path)
if err != nil {
return nil, errors.Wrapf(err, "failed to read manifest %s", path)
}
Expand Down

0 comments on commit 106070b

Please sign in to comment.