Stop using deprecated ioutil functions

This commit is contained in:
Katrina Verey
2022-08-10 16:59:18 -04:00
parent 416eed97c4
commit f6b72077c8
70 changed files with 322 additions and 362 deletions

View File

@@ -6,7 +6,6 @@ package builtins
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -73,7 +72,7 @@ func (p *HelmChartInflationGeneratorPlugin) establishTmpDir() (err error) {
// already done.
return nil
}
p.tmpDir, err = ioutil.TempDir("", "kustomize-helm-")
p.tmpDir, err = os.MkdirTemp("", "kustomize-helm-")
return err
}
@@ -211,7 +210,7 @@ func (p *HelmChartInflationGeneratorPlugin) writeValuesBytes(
return "", fmt.Errorf("cannot create tmp dir to write helm values")
}
path := filepath.Join(p.tmpDir, p.Name+"-kustomize-values.yaml")
return path, ioutil.WriteFile(path, b, 0644)
return path, os.WriteFile(path, b, 0644)
}
func (p *HelmChartInflationGeneratorPlugin) cleanup() {