Merge pull request #53249 from hzxuzhonghu/envelop-encrypt

Automatic merge from submit-queue (batch tested with PRs 53249, 53586). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

rename encryptionconfig_test.go and remove unused filed in envelopeTransformer

**What this PR does / why we need it**:
useless field `cacheSize` and rename test file match original `config.go`.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-10-13 05:09:40 -07:00 committed by GitHub
commit fd57b1c002
3 changed files with 1 additions and 5 deletions

View File

@ -27,7 +27,7 @@ go_library(
go_test( go_test(
name = "go_default_test", name = "go_default_test",
srcs = ["encryptionconfig_test.go"], srcs = ["config_test.go"],
library = ":go_default_library", library = ":go_default_library",
deps = [ deps = [
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",

View File

@ -46,9 +46,6 @@ type envelopeTransformer struct {
// transformers is a thread-safe LRU cache which caches decrypted DEKs indexed by their encrypted form. // transformers is a thread-safe LRU cache which caches decrypted DEKs indexed by their encrypted form.
transformers *lru.Cache transformers *lru.Cache
// cacheSize is the maximum number of DEKs that are cached.
cacheSize int
// baseTransformerFunc creates a new transformer for encrypting the data with the DEK. // baseTransformerFunc creates a new transformer for encrypting the data with the DEK.
baseTransformerFunc func(cipher.Block) value.Transformer baseTransformerFunc func(cipher.Block) value.Transformer
} }
@ -68,7 +65,6 @@ func NewEnvelopeTransformer(envelopeService Service, cacheSize int, baseTransfor
return &envelopeTransformer{ return &envelopeTransformer{
envelopeService: envelopeService, envelopeService: envelopeService,
transformers: cache, transformers: cache,
cacheSize: cacheSize,
baseTransformerFunc: baseTransformerFunc, baseTransformerFunc: baseTransformerFunc,
}, nil }, nil
} }