Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions config/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,30 @@ func Resource(resource string) schema.GroupResource {
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion,
&Image{},
&ImageList{},
&Authentication{},
&AuthenticationList{},
&Build{},
&BuildList{},
&Console{},
&ConsoleList{},
&DNS{},
&DNSList{},
&IdentityProvider{},
&IdentityProviderList{},
&Image{},
&ImageList{},
&Infrastructure{},
&InfrastructureList{},
&Ingress{},
&IngressList{},
&Network{},
&NetworkList{},
&OAuth{},
&OAuthList{},
&Project{},
&ProjectList{},
&Scheduling{},
&SchedulingList{},
)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
Expand Down
158 changes: 0 additions & 158 deletions config/v1/types.go
Original file line number Diff line number Diff line change
@@ -1,78 +1,10 @@
package v1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Image holds cluster-wide information about how to handle images. The canonical name is `cluster`
type Image struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ObjectMeta `json:"metadata,omitempty"`

// spec holds user settable values for configuration
Spec ImageSpec `json:"spec"`
// status holds observed values from the cluster. They may not be overridden.
Status ImageStatus `json:"status"`
}

type ImageSpec struct {
// AllowedRegistriesForImport limits the container image registries that normal users may import
// images from. Set this list to the registries that you trust to contain valid Docker
// images and that you want applications to be able to import from. Users with
// permission to create Images or ImageStreamMappings via the API are not affected by
// this policy - typically only administrators or system integrations will have those
// permissions.
AllowedRegistriesForImport []RegistryLocation `json:"allowedRegistriesForImport,omitempty"`

// ExternalRegistryHostname sets the hostname for the default external image
// registry. The external hostname should be set only when the image registry
// is exposed externally. The value is used in 'publicDockerImageRepository'
// field in ImageStreams. The value must be in "hostname[:port]" format.
ExternalRegistryHostname string `json:"externalRegistryHostname,omitempty"`

// AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that
// should be trusted during imagestream import.
AdditionalTrustedCA ConfigMapReference `json:"additionalTrustedCA,omitempty"`
}

