mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Stop using deprecated ioutil functions
This commit is contained in:
@@ -5,7 +5,7 @@ package commands_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
func TestSourceCommand(t *testing.T) {
|
||||
d := t.TempDir()
|
||||
|
||||
err := ioutil.WriteFile(filepath.Join(d, "f1.yaml"), []byte(`
|
||||
err := os.WriteFile(filepath.Join(d, "f1.yaml"), []byte(`
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
@@ -39,7 +39,7 @@ spec:
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
err = ioutil.WriteFile(filepath.Join(d, "f2.yaml"), []byte(`
|
||||
err = os.WriteFile(filepath.Join(d, "f2.yaml"), []byte(`
|
||||
apiVersion: v1
|
||||
kind: Abstraction
|
||||
metadata:
|
||||
@@ -141,7 +141,7 @@ items:
|
||||
func TestSourceCommandJSON(t *testing.T) {
|
||||
d := t.TempDir()
|
||||
|
||||
err := ioutil.WriteFile(filepath.Join(d, "f1.json"), []byte(`
|
||||
err := os.WriteFile(filepath.Join(d, "f1.json"), []byte(`
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"metadata": {
|
||||
@@ -161,7 +161,7 @@ func TestSourceCommandJSON(t *testing.T) {
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
err = ioutil.WriteFile(filepath.Join(d, "f2.json"), []byte(`
|
||||
err = os.WriteFile(filepath.Join(d, "f2.json"), []byte(`
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Abstraction",
|
||||
|
||||
Reference in New Issue
Block a user