Merge pull request #111981 from aramase/remove-pluginname

chore(kms): remove unused plugin name and migrate from deprecated `io/ioutil` pkg
This commit is contained in:
Kubernetes Prow Robot 2022-08-24 16:11:49 -07:00 committed by GitHub
commit 4f37c8e81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 13 deletions

View File

@ -24,7 +24,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"sync"
@ -124,7 +123,7 @@ func GetKMSPluginHealthzCheckers(filepath string) ([]healthz.HealthChecker, erro
func getKMSPluginProbes(reader io.Reader) ([]interface{}, error) {
var result []interface{}
configFileContents, err := ioutil.ReadAll(reader)
configFileContents, err := io.ReadAll(reader)
if err != nil {
return nil, fmt.Errorf("could not read content of encryption provider configuration: %v", err)
}
@ -270,7 +269,7 @@ func GetTransformerOverrides(filepath string) (map[schema.GroupResource]value.Tr
}
func parseEncryptionConfiguration(f io.Reader) (map[schema.GroupResource]value.Transformer, error) {
configFileContents, err := ioutil.ReadAll(f)
configFileContents, err := io.ReadAll(f)
if err != nil {
return nil, fmt.Errorf("could not read contents: %v", err)
}

View File

@ -22,7 +22,6 @@ import (
"encoding/base64"
"errors"
"io"
"io/ioutil"
"os"
"sync"
"testing"
@ -53,7 +52,7 @@ func mustReadConfig(t *testing.T, path string) []byte {
}
defer f.Close()
configFileContents, err := ioutil.ReadAll(f)
configFileContents, err := io.ReadAll(f)
if err != nil {
t.Fatalf("could not read contents of encryption config: %v", err)
}

View File

@ -60,8 +60,6 @@ type envelopeTransformer struct {
cacheSize int
cacheEnabled bool
pluginName string
}
// EncryptResponse is the response from the Envelope service when encrypting data.

View File

@ -181,9 +181,7 @@ func TestEnvelopeCacheLimit(t *testing.T) {
}
func TestEncodeDecode(t *testing.T) {
envelopeTransformer := &envelopeTransformer{
pluginName: "testplugin",
}
envelopeTransformer := &envelopeTransformer{}
obj := &kmstypes.EncryptedObject{
EncryptedData: []byte{0x01, 0x02, 0x03},
@ -207,9 +205,7 @@ func TestEncodeDecode(t *testing.T) {
}
func TestDecodeError(t *testing.T) {
et := &envelopeTransformer{
pluginName: "testplugin",
}
et := &envelopeTransformer{}
testCases := []struct {
desc string