@@ -20,7 +20,6 @@ import (
2020 "bytes"
2121 "context"
2222 "fmt"
23- "io/ioutil"
2423 "math/rand"
2524 "net/url"
2625 "os"
@@ -1014,12 +1013,12 @@ func expectCommittedAndPushed(conditions []metav1.Condition) {
10141013func replaceMarker (path string , policyKey types.NamespacedName ) error {
10151014 // NB this requires knowledge of what's in the git repo, so a little brittle
10161015 deployment := filepath .Join (path , "deploy.yaml" )
1017- filebytes , err := ioutil .ReadFile (deployment )
1016+ filebytes , err := os .ReadFile (deployment )
10181017 if err != nil {
10191018 return err
10201019 }
10211020 newfilebytes := bytes .ReplaceAll (filebytes , []byte ("SETTER_SITE" ), []byte (setterRef (policyKey )))
1022- if err = ioutil .WriteFile (deployment , newfilebytes , os .FileMode (0666 )); err != nil {
1021+ if err = os .WriteFile (deployment , newfilebytes , os .FileMode (0666 )); err != nil {
10231022 return err
10241023 }
10251024 return nil
@@ -1076,13 +1075,13 @@ func waitForNewHead(repo *git.Repository, branch string) {
10761075}
10771076
10781077func compareRepoWithExpected (repoURL , branch , fixture string , changeFixture func (tmp string )) {
1079- expected , err := ioutil . TempDir ("" , "gotest-imageauto-expected" )
1078+ expected , err := os . MkdirTemp ("" , "gotest-imageauto-expected" )
10801079 Expect (err ).ToNot (HaveOccurred ())
10811080 defer os .RemoveAll (expected )
10821081 copy .Copy (fixture , expected )
10831082 changeFixture (expected )
10841083
1085- tmp , err := ioutil . TempDir ("" , "gotest-imageauto" )
1084+ tmp , err := os . MkdirTemp ("" , "gotest-imageauto" )
10861085 Expect (err ).ToNot (HaveOccurred ())
10871086 defer os .RemoveAll (tmp )
10881087 _ , err = git .PlainClone (tmp , false , & git.CloneOptions {
@@ -1094,7 +1093,7 @@ func compareRepoWithExpected(repoURL, branch, fixture string, changeFixture func
10941093}
10951094
10961095func commitInRepo (repoURL , branch , msg string , changeFiles func (path string )) {
1097- tmp , err := ioutil . TempDir ("" , "gotest-imageauto" )
1096+ tmp , err := os . MkdirTemp ("" , "gotest-imageauto" )
10981097 Expect (err ).ToNot (HaveOccurred ())
10991098 defer os .RemoveAll (tmp )
11001099 repo , err := git .PlainClone (tmp , false , & git.CloneOptions {
0 commit comments