forked from LaconicNetwork/kompose
implement expose service, add tests, fix #140
Implements a kompose specific docker compose label "kompose.service.expose" which can be used to expose the specified services externally. The accepted values are of type string. If the value is set to "true", the provider sets the endpoint automatically, and for any other value, the value is set as the hostname. If multiple ports are defined in a service, the first one is chosen to be the exposed. Unit tests, functional tests, glide updates and docs have also been added in this commit for the related feature.
This commit is contained in:
+109
@@ -0,0 +1,109 @@
|
||||
package install
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apimachinery"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
|
||||
"github.com/openshift/origin/pkg/route/api"
|
||||
"github.com/openshift/origin/pkg/route/api/v1"
|
||||
)
|
||||
|
||||
const importPrefix = "github.com/openshift/origin/pkg/route/api"
|
||||
|
||||
var accessor = meta.NewAccessor()
|
||||
|
||||
// availableVersions lists all known external versions for this group from most preferred to least preferred
|
||||
var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
||||
|
||||
func init() {
|
||||
registered.RegisterVersions(availableVersions)
|
||||
externalVersions := []unversioned.GroupVersion{}
|
||||
for _, v := range availableVersions {
|
||||
if registered.IsAllowedVersion(v) {
|
||||
externalVersions = append(externalVersions, v)
|
||||
}
|
||||
}
|
||||
if len(externalVersions) == 0 {
|
||||
glog.Infof("No version is registered for group %v", api.GroupName)
|
||||
return
|
||||
}
|
||||
|
||||
if err := registered.EnableVersions(externalVersions...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := enableVersions(externalVersions); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: enableVersions should be centralized rather than spread in each API
|
||||
// group.
|
||||
// We can combine registered.RegisterVersions, registered.EnableVersions and
|
||||
// registered.RegisterGroup once we have moved enableVersions there.
|
||||
func enableVersions(externalVersions []unversioned.GroupVersion) error {
|
||||
addVersionsToScheme(externalVersions...)
|
||||
preferredExternalVersion := externalVersions[0]
|
||||
|
||||
groupMeta := apimachinery.GroupMeta{
|
||||
GroupVersion: preferredExternalVersion,
|
||||
GroupVersions: externalVersions,
|
||||
RESTMapper: newRESTMapper(externalVersions),
|
||||
SelfLinker: runtime.SelfLinker(accessor),
|
||||
InterfacesFor: interfacesFor,
|
||||
}
|
||||
|
||||
if err := registered.RegisterGroup(groupMeta); err != nil {
|
||||
return err
|
||||
}
|
||||
kapi.RegisterRESTMapper(groupMeta.RESTMapper)
|
||||
return nil
|
||||
}
|
||||
|
||||
func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
||||
// add the internal version to Scheme
|
||||
api.AddToScheme(kapi.Scheme)
|
||||
// add the enabled external versions to Scheme
|
||||
for _, v := range externalVersions {
|
||||
if !registered.IsEnabledVersion(v) {
|
||||
glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v)
|
||||
continue
|
||||
}
|
||||
switch v {
|
||||
case v1.SchemeGroupVersion:
|
||||
v1.AddToScheme(kapi.Scheme)
|
||||
|
||||
default:
|
||||
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
|
||||
rootScoped := sets.NewString()
|
||||
ignoredKinds := sets.NewString()
|
||||
return kapi.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
|
||||
}
|
||||
|
||||
func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) {
|
||||
switch version {
|
||||
case v1.SchemeGroupVersion:
|
||||
return &meta.VersionInterfaces{
|
||||
ObjectConvertor: kapi.Scheme,
|
||||
MetadataAccessor: accessor,
|
||||
}, nil
|
||||
|
||||
default:
|
||||
g, _ := registered.Group(api.GroupName)
|
||||
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
|
||||
oapi "github.com/openshift/origin/pkg/api"
|
||||
routeapi "github.com/openshift/origin/pkg/route/api"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddFieldLabelConversionFunc("v1", "Route",
|
||||
oapi.GetFieldLabelConversionFunc(routeapi.RouteToSelectableFields(&routeapi.Route{}), nil),
|
||||
)
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package v1
|
||||
|
||||
import "k8s.io/kubernetes/pkg/runtime"
|
||||
|
||||
func SetDefaults_RouteSpec(obj *RouteSpec) {
|
||||
if len(obj.WildcardPolicy) == 0 {
|
||||
obj.WildcardPolicy = WildcardPolicyNone
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_RouteTargetReference(obj *RouteTargetReference) {
|
||||
if len(obj.Kind) == 0 {
|
||||
obj.Kind = "Service"
|
||||
}
|
||||
if obj.Weight == nil {
|
||||
obj.Weight = new(int32)
|
||||
*obj.Weight = 100
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_TLSConfig(obj *TLSConfig) {
|
||||
if len(obj.Termination) == 0 && len(obj.DestinationCACertificate) == 0 {
|
||||
obj.Termination = TLSTerminationEdge
|
||||
}
|
||||
switch obj.Termination {
|
||||
case TLSTerminationType("Reencrypt"):
|
||||
obj.Termination = TLSTerminationReencrypt
|
||||
case TLSTerminationType("Edge"):
|
||||
obj.Termination = TLSTerminationEdge
|
||||
case TLSTerminationType("Passthrough"):
|
||||
obj.Termination = TLSTerminationPassthrough
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_RouteIngress(obj *RouteIngress) {
|
||||
if len(obj.WildcardPolicy) == 0 {
|
||||
obj.WildcardPolicy = WildcardPolicyNone
|
||||
}
|
||||
}
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddDefaultingFuncs(
|
||||
SetDefaults_RouteSpec,
|
||||
SetDefaults_RouteTargetReference,
|
||||
SetDefaults_TLSConfig,
|
||||
SetDefaults_RouteIngress,
|
||||
)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=github.com/openshift/origin/pkg/route/api
|
||||
|
||||
// Package v1 is the v1 version of the API.
|
||||
package v1
|
||||
+2492
File diff suppressed because it is too large
Load Diff
+28
@@ -0,0 +1,28 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
const GroupName = ""
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addDefaultingFuncs)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Route{},
|
||||
&RouteList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (obj *Route) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *RouteList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package v1
|
||||
|
||||
// This file contains methods that can be used by the go-restful package to generate Swagger
|
||||
// documentation for the object types found in 'types.go' This file is automatically generated
|
||||
// by hack/update-generated-swagger-descriptions.sh and should be run after a full build of OpenShift.
|
||||
// ==== DO NOT EDIT THIS FILE MANUALLY ====
|
||||
|
||||
var map_Route = map[string]string{
|
||||
"": "A route allows developers to expose services through an HTTP(S) aware load balancing and proxy layer via a public DNS entry. The route may further specify TLS options and a certificate, or specify a public CNAME that the router should also accept for HTTP and HTTPS traffic. An administrator typically configures their router to be visible outside the cluster firewall, and may also add additional security, caching, or traffic controls on the service content. Routers usually talk directly to the service endpoints.\n\nOnce a route is created, the `host` field may not be changed. Generally, routers use the oldest route with a given host when resolving conflicts.\n\nRouters are subject to additional customization and may support additional controls via the annotations field.\n\nBecause administrators may configure multiple routers, the route status field is used to return information to clients about the names and states of the route under each router. If a client chooses a duplicate name, for instance, the route status conditions are used to indicate the route cannot be chosen.",
|
||||
"metadata": "Standard object metadata.",
|
||||
"spec": "spec is the desired state of the route",
|
||||
"status": "status is the current state of the route",
|
||||
}
|
||||
|
||||
func (Route) SwaggerDoc() map[string]string {
|
||||
return map_Route
|
||||
}
|
||||
|
||||
var map_RouteIngress = map[string]string{
|
||||
"": "RouteIngress holds information about the places where a route is exposed.",
|
||||
"host": "Host is the host string under which the route is exposed; this value is required",
|
||||
"routerName": "Name is a name chosen by the router to identify itself; this value is required",
|
||||
"conditions": "Conditions is the state of the route, may be empty.",
|
||||
"wildcardPolicy": "Wildcard policy is the wildcard policy that was allowed where this route is exposed.",
|
||||
}
|
||||
|
||||
func (RouteIngress) SwaggerDoc() map[string]string {
|
||||
return map_RouteIngress
|
||||
}
|
||||
|
||||
var map_RouteIngressCondition = map[string]string{
|
||||
"": "RouteIngressCondition contains details for the current condition of this route on a particular router.",
|
||||
"type": "Type is the type of the condition. Currently only Ready.",
|
||||
"status": "Status is the status of the condition. Can be True, False, Unknown.",
|
||||
"reason": "(brief) reason for the condition's last transition, and is usually a machine and human readable constant",
|
||||
"message": "Human readable message indicating details about last transition.",
|
||||
"lastTransitionTime": "RFC 3339 date and time when this condition last transitioned",
|
||||
}
|
||||
|
||||
func (RouteIngressCondition) SwaggerDoc() map[string]string {
|
||||
return map_RouteIngressCondition
|
||||
}
|
||||
|
||||
var map_RouteList = map[string]string{
|
||||
"": "RouteList is a collection of Routes.",
|
||||
"metadata": "Standard object metadata.",
|
||||
"items": "items is a list of routes",
|
||||
}
|
||||
|
||||
func (RouteList) SwaggerDoc() map[string]string {
|
||||
return map_RouteList
|
||||
}
|
||||
|
||||
var map_RoutePort = map[string]string{
|
||||
"": "RoutePort defines a port mapping from a router to an endpoint in the service endpoints.",
|
||||
"targetPort": "The target port on pods selected by the service this route points to. If this is a string, it will be looked up as a named port in the target endpoints port list. Required",
|
||||
}
|
||||
|
||||
func (RoutePort) SwaggerDoc() map[string]string {
|
||||
return map_RoutePort
|
||||
}
|
||||
|
||||
var map_RouteSpec = map[string]string{
|
||||
"": "RouteSpec describes the hostname or path the route exposes, any security information, and one or more backends the route points to. Weights on each backend can define the balance of traffic sent to each backend - if all weights are zero the route will be considered to have no backends and return a standard 503 response.\n\nThe `tls` field is optional and allows specific certificates or behavior for the route. Routers typically configure a default certificate on a wildcard domain to terminate routes without explicit certificates, but custom hostnames usually must choose passthrough (send traffic directly to the backend via the TLS Server-Name- Indication field) or provide a certificate.",
|
||||
"host": "host is an alias/DNS that points to the service. Optional. If not specified a route name will typically be automatically chosen. Must follow DNS952 subdomain conventions.",
|
||||
"path": "Path that the router watches for, to route traffic for to the service. Optional",
|
||||
"to": "to is an object the route should use as the primary backend. Only the Service kind is allowed, and it will be defaulted to Service. If the weight field is set to zero, no traffic will be sent to this service.",
|
||||
"alternateBackends": "alternateBackends is an extension of the 'to' field. If more than one service needs to be pointed to, then use this field. Use the weight field in RouteTargetReference object to specify relative preference. If the weight field is zero, the backend is ignored.",
|
||||
"port": "If specified, the port to be used by the router. Most routers will use all endpoints exposed by the service by default - set this value to instruct routers which port to use.",
|
||||
"tls": "The tls field provides the ability to configure certificates and termination for the route.",
|
||||
"wildcardPolicy": "Wildcard policy if any for the route. Currently only 'Subdomain' or 'None' is allowed.",
|
||||
}
|
||||
|
||||
func (RouteSpec) SwaggerDoc() map[string]string {
|
||||
return map_RouteSpec
|
||||
}
|
||||
|
||||
var map_RouteStatus = map[string]string{
|
||||
"": "RouteStatus provides relevant info about the status of a route, including which routers acknowledge it.",
|
||||
"ingress": "ingress describes the places where the route may be exposed. The list of ingress points may contain duplicate Host or RouterName values. Routes are considered live once they are `Ready`",
|
||||
}
|
||||
|
||||
func (RouteStatus) SwaggerDoc() map[string]string {
|
||||
return map_RouteStatus
|
||||
}
|
||||
|
||||
var map_RouteTargetReference = map[string]string{
|
||||
"": "RouteTargetReference specifies the target that resolve into endpoints. Only the 'Service' kind is allowed. Use 'weight' field to emphasize one over others.",
|
||||
"kind": "The kind of target that the route is referring to. Currently, only 'Service' is allowed",
|
||||
"name": "name of the service/target that is being referred to. e.g. name of the service",
|
||||
"weight": "weight as an integer between 1 and 256 that specifies the target's relative weight against other target reference objects",
|
||||
}
|
||||
|
||||
func (RouteTargetReference) SwaggerDoc() map[string]string {
|
||||
return map_RouteTargetReference
|
||||
}
|
||||
|
||||
var map_RouterShard = map[string]string{
|
||||
"": "RouterShard has information of a routing shard and is used to generate host names and routing table entries when a routing shard is allocated for a specific route. Caveat: This is WIP and will likely undergo modifications when sharding\n support is added.",
|
||||
"shardName": "shardName uniquely identifies a router shard in the \"set\" of routers used for routing traffic to the services.",
|
||||
"dnsSuffix": "dnsSuffix for the shard ala: shard-1.v3.openshift.com",
|
||||
}
|
||||
|
||||
func (RouterShard) SwaggerDoc() map[string]string {
|
||||
return map_RouterShard
|
||||
}
|
||||
|
||||
var map_TLSConfig = map[string]string{
|
||||
"": "TLSConfig defines config used to secure a route and provide termination",
|
||||
"termination": "termination indicates termination type.",
|
||||
"certificate": "certificate provides certificate contents",
|
||||
"key": "key provides key file contents",
|
||||
"caCertificate": "caCertificate provides the cert authority certificate contents",
|
||||
"destinationCACertificate": "destinationCACertificate provides the contents of the ca certificate of the final destination. When using reencrypt termination this file should be provided in order to have routers use it for health checks on the secure connection",
|
||||
"insecureEdgeTerminationPolicy": "insecureEdgeTerminationPolicy indicates the desired behavior for insecure connections to a route. While each router may make its own decisions on which ports to expose, this is normally port 80.\n\n* Allow - traffic is sent to the server on the insecure port (default) * Disable - no traffic is allowed on the insecure port. * Redirect - clients are redirected to the secure port.",
|
||||
}
|
||||
|
||||
func (TLSConfig) SwaggerDoc() map[string]string {
|
||||
return map_TLSConfig
|
||||
}
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
kapi "k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// +genclient=true
|
||||
|
||||
// A route allows developers to expose services through an HTTP(S) aware load balancing and proxy
|
||||
// layer via a public DNS entry. The route may further specify TLS options and a certificate, or
|
||||
// specify a public CNAME that the router should also accept for HTTP and HTTPS traffic. An
|
||||
// administrator typically configures their router to be visible outside the cluster firewall, and
|
||||
// may also add additional security, caching, or traffic controls on the service content. Routers
|
||||
// usually talk directly to the service endpoints.
|
||||
//
|
||||
// Once a route is created, the `host` field may not be changed. Generally, routers use the oldest
|
||||
// route with a given host when resolving conflicts.
|
||||
//
|
||||
// Routers are subject to additional customization and may support additional controls via the
|
||||
// annotations field.
|
||||
//
|
||||
// Because administrators may configure multiple routers, the route status field is used to
|
||||
// return information to clients about the names and states of the route under each router.
|
||||
// If a client chooses a duplicate name, for instance, the route status conditions are used
|
||||
// to indicate the route cannot be chosen.
|
||||
type Route struct {
|
||||
unversioned.TypeMeta `json:",inline"`
|
||||
// Standard object metadata.
|
||||
kapi.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// spec is the desired state of the route
|
||||
Spec RouteSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
|
||||
// status is the current state of the route
|
||||
Status RouteStatus `json:"status" protobuf:"bytes,3,opt,name=status"`
|
||||
}
|
||||
|
||||
// RouteList is a collection of Routes.
|
||||
type RouteList struct {
|
||||
unversioned.TypeMeta `json:",inline"`
|
||||
// Standard object metadata.
|
||||
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// items is a list of routes
|
||||
Items []Route `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||
}
|
||||
|
||||
// RouteSpec describes the hostname or path the route exposes, any security information,
|
||||
// and one or more backends the route points to. Weights on each backend can define
|
||||
// the balance of traffic sent to each backend - if all weights are zero the route will
|
||||
// be considered to have no backends and return a standard 503 response.
|
||||
//
|
||||
// The `tls` field is optional and allows specific certificates or behavior for the
|
||||
// route. Routers typically configure a default certificate on a wildcard domain to
|
||||
// terminate routes without explicit certificates, but custom hostnames usually must
|
||||
// choose passthrough (send traffic directly to the backend via the TLS Server-Name-
|
||||
// Indication field) or provide a certificate.
|
||||
type RouteSpec struct {
|
||||
// host is an alias/DNS that points to the service. Optional.
|
||||
// If not specified a route name will typically be automatically
|
||||
// chosen.
|
||||
// Must follow DNS952 subdomain conventions.
|
||||
Host string `json:"host" protobuf:"bytes,1,opt,name=host"`
|
||||
// Path that the router watches for, to route traffic for to the service. Optional
|
||||
Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"`
|
||||
|
||||
// to is an object the route should use as the primary backend. Only the Service kind
|
||||
// is allowed, and it will be defaulted to Service. If the weight field is set to zero,
|
||||
// no traffic will be sent to this service.
|
||||
To RouteTargetReference `json:"to" protobuf:"bytes,3,opt,name=to"`
|
||||
|
||||
// alternateBackends is an extension of the 'to' field. If more than one service needs to be
|
||||
// pointed to, then use this field. Use the weight field in RouteTargetReference object
|
||||
// to specify relative preference. If the weight field is zero, the backend is ignored.
|
||||
AlternateBackends []RouteTargetReference `json:"alternateBackends,omitempty" protobuf:"bytes,4,rep,name=alternateBackends"`
|
||||
|
||||
// If specified, the port to be used by the router. Most routers will use all
|
||||
// endpoints exposed by the service by default - set this value to instruct routers
|
||||
// which port to use.
|
||||
Port *RoutePort `json:"port,omitempty" protobuf:"bytes,5,opt,name=port"`
|
||||
|
||||
// The tls field provides the ability to configure certificates and termination for the route.
|
||||
TLS *TLSConfig `json:"tls,omitempty" protobuf:"bytes,6,opt,name=tls"`
|
||||
|
||||
// Wildcard policy if any for the route.
|
||||
// Currently only 'Subdomain' or 'None' is allowed.
|
||||
WildcardPolicy WildcardPolicyType `json:"wildcardPolicy,omitempty" protobuf:"bytes,7,opt,name=wildcardPolicy"`
|
||||
}
|
||||
|
||||
// RouteTargetReference specifies the target that resolve into endpoints. Only the 'Service'
|
||||
// kind is allowed. Use 'weight' field to emphasize one over others.
|
||||
type RouteTargetReference struct {
|
||||
// The kind of target that the route is referring to. Currently, only 'Service' is allowed
|
||||
Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`
|
||||
|
||||
// name of the service/target that is being referred to. e.g. name of the service
|
||||
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
|
||||
|
||||
// weight as an integer between 1 and 256 that specifies the target's relative weight
|
||||
// against other target reference objects
|
||||
Weight *int32 `json:"weight" protobuf:"varint,3,opt,name=weight"`
|
||||
}
|
||||
|
||||
// RoutePort defines a port mapping from a router to an endpoint in the service endpoints.
|
||||
type RoutePort struct {
|
||||
// The target port on pods selected by the service this route points to.
|
||||
// If this is a string, it will be looked up as a named port in the target
|
||||
// endpoints port list. Required
|
||||
TargetPort intstr.IntOrString `json:"targetPort" protobuf:"bytes,1,opt,name=targetPort"`
|
||||
}
|
||||
|
||||
// RouteStatus provides relevant info about the status of a route, including which routers
|
||||
// acknowledge it.
|
||||
type RouteStatus struct {
|
||||
// ingress describes the places where the route may be exposed. The list of
|
||||
// ingress points may contain duplicate Host or RouterName values. Routes
|
||||
// are considered live once they are `Ready`
|
||||
Ingress []RouteIngress `json:"ingress" protobuf:"bytes,1,rep,name=ingress"`
|
||||
}
|
||||
|
||||
// RouteIngress holds information about the places where a route is exposed.
|
||||
type RouteIngress struct {
|
||||
// Host is the host string under which the route is exposed; this value is required
|
||||
Host string `json:"host,omitempty" protobuf:"bytes,1,opt,name=host"`
|
||||
// Name is a name chosen by the router to identify itself; this value is required
|
||||
RouterName string `json:"routerName,omitempty" protobuf:"bytes,2,opt,name=routerName"`
|
||||
// Conditions is the state of the route, may be empty.
|
||||
Conditions []RouteIngressCondition `json:"conditions,omitempty" protobuf:"bytes,3,rep,name=conditions"`
|
||||
// Wildcard policy is the wildcard policy that was allowed where this route is exposed.
|
||||
WildcardPolicy WildcardPolicyType `json:"wildcardPolicy,omitempty" protobuf:"bytes,4,opt,name=wildcardPolicy"`
|
||||
}
|
||||
|
||||
// RouteIngressConditionType is a valid value for RouteCondition
|
||||
type RouteIngressConditionType string
|
||||
|
||||
// These are valid conditions of pod.
|
||||
const (
|
||||
// RouteAdmitted means the route is able to service requests for the provided Host
|
||||
RouteAdmitted RouteIngressConditionType = "Admitted"
|
||||
// TODO: add other route condition types
|
||||
)
|
||||
|
||||
// RouteIngressCondition contains details for the current condition of this route on a particular
|
||||
// router.
|
||||
type RouteIngressCondition struct {
|
||||
// Type is the type of the condition.
|
||||
// Currently only Ready.
|
||||
Type RouteIngressConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=RouteIngressConditionType"`
|
||||
// Status is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
Status kapi.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
|
||||
// (brief) reason for the condition's last transition, and is usually a machine and human
|
||||
// readable constant
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
|
||||
// Human readable message indicating details about last transition.
|
||||
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
|
||||
// RFC 3339 date and time when this condition last transitioned
|
||||
LastTransitionTime *unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,5,opt,name=lastTransitionTime"`
|
||||
}
|
||||
|
||||
// RouterShard has information of a routing shard and is used to
|
||||
// generate host names and routing table entries when a routing shard is
|
||||
// allocated for a specific route.
|
||||
// Caveat: This is WIP and will likely undergo modifications when sharding
|
||||
// support is added.
|
||||
type RouterShard struct {
|
||||
// shardName uniquely identifies a router shard in the "set" of
|
||||
// routers used for routing traffic to the services.
|
||||
ShardName string `json:"shardName" protobuf:"bytes,1,opt,name=shardName"`
|
||||
|
||||
// dnsSuffix for the shard ala: shard-1.v3.openshift.com
|
||||
DNSSuffix string `json:"dnsSuffix" protobuf:"bytes,2,opt,name=dnsSuffix"`
|
||||
}
|
||||
|
||||
// TLSConfig defines config used to secure a route and provide termination
|
||||
type TLSConfig struct {
|
||||
// termination indicates termination type.
|
||||
Termination TLSTerminationType `json:"termination" protobuf:"bytes,1,opt,name=termination,casttype=TLSTerminationType"`
|
||||
|
||||
// certificate provides certificate contents
|
||||
Certificate string `json:"certificate,omitempty" protobuf:"bytes,2,opt,name=certificate"`
|
||||
|
||||
// key provides key file contents
|
||||
Key string `json:"key,omitempty" protobuf:"bytes,3,opt,name=key"`
|
||||
|
||||
// caCertificate provides the cert authority certificate contents
|
||||
CACertificate string `json:"caCertificate,omitempty" protobuf:"bytes,4,opt,name=caCertificate"`
|
||||
|
||||
// destinationCACertificate provides the contents of the ca certificate of the final destination. When using reencrypt
|
||||
// termination this file should be provided in order to have routers use it for health checks on the secure connection
|
||||
DestinationCACertificate string `json:"destinationCACertificate,omitempty" protobuf:"bytes,5,opt,name=destinationCACertificate"`
|
||||
|
||||
// insecureEdgeTerminationPolicy indicates the desired behavior for insecure connections to a route. While
|
||||
// each router may make its own decisions on which ports to expose, this is normally port 80.
|
||||
//
|
||||
// * Allow - traffic is sent to the server on the insecure port (default)
|
||||
// * Disable - no traffic is allowed on the insecure port.
|
||||
// * Redirect - clients are redirected to the secure port.
|
||||
InsecureEdgeTerminationPolicy InsecureEdgeTerminationPolicyType `json:"insecureEdgeTerminationPolicy,omitempty" protobuf:"bytes,6,opt,name=insecureEdgeTerminationPolicy,casttype=InsecureEdgeTerminationPolicyType"`
|
||||
}
|
||||
|
||||
// TLSTerminationType dictates where the secure communication will stop
|
||||
// TODO: Reconsider this type in v2
|
||||
type TLSTerminationType string
|
||||
|
||||
// InsecureEdgeTerminationPolicyType dictates the behavior of insecure
|
||||
// connections to an edge-terminated route.
|
||||
type InsecureEdgeTerminationPolicyType string
|
||||
|
||||
const (
|
||||
// TLSTerminationEdge terminate encryption at the edge router.
|
||||
TLSTerminationEdge TLSTerminationType = "edge"
|
||||
// TLSTerminationPassthrough terminate encryption at the destination, the destination is responsible for decrypting traffic
|
||||
TLSTerminationPassthrough TLSTerminationType = "passthrough"
|
||||
// TLSTerminationReencrypt terminate encryption at the edge router and re-encrypt it with a new certificate supplied by the destination
|
||||
TLSTerminationReencrypt TLSTerminationType = "reencrypt"
|
||||
)
|
||||
|
||||
// WildcardPolicyType indicates the type of wildcard support needed by routes.
|
||||
type WildcardPolicyType string
|
||||
|
||||
const (
|
||||
// WildcardPolicyNone indicates no wildcard support is needed.
|
||||
WildcardPolicyNone WildcardPolicyType = "None"
|
||||
|
||||
// WildcardPolicySubdomain indicates the host needs wildcard support for the subdomain.
|
||||
// Example: For host = "www.acme.test", indicates that the router
|
||||
// should support requests for *.acme.test
|
||||
// Note that this will not match acme.test only *.acme.test
|
||||
WildcardPolicySubdomain WildcardPolicyType = "Subdomain"
|
||||
)
|
||||
+424
@@ -0,0 +1,424 @@
|
||||
// +build !ignore_autogenerated_openshift
|
||||
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
api "github.com/openshift/origin/pkg/route/api"
|
||||
pkg_api "k8s.io/kubernetes/pkg/api"
|
||||
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1_Route_To_api_Route,
|
||||
Convert_api_Route_To_v1_Route,
|
||||
Convert_v1_RouteIngress_To_api_RouteIngress,
|
||||
Convert_api_RouteIngress_To_v1_RouteIngress,
|
||||
Convert_v1_RouteIngressCondition_To_api_RouteIngressCondition,
|
||||
Convert_api_RouteIngressCondition_To_v1_RouteIngressCondition,
|
||||
Convert_v1_RouteList_To_api_RouteList,
|
||||
Convert_api_RouteList_To_v1_RouteList,
|
||||
Convert_v1_RoutePort_To_api_RoutePort,
|
||||
Convert_api_RoutePort_To_v1_RoutePort,
|
||||
Convert_v1_RouteSpec_To_api_RouteSpec,
|
||||
Convert_api_RouteSpec_To_v1_RouteSpec,
|
||||
Convert_v1_RouteStatus_To_api_RouteStatus,
|
||||
Convert_api_RouteStatus_To_v1_RouteStatus,
|
||||
Convert_v1_RouteTargetReference_To_api_RouteTargetReference,
|
||||
Convert_api_RouteTargetReference_To_v1_RouteTargetReference,
|
||||
Convert_v1_RouterShard_To_api_RouterShard,
|
||||
Convert_api_RouterShard_To_v1_RouterShard,
|
||||
Convert_v1_TLSConfig_To_api_TLSConfig,
|
||||
Convert_api_TLSConfig_To_v1_TLSConfig,
|
||||
)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Route_To_api_Route(in *Route, out *api.Route, s conversion.Scope) error {
|
||||
if err := pkg_api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api_v1.Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_RouteSpec_To_api_RouteSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_RouteStatus_To_api_RouteStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_Route_To_api_Route(in *Route, out *api.Route, s conversion.Scope) error {
|
||||
return autoConvert_v1_Route_To_api_Route(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_Route_To_v1_Route(in *api.Route, out *Route, s conversion.Scope) error {
|
||||
if err := pkg_api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api_v1.Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_api_RouteSpec_To_v1_RouteSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_api_RouteStatus_To_v1_RouteStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_Route_To_v1_Route(in *api.Route, out *Route, s conversion.Scope) error {
|
||||
return autoConvert_api_Route_To_v1_Route(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouteIngress_To_api_RouteIngress(in *RouteIngress, out *api.RouteIngress, s conversion.Scope) error {
|
||||
SetDefaults_RouteIngress(in)
|
||||
out.Host = in.Host
|
||||
out.RouterName = in.RouterName
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]api.RouteIngressCondition, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_RouteIngressCondition_To_api_RouteIngressCondition(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
out.WildcardPolicy = api.WildcardPolicyType(in.WildcardPolicy)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouteIngress_To_api_RouteIngress(in *RouteIngress, out *api.RouteIngress, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouteIngress_To_api_RouteIngress(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouteIngress_To_v1_RouteIngress(in *api.RouteIngress, out *RouteIngress, s conversion.Scope) error {
|
||||
out.Host = in.Host
|
||||
out.RouterName = in.RouterName
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]RouteIngressCondition, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_api_RouteIngressCondition_To_v1_RouteIngressCondition(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
out.WildcardPolicy = WildcardPolicyType(in.WildcardPolicy)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouteIngress_To_v1_RouteIngress(in *api.RouteIngress, out *RouteIngress, s conversion.Scope) error {
|
||||
return autoConvert_api_RouteIngress_To_v1_RouteIngress(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouteIngressCondition_To_api_RouteIngressCondition(in *RouteIngressCondition, out *api.RouteIngressCondition, s conversion.Scope) error {
|
||||
out.Type = api.RouteIngressConditionType(in.Type)
|
||||
out.Status = pkg_api.ConditionStatus(in.Status)
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouteIngressCondition_To_api_RouteIngressCondition(in *RouteIngressCondition, out *api.RouteIngressCondition, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouteIngressCondition_To_api_RouteIngressCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouteIngressCondition_To_v1_RouteIngressCondition(in *api.RouteIngressCondition, out *RouteIngressCondition, s conversion.Scope) error {
|
||||
out.Type = RouteIngressConditionType(in.Type)
|
||||
out.Status = api_v1.ConditionStatus(in.Status)
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouteIngressCondition_To_v1_RouteIngressCondition(in *api.RouteIngressCondition, out *RouteIngressCondition, s conversion.Scope) error {
|
||||
return autoConvert_api_RouteIngressCondition_To_v1_RouteIngressCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouteList_To_api_RouteList(in *RouteList, out *api.RouteList, s conversion.Scope) error {
|
||||
if err := pkg_api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := pkg_api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]api.Route, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_Route_To_api_Route(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouteList_To_api_RouteList(in *RouteList, out *api.RouteList, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouteList_To_api_RouteList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouteList_To_v1_RouteList(in *api.RouteList, out *RouteList, s conversion.Scope) error {
|
||||
if err := pkg_api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := pkg_api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Route, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_api_Route_To_v1_Route(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouteList_To_v1_RouteList(in *api.RouteList, out *RouteList, s conversion.Scope) error {
|
||||
return autoConvert_api_RouteList_To_v1_RouteList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RoutePort_To_api_RoutePort(in *RoutePort, out *api.RoutePort, s conversion.Scope) error {
|
||||
if err := pkg_api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.TargetPort, &out.TargetPort, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RoutePort_To_api_RoutePort(in *RoutePort, out *api.RoutePort, s conversion.Scope) error {
|
||||
return autoConvert_v1_RoutePort_To_api_RoutePort(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RoutePort_To_v1_RoutePort(in *api.RoutePort, out *RoutePort, s conversion.Scope) error {
|
||||
if err := pkg_api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.TargetPort, &out.TargetPort, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RoutePort_To_v1_RoutePort(in *api.RoutePort, out *RoutePort, s conversion.Scope) error {
|
||||
return autoConvert_api_RoutePort_To_v1_RoutePort(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *api.RouteSpec, s conversion.Scope) error {
|
||||
SetDefaults_RouteSpec(in)
|
||||
out.Host = in.Host
|
||||
out.Path = in.Path
|
||||
if err := Convert_v1_RouteTargetReference_To_api_RouteTargetReference(&in.To, &out.To, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.AlternateBackends != nil {
|
||||
in, out := &in.AlternateBackends, &out.AlternateBackends
|
||||
*out = make([]api.RouteTargetReference, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_RouteTargetReference_To_api_RouteTargetReference(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.AlternateBackends = nil
|
||||
}
|
||||
if in.Port != nil {
|
||||
in, out := &in.Port, &out.Port
|
||||
*out = new(api.RoutePort)
|
||||
if err := Convert_v1_RoutePort_To_api_RoutePort(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Port = nil
|
||||
}
|
||||
if in.TLS != nil {
|
||||
in, out := &in.TLS, &out.TLS
|
||||
*out = new(api.TLSConfig)
|
||||
if err := Convert_v1_TLSConfig_To_api_TLSConfig(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.TLS = nil
|
||||
}
|
||||
out.WildcardPolicy = api.WildcardPolicyType(in.WildcardPolicy)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *api.RouteSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouteSpec_To_api_RouteSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouteSpec_To_v1_RouteSpec(in *api.RouteSpec, out *RouteSpec, s conversion.Scope) error {
|
||||
out.Host = in.Host
|
||||
out.Path = in.Path
|
||||
if err := Convert_api_RouteTargetReference_To_v1_RouteTargetReference(&in.To, &out.To, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.AlternateBackends != nil {
|
||||
in, out := &in.AlternateBackends, &out.AlternateBackends
|
||||
*out = make([]RouteTargetReference, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_api_RouteTargetReference_To_v1_RouteTargetReference(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.AlternateBackends = nil
|
||||
}
|
||||
if in.Port != nil {
|
||||
in, out := &in.Port, &out.Port
|
||||
*out = new(RoutePort)
|
||||
if err := Convert_api_RoutePort_To_v1_RoutePort(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Port = nil
|
||||
}
|
||||
if in.TLS != nil {
|
||||
in, out := &in.TLS, &out.TLS
|
||||
*out = new(TLSConfig)
|
||||
if err := Convert_api_TLSConfig_To_v1_TLSConfig(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.TLS = nil
|
||||
}
|
||||
out.WildcardPolicy = WildcardPolicyType(in.WildcardPolicy)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouteSpec_To_v1_RouteSpec(in *api.RouteSpec, out *RouteSpec, s conversion.Scope) error {
|
||||
return autoConvert_api_RouteSpec_To_v1_RouteSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouteStatus_To_api_RouteStatus(in *RouteStatus, out *api.RouteStatus, s conversion.Scope) error {
|
||||
if in.Ingress != nil {
|
||||
in, out := &in.Ingress, &out.Ingress
|
||||
*out = make([]api.RouteIngress, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_RouteIngress_To_api_RouteIngress(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Ingress = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouteStatus_To_api_RouteStatus(in *RouteStatus, out *api.RouteStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouteStatus_To_api_RouteStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouteStatus_To_v1_RouteStatus(in *api.RouteStatus, out *RouteStatus, s conversion.Scope) error {
|
||||
if in.Ingress != nil {
|
||||
in, out := &in.Ingress, &out.Ingress
|
||||
*out = make([]RouteIngress, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_api_RouteIngress_To_v1_RouteIngress(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Ingress = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouteStatus_To_v1_RouteStatus(in *api.RouteStatus, out *RouteStatus, s conversion.Scope) error {
|
||||
return autoConvert_api_RouteStatus_To_v1_RouteStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouteTargetReference_To_api_RouteTargetReference(in *RouteTargetReference, out *api.RouteTargetReference, s conversion.Scope) error {
|
||||
SetDefaults_RouteTargetReference(in)
|
||||
out.Kind = in.Kind
|
||||
out.Name = in.Name
|
||||
out.Weight = in.Weight
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouteTargetReference_To_api_RouteTargetReference(in *RouteTargetReference, out *api.RouteTargetReference, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouteTargetReference_To_api_RouteTargetReference(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouteTargetReference_To_v1_RouteTargetReference(in *api.RouteTargetReference, out *RouteTargetReference, s conversion.Scope) error {
|
||||
out.Kind = in.Kind
|
||||
out.Name = in.Name
|
||||
out.Weight = in.Weight
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouteTargetReference_To_v1_RouteTargetReference(in *api.RouteTargetReference, out *RouteTargetReference, s conversion.Scope) error {
|
||||
return autoConvert_api_RouteTargetReference_To_v1_RouteTargetReference(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RouterShard_To_api_RouterShard(in *RouterShard, out *api.RouterShard, s conversion.Scope) error {
|
||||
out.ShardName = in.ShardName
|
||||
out.DNSSuffix = in.DNSSuffix
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_RouterShard_To_api_RouterShard(in *RouterShard, out *api.RouterShard, s conversion.Scope) error {
|
||||
return autoConvert_v1_RouterShard_To_api_RouterShard(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_RouterShard_To_v1_RouterShard(in *api.RouterShard, out *RouterShard, s conversion.Scope) error {
|
||||
out.ShardName = in.ShardName
|
||||
out.DNSSuffix = in.DNSSuffix
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_RouterShard_To_v1_RouterShard(in *api.RouterShard, out *RouterShard, s conversion.Scope) error {
|
||||
return autoConvert_api_RouterShard_To_v1_RouterShard(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_TLSConfig_To_api_TLSConfig(in *TLSConfig, out *api.TLSConfig, s conversion.Scope) error {
|
||||
SetDefaults_TLSConfig(in)
|
||||
out.Termination = api.TLSTerminationType(in.Termination)
|
||||
out.Certificate = in.Certificate
|
||||
out.Key = in.Key
|
||||
out.CACertificate = in.CACertificate
|
||||
out.DestinationCACertificate = in.DestinationCACertificate
|
||||
out.InsecureEdgeTerminationPolicy = api.InsecureEdgeTerminationPolicyType(in.InsecureEdgeTerminationPolicy)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_TLSConfig_To_api_TLSConfig(in *TLSConfig, out *api.TLSConfig, s conversion.Scope) error {
|
||||
return autoConvert_v1_TLSConfig_To_api_TLSConfig(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_TLSConfig_To_v1_TLSConfig(in *api.TLSConfig, out *TLSConfig, s conversion.Scope) error {
|
||||
out.Termination = TLSTerminationType(in.Termination)
|
||||
out.Certificate = in.Certificate
|
||||
out.Key = in.Key
|
||||
out.CACertificate = in.CACertificate
|
||||
out.DestinationCACertificate = in.DestinationCACertificate
|
||||
out.InsecureEdgeTerminationPolicy = InsecureEdgeTerminationPolicyType(in.InsecureEdgeTerminationPolicy)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_TLSConfig_To_v1_TLSConfig(in *api.TLSConfig, out *TLSConfig, s conversion.Scope) error {
|
||||
return autoConvert_api_TLSConfig_To_v1_TLSConfig(in, out, s)
|
||||
}
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
// +build !ignore_autogenerated_openshift
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterDeepCopies)
|
||||
}
|
||||
|
||||
// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
|
||||
// to allow building arbitrary schemes.
|
||||
func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedDeepCopyFuncs(
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Route, InType: reflect.TypeOf(&Route{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouteIngress, InType: reflect.TypeOf(&RouteIngress{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouteIngressCondition, InType: reflect.TypeOf(&RouteIngressCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouteList, InType: reflect.TypeOf(&RouteList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RoutePort, InType: reflect.TypeOf(&RoutePort{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouteSpec, InType: reflect.TypeOf(&RouteSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouteStatus, InType: reflect.TypeOf(&RouteStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouteTargetReference, InType: reflect.TypeOf(&RouteTargetReference{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RouterShard, InType: reflect.TypeOf(&RouterShard{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_TLSConfig, InType: reflect.TypeOf(&TLSConfig{})},
|
||||
)
|
||||
}
|
||||
|
||||
func DeepCopy_v1_Route(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Route)
|
||||
out := out.(*Route)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_v1_RouteSpec(&in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_v1_RouteStatus(&in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouteIngress(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouteIngress)
|
||||
out := out.(*RouteIngress)
|
||||
out.Host = in.Host
|
||||
out.RouterName = in.RouterName
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]RouteIngressCondition, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_v1_RouteIngressCondition(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
out.WildcardPolicy = in.WildcardPolicy
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouteIngressCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouteIngressCondition)
|
||||
out := out.(*RouteIngressCondition)
|
||||
out.Type = in.Type
|
||||
out.Status = in.Status
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
if in.LastTransitionTime != nil {
|
||||
in, out := &in.LastTransitionTime, &out.LastTransitionTime
|
||||
*out = new(unversioned.Time)
|
||||
**out = (*in).DeepCopy()
|
||||
} else {
|
||||
out.LastTransitionTime = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouteList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouteList)
|
||||
out := out.(*RouteList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Route, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_v1_Route(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RoutePort(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RoutePort)
|
||||
out := out.(*RoutePort)
|
||||
out.TargetPort = in.TargetPort
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouteSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouteSpec)
|
||||
out := out.(*RouteSpec)
|
||||
out.Host = in.Host
|
||||
out.Path = in.Path
|
||||
if err := DeepCopy_v1_RouteTargetReference(&in.To, &out.To, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.AlternateBackends != nil {
|
||||
in, out := &in.AlternateBackends, &out.AlternateBackends
|
||||
*out = make([]RouteTargetReference, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_v1_RouteTargetReference(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.AlternateBackends = nil
|
||||
}
|
||||
if in.Port != nil {
|
||||
in, out := &in.Port, &out.Port
|
||||
*out = new(RoutePort)
|
||||
**out = **in
|
||||
} else {
|
||||
out.Port = nil
|
||||
}
|
||||
if in.TLS != nil {
|
||||
in, out := &in.TLS, &out.TLS
|
||||
*out = new(TLSConfig)
|
||||
**out = **in
|
||||
} else {
|
||||
out.TLS = nil
|
||||
}
|
||||
out.WildcardPolicy = in.WildcardPolicy
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouteStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouteStatus)
|
||||
out := out.(*RouteStatus)
|
||||
if in.Ingress != nil {
|
||||
in, out := &in.Ingress, &out.Ingress
|
||||
*out = make([]RouteIngress, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_v1_RouteIngress(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Ingress = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouteTargetReference(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouteTargetReference)
|
||||
out := out.(*RouteTargetReference)
|
||||
out.Kind = in.Kind
|
||||
out.Name = in.Name
|
||||
if in.Weight != nil {
|
||||
in, out := &in.Weight, &out.Weight
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
} else {
|
||||
out.Weight = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_RouterShard(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RouterShard)
|
||||
out := out.(*RouterShard)
|
||||
out.ShardName = in.ShardName
|
||||
out.DNSSuffix = in.DNSSuffix
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1_TLSConfig(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*TLSConfig)
|
||||
out := out.(*TLSConfig)
|
||||
out.Termination = in.Termination
|
||||
out.Certificate = in.Certificate
|
||||
out.Key = in.Key
|
||||
out.CACertificate = in.CACertificate
|
||||
out.DestinationCACertificate = in.DestinationCACertificate
|
||||
out.InsecureEdgeTerminationPolicy = in.InsecureEdgeTerminationPolicy
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user