mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Remove ioutil from auth plugin
Signed-off-by: inosato <si17_21@yahoo.co.jp>
This commit is contained in:
parent
3902a53419
commit
1a1ad16a5a
@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package bootstrappolicy_test
|
package bootstrappolicy_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -225,7 +224,7 @@ func TestBootstrapControllerRoleBindings(t *testing.T) {
|
|||||||
|
|
||||||
func testObjects(t *testing.T, list *api.List, fixtureFilename string) {
|
func testObjects(t *testing.T, list *api.List, fixtureFilename string) {
|
||||||
filename := filepath.Join("testdata", fixtureFilename)
|
filename := filepath.Join("testdata", fixtureFilename)
|
||||||
expectedYAML, err := ioutil.ReadFile(filename)
|
expectedYAML, err := os.ReadFile(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -247,7 +246,7 @@ func testObjects(t *testing.T, list *api.List, fixtureFilename string) {
|
|||||||
|
|
||||||
const updateEnvVar = "UPDATE_BOOTSTRAP_POLICY_FIXTURE_DATA"
|
const updateEnvVar = "UPDATE_BOOTSTRAP_POLICY_FIXTURE_DATA"
|
||||||
if os.Getenv(updateEnvVar) == "true" {
|
if os.Getenv(updateEnvVar) == "true" {
|
||||||
if err := ioutil.WriteFile(filename, []byte(yamlData), os.FileMode(0755)); err == nil {
|
if err := os.WriteFile(filename, []byte(yamlData), os.FileMode(0755)); err == nil {
|
||||||
t.Logf("Updated data in %s", filename)
|
t.Logf("Updated data in %s", filename)
|
||||||
t.Logf("Verify the diff, commit changes, and rerun the tests")
|
t.Logf("Verify the diff, commit changes, and rerun the tests")
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user