forked from LaconicNetwork/kompose
switch from godep to glide
This commit is contained in:
+16
-5
@@ -1,6 +1,8 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
)
|
||||
|
||||
@@ -20,11 +22,20 @@ func RouteLessThan(route1, route2 *Route) bool {
|
||||
if route1.CreationTimestamp.Before(route2.CreationTimestamp) {
|
||||
return true
|
||||
}
|
||||
if route1.CreationTimestamp == route2.CreationTimestamp && route1.UID < route2.UID {
|
||||
return true
|
||||
|
||||
if route2.CreationTimestamp.Before(route1.CreationTimestamp) {
|
||||
return false
|
||||
}
|
||||
if route1.Namespace < route2.Namespace {
|
||||
return true
|
||||
|
||||
return route1.UID < route2.UID
|
||||
}
|
||||
|
||||
// GetDomainForHost returns the domain for the specified host.
|
||||
// Note for top level domains, this will return an empty string.
|
||||
func GetDomainForHost(host string) string {
|
||||
if idx := strings.IndexRune(host, '.'); idx > -1 {
|
||||
return host[idx+1:]
|
||||
}
|
||||
return route1.Name < route2.Name
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
+20
@@ -42,6 +42,10 @@ type RouteSpec struct {
|
||||
|
||||
//TLS provides the ability to configure certificates and termination for the route
|
||||
TLS *TLSConfig
|
||||
|
||||
// Wildcard policy if any for the route.
|
||||
// Currently only 'Subdomain' or 'None' is allowed.
|
||||
WildcardPolicy WildcardPolicyType
|
||||
}
|
||||
|
||||
// RouteTargetReference specifies the target that resolve into endpoints. Only the 'Service'
|
||||
@@ -77,6 +81,8 @@ type RouteIngress struct {
|
||||
RouterName string
|
||||
// Conditions is the state of the route, may be empty.
|
||||
Conditions []RouteIngressCondition
|
||||
// Wildcard policy is the wildcard policy that was allowed where this route is exposed.
|
||||
WildcardPolicy WildcardPolicyType
|
||||
}
|
||||
|
||||
// RouteIngressConditionType is a valid value for RouteCondition
|
||||
@@ -180,3 +186,17 @@ const (
|
||||
// insecure HTTP connections will be redirected to use HTTPS.
|
||||
InsecureEdgeTerminationPolicyRedirect InsecureEdgeTerminationPolicyType = "Redirect"
|
||||
)
|
||||
|
||||
// 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: With 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"
|
||||
)
|
||||
|
||||
+2
@@ -68,6 +68,7 @@ func DeepCopy_api_RouteIngress(in interface{}, out interface{}, c *conversion.Cl
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
out.WildcardPolicy = in.WildcardPolicy
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -155,6 +156,7 @@ func DeepCopy_api_RouteSpec(in interface{}, out interface{}, c *conversion.Clone
|
||||
} else {
|
||||
out.TLS = nil
|
||||
}
|
||||
out.WildcardPolicy = in.WildcardPolicy
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user