mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
@ -124,7 +123,7 @@ func GetKMSPluginHealthzCheckers(filepath string) ([]healthz.HealthChecker, erro
|
|||||||
func getKMSPluginProbes(reader io.Reader) ([]interface{}, error) {
|
func getKMSPluginProbes(reader io.Reader) ([]interface{}, error) {
|
||||||
var result []interface{}
|
var result []interface{}
|
||||||
|
|
||||||
configFileContents, err := ioutil.ReadAll(reader)
|
configFileContents, err := io.ReadAll(reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not read content of encryption provider configuration: %v", err)
|
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) {
|
func parseEncryptionConfiguration(f io.Reader) (map[schema.GroupResource]value.Transformer, error) {
|
||||||
configFileContents, err := ioutil.ReadAll(f)
|
configFileContents, err := io.ReadAll(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not read contents: %v", err)
|
return nil, fmt.Errorf("could not read contents: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@ -53,7 +52,7 @@ func mustReadConfig(t *testing.T, path string) []byte {
|
|||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
configFileContents, err := ioutil.ReadAll(f)
|
configFileContents, err := io.ReadAll(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("could not read contents of encryption config: %v", err)
|
t.Fatalf("could not read contents of encryption config: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,6 @@ type envelopeTransformer struct {
|
|||||||
|
|
||||||
cacheSize int
|
cacheSize int
|
||||||
cacheEnabled bool
|
cacheEnabled bool
|
||||||
|
|
||||||
pluginName string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncryptResponse is the response from the Envelope service when encrypting data.
|
// 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) {
|
func TestEncodeDecode(t *testing.T) {
|
||||||
envelopeTransformer := &envelopeTransformer{
|
envelopeTransformer := &envelopeTransformer{}
|
||||||
pluginName: "testplugin",
|
|
||||||
}
|
|
||||||
|
|
||||||
obj := &kmstypes.EncryptedObject{
|
obj := &kmstypes.EncryptedObject{
|
||||||
EncryptedData: []byte{0x01, 0x02, 0x03},
|
EncryptedData: []byte{0x01, 0x02, 0x03},
|
||||||
@ -207,9 +205,7 @@ func TestEncodeDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDecodeError(t *testing.T) {
|
func TestDecodeError(t *testing.T) {
|
||||||
et := &envelopeTransformer{
|
et := &envelopeTransformer{}
|
||||||
pluginName: "testplugin",
|
|
||||||
}
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
desc string
|
desc string
|
||||||
|
Loading…
Reference in New Issue
Block a user