1
0
mirror of https://github.com/rancher/types.git synced 2025-09-16 23:08:25 +00:00

Override encryption types in schema

This commit is contained in:
moelsayed
2019-10-17 03:29:13 +02:00
committed by Alena Prokharchyk
parent 8e2caed066
commit 8290d7ad32

View File

@@ -9,6 +9,7 @@ import (
"github.com/rancher/types/factory"
"github.com/rancher/types/mapper"
v1 "k8s.io/api/core/v1"
apiserverconfig "k8s.io/apiserver/pkg/apis/config"
)
var (
@@ -45,7 +46,8 @@ var (
Init(credTypes).
Init(mgmtSecretTypes).
Init(clusterTemplateTypes).
Init(driverMetadataTypes)
Init(driverMetadataTypes).
Init(encryptionTypes)
TokenSchemas = factory.Schemas(&Version).
Init(tokens)
@@ -905,3 +907,12 @@ func clusterScanTypes(schemas *types.Schemas) *types.Schemas {
schema.ResourceMethods = []string{http.MethodGet, http.MethodDelete}
})
}
func encryptionTypes(schemas *types.Schemas) *types.Schemas {
return schemas.MustImport(&Version, v3.SecretsEncryptionConfig{}).
MustImport(&Version, apiserverconfig.Key{}, struct {
Secret string `norman:"type=password"`
}{}).MustImport(&Version, apiserverconfig.KMSConfiguration{}, struct {
Timeout string
}{})
}