mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
chore(kms): remove unused plugin name and migrate from deprecated io/ioutil
pkg
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
This commit is contained in:
parent
a1128e380c
commit
7db7a63959
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -60,8 +60,6 @@ type envelopeTransformer struct {
|
||||
|
||||
cacheSize int
|
||||
cacheEnabled bool
|
||||
|
||||
pluginName string
|
||||
}
|
||||
|
||||
// EncryptResponse is the response from the Envelope service when encrypting data.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user