forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
conversion.go
47 lines (37 loc) · 1.83 KB
/
conversion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package openshift_apiserver
import (
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
)
func ConvertMasterConfigToOpenshiftAPIServerConfig(input *configapi.MasterConfig) *configapi.OpenshiftAPIServerConfig {
ret := &configapi.OpenshiftAPIServerConfig{
// TODO this is likely to be a little weird. I think we override most of this in the operator
ServingInfo: input.ServingInfo,
CORSAllowedOrigins: input.CORSAllowedOrigins,
MasterClients: input.MasterClients,
AuditConfig: input.AuditConfig,
StoragePrefix: input.EtcdStorageConfig.OpenShiftStoragePrefix,
EtcdClientInfo: input.EtcdClientInfo,
ImagePolicyConfig: configapi.ServerImagePolicyConfig{
MaxImagesBulkImportedPerRepository: input.ImagePolicyConfig.MaxImagesBulkImportedPerRepository,
AllowedRegistriesForImport: input.ImagePolicyConfig.AllowedRegistriesForImport,
InternalRegistryHostname: input.ImagePolicyConfig.InternalRegistryHostname,
ExternalRegistryHostname: input.ImagePolicyConfig.ExternalRegistryHostname,
AdditionalTrustedCA: input.ImagePolicyConfig.AdditionalTrustedCA,
},
ProjectConfig: configapi.ServerProjectConfig{
DefaultNodeSelector: input.ProjectConfig.DefaultNodeSelector,
ProjectRequestMessage: input.ProjectConfig.ProjectRequestMessage,
ProjectRequestTemplate: input.ProjectConfig.ProjectRequestTemplate,
},
RoutingConfig: input.RoutingConfig,
AdmissionPluginConfig: input.AdmissionConfig.PluginConfig,
// TODO this is logically an admission configuration
JenkinsPipelineConfig: input.JenkinsPipelineConfig,
// TODO this needs to be removed.
APIServerArguments: input.KubernetesMasterConfig.APIServerArguments,
}
if input.OAuthConfig != nil {
ret.ServiceAccountOAuthGrantMethod = input.OAuthConfig.GrantConfig.ServiceAccountMethod
}
return ret
}