Skip to content

Commit

Permalink
Get encryption configuration from a config and apply resource transfo…
Browse files Browse the repository at this point in the history
…rmers.
  • Loading branch information
php-coder committed Jun 22, 2017
1 parent a192b3e commit a53531e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/cmd/server/kubernetes/master/master_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
kgenericfilters "k8s.io/apiserver/pkg/server/filters"
apiserveroptions "k8s.io/apiserver/pkg/server/options"
genericoptions "k8s.io/apiserver/pkg/server/options"
"k8s.io/apiserver/pkg/server/options/encryptionconfig"
apiserverstorage "k8s.io/apiserver/pkg/server/storage"
"k8s.io/apiserver/pkg/storage"
storagefactory "k8s.io/apiserver/pkg/storage/storagebackend/factory"
Expand Down Expand Up @@ -216,6 +217,17 @@ func BuildStorageFactory(masterConfig configapi.MasterConfig, server *kapiserver
// keep Deployments in extensions for backwards compatibility, we'll have to migrate at some point, eventually
storageFactory.AddCohabitatingResources(extensions.Resource("deployments"), apps.Resource("deployments"))

if server.Etcd.EncryptionProviderConfigFilepath != "" {
glog.V(4).Infof("Reading encryption configuration from %q", server.Etcd.EncryptionProviderConfigFilepath)
transformerOverrides, err := encryptionconfig.GetTransformerOverrides(server.Etcd.EncryptionProviderConfigFilepath)
if err != nil {
return nil, err
}
for groupResource, transformer := range transformerOverrides {
storageFactory.SetTransformer(groupResource, transformer)
}
}

return storageFactory, nil
}

Expand Down

0 comments on commit a53531e

Please sign in to comment.