type ImageStatus struct {

// this value is set by the image registry operator which controls the internal registry hostname
// InternalRegistryHostname sets the hostname for the default internal image
// registry. The value must be in "hostname[:port]" format.
// For backward compatibility, users can still use OPENSHIFT_DEFAULT_REGISTRY
// environment variable but this setting overrides the environment variable.
InternalRegistryHostname string `json:"internalRegistryHostname,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ImageList struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ListMeta `json:"metadata,omitempty"`
Items []Image `json:"items"`
}

// RegistryLocation contains a location of the registry specified by the registry domain
// name. The domain name might include wildcards, like '*' or '??'.
type RegistryLocation struct {
// DomainName specifies a domain name for the registry
// In case the registry use non-standard (80 or 443) port, the port should be included
// in the domain name as well.
DomainName string `json:"domainName"`
// Insecure indicates whether the registry is secure (https) or insecure (http)
// By default (if not specified) the registry is assumed as secure.
Insecure bool `json:"insecure,omitempty"`
}

// ConfigMapReference references the location of a configmap.
type ConfigMapReference struct {
Namespace string `json:"namespace"`
Expand All @@ -81,96 +13,6 @@ type ConfigMapReference struct {
Key string `json:"filename,omitempty"`
}

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Build holds cluster-wide information on how to handle builds. The canonical name is `cluster`
type Build struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec holds user-settable values for the build controller configuration
// +optional
Spec BuildSpec `json:"spec,omitempty"`
}

type BuildSpec struct {
// AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that
// should be trusted for image pushes and pulls during builds.
// +optional
AdditionalTrustedCA ConfigMapReference `json:"additionalTrustedCA,omitempty"`
// BuildDefaults controls the default information for Builds
// +optional
BuildDefaults BuildDefaults `json:"buildDefaults,omitempty"`
// BuildOverrides controls override settings for builds
// +optional
BuildOverrides BuildOverrides `json:"buildOverrides,omitempty"`
}

type BuildDefaults struct {
// GitHTTPProxy is the location of the HTTPProxy for Git source
// +optional
GitHTTPProxy string `json:"gitHTTPProxy,omitempty"`

// GitHTTPSProxy is the location of the HTTPSProxy for Git source
// +optional
GitHTTPSProxy string `json:"gitHTTPSProxy,omitempty"`

// GitNoProxy is the list of domains for which the proxy should not be used
// +optional
GitNoProxy string `json:"gitNoProxy,omitempty"`

// Env is a set of default environment variables that will be applied to the
// build if the specified variables do not exist on the build
// +optional
Env []corev1.EnvVar `json:"env,omitempty"`

// ImageLabels is a list of docker labels that are applied to the resulting image.
// User can override a default label by providing a label with the same name in their
// Build/BuildConfig.
// +optional
ImageLabels []ImageLabel `json:"imageLabels,omitempty"`

// Resources defines resource requirements to execute the build.
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

type ImageLabel struct {
// Name defines the name of the label. It must have non-zero length.
Name string `json:"name"`

// Value defines the literal value of the label.
// +optional
Value string `json:"value,omitempty"`
}

type BuildOverrides struct {
// ImageLabels is a list of docker labels that are applied to the resulting image.
// If user provided a label in their Build/BuildConfig with the same name as one in this
// list, the user's label will be overwritten.
// +optional
ImageLabels []ImageLabel `json:"imageLabels,omitempty"`

// NodeSelector is a selector which must be true for the build pod to fit on a node
// +optional
NodeSelector metav1.LabelSelector `json:"nodeSelector,omitempty"`

// Tolerations is a list of Tolerations that will override any existing
// tolerations set on a build pod.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type BuildList struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ListMeta `json:"metadata,omitempty"`
Items []Build `json:"items"`
}

// HTTPServingInfo holds configuration for serving HTTP
type HTTPServingInfo struct {
// ServingInfo is the HTTP serving information
Expand Down
39 changes: 39 additions & 0 deletions config/v1/types_authentication.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package v1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Authentication holds cluster-wide information about Authentication. The canonical name is `cluster`
// TODO this object is an example of a possible grouping and is subject to change or removal
type Authentication struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ObjectMeta `json:"metadata,omitempty"`

// spec holds user settable values for configuration
Spec AuthenticationSpec `json:"spec"`
// status holds observed values from the cluster. They may not be overridden.
Status AuthenticationStatus `json:"status"`
}

type AuthenticationSpec struct {
// webhook token auth config (ttl)
// external token address
// serviceAccountOAuthGrantMethod or remove/disallow it as an option
}

type AuthenticationStatus struct {
// internal token address
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type AuthenticationList struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ListMeta `json:"metadata,omitempty"`
Items []Authentication `json:"items"`
}
96 changes: 96 additions & 0 deletions config/v1/types_build.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package v1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Build holds cluster-wide information on how to handle builds. The canonical name is `cluster`
type Build struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec holds user-settable values for the build controller configuration
// +optional
Spec BuildSpec `json:"spec,omitempty"`
}

type BuildSpec struct {
// AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that
// should be trusted for image pushes and pulls during builds.
// +optional
AdditionalTrustedCA ConfigMapReference `json:"additionalTrustedCA,omitempty"`
// BuildDefaults controls the default information for Builds
// +optional
BuildDefaults BuildDefaults `json:"buildDefaults,omitempty"`
// BuildOverrides controls override settings for builds
// +optional
BuildOverrides BuildOverrides `json:"buildOverrides,omitempty"`
}

type BuildDefaults struct {
// GitHTTPProxy is the location of the HTTPProxy for Git source
// +optional
GitHTTPProxy string `json:"gitHTTPProxy,omitempty"`

// GitHTTPSProxy is the location of the HTTPSProxy for Git source
// +optional
GitHTTPSProxy string `json:"gitHTTPSProxy,omitempty"`

// GitNoProxy is the list of domains for which the proxy should not be used
// +optional
GitNoProxy string `json:"gitNoProxy,omitempty"`

// Env is a set of default environment variables that will be applied to the
// build if the specified variables do not exist on the build
// +optional
Env []corev1.EnvVar `json:"env,omitempty"`

// ImageLabels is a list of docker labels that are applied to the resulting image.
// User can override a default label by providing a label with the same name in their
// Build/BuildConfig.
// +optional
ImageLabels []ImageLabel `json:"imageLabels,omitempty"`

// Resources defines resource requirements to execute the build.
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

type ImageLabel struct {
// Name defines the name of the label. It must have non-zero length.
Name string `json:"name"`

// Value defines the literal value of the label.
// +optional
Value string `json:"value,omitempty"`
}

type BuildOverrides struct {
// ImageLabels is a list of docker labels that are applied to the resulting image.
// If user provided a label in their Build/BuildConfig with the same name as one in this
// list, the user's label will be overwritten.
// +optional
ImageLabels []ImageLabel `json:"imageLabels,omitempty"`

// NodeSelector is a selector which must be true for the build pod to fit on a node
// +optional
NodeSelector metav1.LabelSelector `json:"nodeSelector,omitempty"`

// Tolerations is a list of Tolerations that will override any existing
// tolerations set on a build pod.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type BuildList struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ListMeta `json:"metadata,omitempty"`
Items []Build `json:"items"`
}
37 changes: 37 additions & 0 deletions config/v1/types_console.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package v1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Console holds cluster-wide information about Console. The canonical name is `cluster`
// TODO this object is an example of a possible grouping and is subject to change or removal
type Console struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ObjectMeta `json:"metadata,omitempty"`

// spec holds user settable values for configuration
Spec ConsoleSpec `json:"spec"`
// status holds observed values from the cluster. They may not be overridden.
Status ConsoleStatus `json:"status"`
}

type ConsoleSpec struct {
// special console public url?
}

type ConsoleStatus struct {
// console public url
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ConsoleList struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ListMeta `json:"metadata,omitempty"`
Items []Console `json:"items"`
}
Loading