remove deprecated ioutil usages (#2877)

* fix: Fixed return description error

* config/options: Adjust the position of TracingJaegerAgentEndpoint option

* DOCS: Remove duplicate configuration items

Remove duplicate configuration items of route

* remove deprecated ioutil usages
This commit is contained in:
cfanbo 2021-12-30 10:02:12 -08:00 committed by GitHub
parent 9b5a816246
commit 84dad4c612
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 69 additions and 87 deletions

View file

@ -2,7 +2,6 @@ package config
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"sync"
@ -22,12 +21,12 @@ func TestFileWatcherSource(t *testing.T) {
return
}
err = ioutil.WriteFile(filepath.Join(tmpdir, "example.txt"), []byte{1, 2, 3, 4}, 0o600)
err = os.WriteFile(filepath.Join(tmpdir, "example.txt"), []byte{1, 2, 3, 4}, 0o600)
if !assert.NoError(t, err) {
return
}
err = ioutil.WriteFile(filepath.Join(tmpdir, "kubernetes-example.txt"), []byte{1, 2, 3, 4}, 0o600)
err = os.WriteFile(filepath.Join(tmpdir, "kubernetes-example.txt"), []byte{1, 2, 3, 4}, 0o600)
if !assert.NoError(t, err) {
return
}
@ -50,7 +49,7 @@ func TestFileWatcherSource(t *testing.T) {
})
})
err = ioutil.WriteFile(filepath.Join(tmpdir, "example.txt"), []byte{5, 6, 7, 8}, 0o600)
err = os.WriteFile(filepath.Join(tmpdir, "example.txt"), []byte{5, 6, 7, 8}, 0o600)
if !assert.NoError(t, err) {
return
}
@ -61,7 +60,7 @@ func TestFileWatcherSource(t *testing.T) {
t.Error("expected OnConfigChange to be fired after modifying a file")
}
err = ioutil.WriteFile(filepath.Join(tmpdir, "kubernetes-example.txt"), []byte{5, 6, 7, 8}, 0o600)
err = os.WriteFile(filepath.Join(tmpdir, "kubernetes-example.txt"), []byte{5, 6, 7, 8}, 0o600)
if !assert.NoError(t, err) {
return
}