Skip to content

Commit

Permalink
chore: remove refs to deprecated io/ioutil (#9061)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
  • Loading branch information
testwill authored Aug 31, 2023
1 parent 94e6d44 commit fc367c1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions pkg/skaffold/inspect/jobManifestPaths/modify.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"

"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/config"
Expand All @@ -46,7 +45,7 @@ func Modify(ctx context.Context, out io.Writer, opts config.SkaffoldOptions, inp
// defer the closing of our jsonFile so that we can parse it later on
defer jsonFile.Close()

byteValue, _ := ioutil.ReadAll(jsonFile)
byteValue, _ := io.ReadAll(jsonFile)

var result jobManifestPathList
err = json.Unmarshal(byteValue, &result)
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/inspect/namespaces/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package inspect
import (
"context"
"io"
"io/ioutil"
"log"
"os"
"strings"

appsv1 "k8s.io/api/apps/v1"
Expand All @@ -42,7 +42,7 @@ type resourceInfo struct {
}

func PrintNamespacesList(ctx context.Context, out io.Writer, manifestFile string, opts inspect.Options) error {
b, err := ioutil.ReadFile(manifestFile)
b, err := os.ReadFile(manifestFile)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/k8sjob/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package k8sjob
import (
"context"
"fmt"
"io/ioutil"
"os"
"time"

jsonpatch "github.com/evanphx/json-patch"
Expand Down Expand Up @@ -70,7 +70,7 @@ func merge(codec runtime.Codec, dst runtime.Object, fragment string) (runtime.Ob
}

func LoadFromPath(path string) (*batchv1.Job, error) {
b, err := ioutil.ReadFile(path)
b, err := os.ReadFile(path)

if err != nil {
return nil, err
Expand Down
5 changes: 2 additions & 3 deletions pkg/skaffold/render/renderer/kustomize/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -162,7 +161,7 @@ func (k Kustomize) mirror(kusDir string, fs TmpFS) error {
return err
}

bytes, err := ioutil.ReadFile(kFile)
bytes, err := os.ReadFile(kFile)
if err != nil {
return err
}
Expand Down Expand Up @@ -300,7 +299,7 @@ func (k Kustomize) mirrorFile(kusDir string, fs TmpFS, path string) error {
return nil
}
pFile := filepath.Join(kusDir, path)
bytes, err := ioutil.ReadFile(pFile)
bytes, err := os.ReadFile(pFile)
if err != nil {
return err
}
Expand Down

0 comments on commit fc367c1

Please sign in to comment.