|
| 1 | +package v1 |
| 2 | + |
| 3 | +import ( |
| 4 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 5 | + |
| 6 | + configv1 "github.com/openshift/api/config/v1" |
| 7 | +) |
| 8 | + |
| 9 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 10 | + |
| 11 | +type OpenShiftAPIServerConfig struct { |
| 12 | + metav1.TypeMeta `json:",inline"` |
| 13 | + |
| 14 | + // provides the standard apiserver configuration |
| 15 | + configv1.GenericAPIServerConfig `json:",inline" protobuf:"bytes,1,opt,name=genericAPIServerConfig"` |
| 16 | + |
| 17 | + // imagePolicyConfig feeds the image policy admission plugin |
| 18 | + ImagePolicyConfig ImagePolicyConfig `json:"imagePolicyConfig" protobuf:"bytes,9,opt,name=imagePolicyConfig"` |
| 19 | + |
| 20 | + // projectConfig feeds an admission plugin |
| 21 | + ProjectConfig ProjectConfig `json:"projectConfig" protobuf:"bytes,10,opt,name=projectConfig"` |
| 22 | + |
| 23 | + // routingConfig holds information about routing and route generation |
| 24 | + RoutingConfig RoutingConfig `json:"routingConfig" protobuf:"bytes,11,opt,name=routingConfig"` |
| 25 | + |
| 26 | + // serviceAccountOAuthGrantMethod is used for determining client authorization for service account oauth client. |
| 27 | + // It must be either: deny, prompt, or "" |
| 28 | + ServiceAccountOAuthGrantMethod GrantHandlerType `json:"serviceAccountOAuthGrantMethod" protobuf:"bytes,12,opt,name=serviceAccountOAuthGrantMethod,casttype=GrantHandlerType"` |
| 29 | + |
| 30 | + // jenkinsPipelineConfig holds information about the default Jenkins template |
| 31 | + // used for JenkinsPipeline build strategy. |
| 32 | + // TODO this needs to become a normal plugin config |
| 33 | + JenkinsPipelineConfig JenkinsPipelineConfig `json:"jenkinsPipelineConfig" protobuf:"bytes,13,opt,name=jenkinsPipelineConfig"` |
| 34 | + |
| 35 | + // cloudProviderFile points to the cloud config file |
| 36 | + // TODO this needs to become a normal plugin config |
| 37 | + CloudProviderFile string `json:"cloudProviderFile" protobuf:"bytes,14,opt,name=cloudProviderFile"` |
| 38 | + |
| 39 | + // TODO this needs to be removed. |
| 40 | + APIServerArguments map[string][]string `json:"apiServerArguments" protobuf:"bytes,14,rep,name=apiServerArguments"` |
| 41 | +} |
| 42 | + |
| 43 | +type GrantHandlerType string |
| 44 | + |
| 45 | +const ( |
| 46 | + // GrantHandlerAuto auto-approves client authorization grant requests |
| 47 | + GrantHandlerAuto GrantHandlerType = "auto" |
| 48 | + // GrantHandlerPrompt prompts the user to approve new client authorization grant requests |
| 49 | + GrantHandlerPrompt GrantHandlerType = "prompt" |
| 50 | + // GrantHandlerDeny auto-denies client authorization grant requests |
| 51 | + GrantHandlerDeny GrantHandlerType = "deny" |
| 52 | +) |
| 53 | + |
| 54 | +// RoutingConfig holds the necessary configuration options for routing to subdomains |
| 55 | +type RoutingConfig struct { |
| 56 | + // subdomain is the suffix appended to $service.$namespace. to form the default route hostname |
| 57 | + // DEPRECATED: This field is being replaced by routers setting their own defaults. This is the |
| 58 | + // "default" route. |
| 59 | + Subdomain string `json:"subdomain" protobuf:"bytes,1,opt,name=subdomain"` |
| 60 | +} |
| 61 | + |
| 62 | +type ImagePolicyConfig struct { |
| 63 | + // maxImagesBulkImportedPerRepository controls the number of images that are imported when a user |
| 64 | + // does a bulk import of a Docker repository. This number is set low to prevent users from |
| 65 | + // importing large numbers of images accidentally. Set -1 for no limit. |
| 66 | + MaxImagesBulkImportedPerRepository int `json:"maxImagesBulkImportedPerRepository" protobuf:"varint,1,opt,name=maxImagesBulkImportedPerRepository"` |
| 67 | + // allowedRegistriesForImport limits the docker registries that normal users may import |
| 68 | + // images from. Set this list to the registries that you trust to contain valid Docker |
| 69 | + // images and that you want applications to be able to import from. Users with |
| 70 | + // permission to create Images or ImageStreamMappings via the API are not affected by |
| 71 | + // this policy - typically only administrators or system integrations will have those |
| 72 | + // permissions. |
| 73 | + AllowedRegistriesForImport AllowedRegistries `json:"allowedRegistriesForImport" protobuf:"bytes,2,rep,name=allowedRegistriesForImport"` |
| 74 | + |
| 75 | + // internalRegistryHostname sets the hostname for the default internal image |
| 76 | + // registry. The value must be in "hostname[:port]" format. |
| 77 | + // For backward compatibility, users can still use OPENSHIFT_DEFAULT_REGISTRY |
| 78 | + // environment variable but this setting overrides the environment variable. |
| 79 | + InternalRegistryHostname string `json:"internalRegistryHostname" protobuf:"bytes,3,opt,name=internalRegistryHostname"` |
| 80 | + // externalRegistryHostname sets the hostname for the default external image |
| 81 | + // registry. The external hostname should be set only when the image registry |
| 82 | + // is exposed externally. The value is used in 'publicDockerImageRepository' |
| 83 | + // field in ImageStreams. The value must be in "hostname[:port]" format. |
| 84 | + ExternalRegistryHostname string `json:"externalRegistryHostname" protobuf:"bytes,4,opt,name=externalRegistryHostname"` |
| 85 | + |
| 86 | + // additionalTrustedCA is a path to a pem bundle file containing additional CAs that |
| 87 | + // should be trusted during imagestream import. |
| 88 | + AdditionalTrustedCA string `json:"additionalTrustedCA" protobuf:"bytes,5,opt,name=additionalTrustedCA"` |
| 89 | +} |
| 90 | + |
| 91 | +// AllowedRegistries represents a list of registries allowed for the image import. |
| 92 | +type AllowedRegistries []RegistryLocation |
| 93 | + |
| 94 | +// RegistryLocation contains a location of the registry specified by the registry domain |
| 95 | +// name. The domain name might include wildcards, like '*' or '??'. |
| 96 | +type RegistryLocation struct { |
| 97 | + // DomainName specifies a domain name for the registry |
| 98 | + // In case the registry use non-standard (80 or 443) port, the port should be included |
| 99 | + // in the domain name as well. |
| 100 | + DomainName string `json:"domainName" protobuf:"bytes,1,opt,name=domainName"` |
| 101 | + // Insecure indicates whether the registry is secure (https) or insecure (http) |
| 102 | + // By default (if not specified) the registry is assumed as secure. |
| 103 | + Insecure bool `json:"insecure,omitempty" protobuf:"varint,2,opt,name=insecure"` |
| 104 | +} |
| 105 | + |
| 106 | +type ProjectConfig struct { |
| 107 | + // defaultNodeSelector holds default project node label selector |
| 108 | + DefaultNodeSelector string `json:"defaultNodeSelector" protobuf:"bytes,1,opt,name=defaultNodeSelector"` |
| 109 | + |
| 110 | + // projectRequestMessage is the string presented to a user if they are unable to request a project via the projectrequest api endpoint |
| 111 | + ProjectRequestMessage string `json:"projectRequestMessage" protobuf:"bytes,2,opt,name=projectRequestMessage"` |
| 112 | + |
| 113 | + // projectRequestTemplate is the template to use for creating projects in response to projectrequest. |
| 114 | + // It is in the format namespace/template and it is optional. |
| 115 | + // If it is not specified, a default template is used. |
| 116 | + ProjectRequestTemplate string `json:"projectRequestTemplate" protobuf:"bytes,3,opt,name=projectRequestTemplate"` |
| 117 | +} |
| 118 | + |
| 119 | +// JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy |
| 120 | +type JenkinsPipelineConfig struct { |
| 121 | + // autoProvisionEnabled determines whether a Jenkins server will be spawned from the provided |
| 122 | + // template when the first build config in the project with type JenkinsPipeline |
| 123 | + // is created. When not specified this option defaults to true. |
| 124 | + AutoProvisionEnabled *bool `json:"autoProvisionEnabled" protobuf:"varint,1,opt,name=autoProvisionEnabled"` |
| 125 | + // templateNamespace contains the namespace name where the Jenkins template is stored |
| 126 | + TemplateNamespace string `json:"templateNamespace" protobuf:"bytes,2,opt,name=templateNamespace"` |
| 127 | + // templateName is the name of the default Jenkins template |
| 128 | + TemplateName string `json:"templateName" protobuf:"bytes,3,opt,name=templateName"` |
| 129 | + // serviceName is the name of the Jenkins service OpenShift uses to detect |
| 130 | + // whether a Jenkins pipeline handler has already been installed in a project. |
| 131 | + // This value *must* match a service name in the provided template. |
| 132 | + ServiceName string `json:"serviceName" protobuf:"bytes,4,opt,name=serviceName"` |
| 133 | + // parameters specifies a set of optional parameters to the Jenkins template. |
| 134 | + Parameters map[string]string `json:"parameters" protobuf:"bytes,5,rep,name=parameters"` |
| 135 | +} |
0 commit comments