Skip to content

Commit

Permalink
Remove ioutil after merging check client certificates (#407)
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
  • Loading branch information
roidelapluie authored Nov 25, 2022
1 parent 8c9cb3f commit bebc731
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/http_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,12 @@ func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {

// readCertAndKey reads the cert and key files from the disk.
func readCertAndKey(certFile, keyFile string) ([]byte, []byte, error) {
certData, err := ioutil.ReadFile(certFile)
certData, err := os.ReadFile(certFile)
if err != nil {
return nil, nil, err
}

keyData, err := ioutil.ReadFile(keyFile)
keyData, err := os.ReadFile(keyFile)
if err != nil {
return nil, nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions config/http_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ func TestOAuth2Proxy(t *testing.T) {
func TestModifyTLSCertificates(t *testing.T) {
bs := getCertificateBlobs(t)

tmpDir, err := ioutil.TempDir("", "modifytlscertificates")
tmpDir, err := os.MkdirTemp("", "modifytlscertificates")
if err != nil {
t.Fatal("Failed to create tmp dir", err)
}
Expand Down Expand Up @@ -1632,7 +1632,7 @@ func TestModifyTLSCertificates(t *testing.T) {
t.Fatalf("Expected no error, got %q", err)
}

b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
r.Body.Close()
if err != nil {
t.Errorf("Can't read the server response body")
Expand Down

0 comments on commit bebc731

Please sign in to comment.