Update ingress godeps
This commit is contained in:
parent
d43021b3f1
commit
28db8fb16d
1068 changed files with 461467 additions and 117300 deletions
25
vendor/k8s.io/kubernetes/pkg/api/context.go
generated
vendored
25
vendor/k8s.io/kubernetes/pkg/api/context.go
generated
vendored
|
|
@ -22,6 +22,7 @@ import (
|
|||
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/auth/user"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
)
|
||||
|
||||
// Context carries values across API boundaries.
|
||||
|
|
@ -49,11 +50,16 @@ type Context interface {
|
|||
// The key type is unexported to prevent collisions
|
||||
type key int
|
||||
|
||||
// namespaceKey is the context key for the request namespace.
|
||||
const namespaceKey key = 0
|
||||
const (
|
||||
// namespaceKey is the context key for the request namespace.
|
||||
namespaceKey key = iota
|
||||
|
||||
// userKey is the context key for the request user.
|
||||
const userKey key = 1
|
||||
// userKey is the context key for the request user.
|
||||
userKey
|
||||
|
||||
// uidKey is the context key for the uid to assign to an object on create.
|
||||
uidKey
|
||||
)
|
||||
|
||||
// NewContext instantiates a base context object for request flows.
|
||||
func NewContext() Context {
|
||||
|
|
@ -119,3 +125,14 @@ func UserFrom(ctx Context) (user.Info, bool) {
|
|||
user, ok := ctx.Value(userKey).(user.Info)
|
||||
return user, ok
|
||||
}
|
||||
|
||||
// WithUID returns a copy of parent in which the uid value is set
|
||||
func WithUID(parent Context, uid types.UID) Context {
|
||||
return WithValue(parent, uidKey, uid)
|
||||
}
|
||||
|
||||
// UIDFrom returns the value of the uid key on the ctx
|
||||
func UIDFrom(ctx Context) (types.UID, bool) {
|
||||
uid, ok := ctx.Value(uidKey).(types.UID)
|
||||
return uid, ok
|
||||
}
|
||||
|
|
|
|||
115
vendor/k8s.io/kubernetes/pkg/api/conversion.go
generated
vendored
115
vendor/k8s.io/kubernetes/pkg/api/conversion.go
generated
vendored
|
|
@ -17,43 +17,104 @@ limitations under the License.
|
|||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
utillabels "k8s.io/kubernetes/pkg/util/labels"
|
||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Scheme.AddDefaultingFuncs(
|
||||
func(obj *ListOptions) {
|
||||
if obj.LabelSelector == nil {
|
||||
obj.LabelSelector = labels.Everything()
|
||||
}
|
||||
if obj.FieldSelector == nil {
|
||||
obj.FieldSelector = fields.Everything()
|
||||
}
|
||||
},
|
||||
)
|
||||
Scheme.AddConversionFuncs(
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddConversionFuncs(
|
||||
Convert_unversioned_TypeMeta_To_unversioned_TypeMeta,
|
||||
|
||||
Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
||||
|
||||
Convert_intstr_IntOrString_To_intstr_IntOrString,
|
||||
|
||||
Convert_unversioned_Time_To_unversioned_Time,
|
||||
|
||||
Convert_Slice_string_To_unversioned_Time,
|
||||
|
||||
Convert_resource_Quantity_To_resource_Quantity,
|
||||
|
||||
Convert_string_To_labels_Selector,
|
||||
Convert_labels_Selector_To_string,
|
||||
|
||||
Convert_string_To_fields_Selector,
|
||||
Convert_fields_Selector_To_string,
|
||||
|
||||
Convert_Pointer_bool_To_bool,
|
||||
Convert_bool_To_Pointer_bool,
|
||||
|
||||
Convert_Pointer_string_To_string,
|
||||
Convert_string_To_Pointer_string,
|
||||
Convert_labels_Selector_To_string,
|
||||
Convert_fields_Selector_To_string,
|
||||
Convert_resource_Quantity_To_resource_Quantity,
|
||||
|
||||
Convert_Pointer_int64_To_int,
|
||||
Convert_int_To_Pointer_int64,
|
||||
|
||||
Convert_Pointer_int32_To_int32,
|
||||
Convert_int32_To_Pointer_int32,
|
||||
|
||||
Convert_Pointer_float64_To_float64,
|
||||
Convert_float64_To_Pointer_float64,
|
||||
|
||||
Convert_map_to_unversioned_LabelSelector,
|
||||
Convert_unversioned_LabelSelector_to_map,
|
||||
)
|
||||
}
|
||||
|
||||
func Convert_Pointer_float64_To_float64(in **float64, out *float64, s conversion.Scope) error {
|
||||
if *in == nil {
|
||||
*out = 0
|
||||
return nil
|
||||
}
|
||||
*out = float64(**in)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_float64_To_Pointer_float64(in *float64, out **float64, s conversion.Scope) error {
|
||||
temp := float64(*in)
|
||||
*out = &temp
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_Pointer_int32_To_int32(in **int32, out *int32, s conversion.Scope) error {
|
||||
if *in == nil {
|
||||
*out = 0
|
||||
return nil
|
||||
}
|
||||
*out = int32(**in)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_int32_To_Pointer_int32(in *int32, out **int32, s conversion.Scope) error {
|
||||
temp := int32(*in)
|
||||
*out = &temp
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_Pointer_int64_To_int(in **int64, out *int, s conversion.Scope) error {
|
||||
if *in == nil {
|
||||
*out = 0
|
||||
return nil
|
||||
}
|
||||
*out = int(**in)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_int_To_Pointer_int64(in *int, out **int64, s conversion.Scope) error {
|
||||
temp := int64(*in)
|
||||
*out = &temp
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_Pointer_string_To_string(in **string, out *string, s conversion.Scope) error {
|
||||
if *in == nil {
|
||||
*out = ""
|
||||
|
|
@ -132,6 +193,7 @@ func Convert_string_To_labels_Selector(in *string, out *labels.Selector, s conve
|
|||
*out = selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_string_To_fields_Selector(in *string, out *fields.Selector, s conversion.Scope) error {
|
||||
selector, err := fields.ParseSelector(*in)
|
||||
if err != nil {
|
||||
|
|
@ -140,6 +202,7 @@ func Convert_string_To_fields_Selector(in *string, out *fields.Selector, s conve
|
|||
*out = selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_labels_Selector_To_string(in *labels.Selector, out *string, s conversion.Scope) error {
|
||||
if *in == nil {
|
||||
return nil
|
||||
|
|
@ -147,6 +210,7 @@ func Convert_labels_Selector_To_string(in *labels.Selector, out *string, s conve
|
|||
*out = (*in).String()
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_fields_Selector_To_string(in *fields.Selector, out *string, s conversion.Scope) error {
|
||||
if *in == nil {
|
||||
return nil
|
||||
|
|
@ -154,7 +218,28 @@ func Convert_fields_Selector_To_string(in *fields.Selector, out *string, s conve
|
|||
*out = (*in).String()
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_resource_Quantity_To_resource_Quantity(in *resource.Quantity, out *resource.Quantity, s conversion.Scope) error {
|
||||
*out = *in
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_map_to_unversioned_LabelSelector(in *map[string]string, out *unversioned.LabelSelector, s conversion.Scope) error {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out = new(unversioned.LabelSelector)
|
||||
for labelKey, labelValue := range *in {
|
||||
utillabels.AddLabelToSelector(out, labelKey, labelValue)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_unversioned_LabelSelector_to_map(in *unversioned.LabelSelector, out *map[string]string, s conversion.Scope) error {
|
||||
var err error
|
||||
*out, err = unversioned.LabelSelectorAsMap(in)
|
||||
if err != nil {
|
||||
err = field.Invalid(field.NewPath("labelSelector"), *in, fmt.Sprintf("cannot convert to old selector: %v", err))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
2950
vendor/k8s.io/kubernetes/pkg/api/deep_copy_generated.go
generated
vendored
2950
vendor/k8s.io/kubernetes/pkg/api/deep_copy_generated.go
generated
vendored
File diff suppressed because it is too large
Load diff
36
vendor/k8s.io/kubernetes/pkg/api/defaults.go
generated
vendored
Normal file
36
vendor/k8s.io/kubernetes/pkg/api/defaults.go
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddDefaultingFuncs(
|
||||
func(obj *ListOptions) {
|
||||
if obj.LabelSelector == nil {
|
||||
obj.LabelSelector = labels.Everything()
|
||||
}
|
||||
if obj.FieldSelector == nil {
|
||||
obj.FieldSelector = fields.Everything()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
4
vendor/k8s.io/kubernetes/pkg/api/errors/errors.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/api/errors/errors.go
generated
vendored
|
|
@ -329,9 +329,9 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource unversion
|
|||
}
|
||||
}
|
||||
switch {
|
||||
case !qualifiedResource.IsEmpty() && len(name) > 0:
|
||||
case !qualifiedResource.Empty() && len(name) > 0:
|
||||
message = fmt.Sprintf("%s (%s %s %s)", message, strings.ToLower(verb), qualifiedResource.String(), name)
|
||||
case !qualifiedResource.IsEmpty():
|
||||
case !qualifiedResource.Empty():
|
||||
message = fmt.Sprintf("%s (%s %s)", message, strings.ToLower(verb), qualifiedResource.String())
|
||||
}
|
||||
var causes []unversioned.StatusCause
|
||||
|
|
|
|||
106
vendor/k8s.io/kubernetes/pkg/api/helpers.go
generated
vendored
106
vendor/k8s.io/kubernetes/pkg/api/helpers.go
generated
vendored
|
|
@ -30,6 +30,7 @@ import (
|
|||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/selection"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
|
||||
|
|
@ -134,6 +135,7 @@ var standardQuotaResources = sets.NewString(
|
|||
string(ResourceMemory),
|
||||
string(ResourceRequestsCPU),
|
||||
string(ResourceRequestsMemory),
|
||||
string(ResourceRequestsStorage),
|
||||
string(ResourceLimitsCPU),
|
||||
string(ResourceLimitsMemory),
|
||||
string(ResourcePods),
|
||||
|
|
@ -221,6 +223,10 @@ func IsServiceIPSet(service *Service) bool {
|
|||
|
||||
// this function aims to check if the service's cluster IP is requested or not
|
||||
func IsServiceIPRequested(service *Service) bool {
|
||||
// ExternalName services are CNAME aliases to external ones. Ignore the IP.
|
||||
if service.Spec.Type == ServiceTypeExternalName {
|
||||
return false
|
||||
}
|
||||
return service.Spec.ClusterIP == ""
|
||||
}
|
||||
|
||||
|
|
@ -378,20 +384,20 @@ func NodeSelectorRequirementsAsSelector(nsm []NodeSelectorRequirement) (labels.S
|
|||
}
|
||||
selector := labels.NewSelector()
|
||||
for _, expr := range nsm {
|
||||
var op labels.Operator
|
||||
var op selection.Operator
|
||||
switch expr.Operator {
|
||||
case NodeSelectorOpIn:
|
||||
op = labels.InOperator
|
||||
op = selection.In
|
||||
case NodeSelectorOpNotIn:
|
||||
op = labels.NotInOperator
|
||||
op = selection.NotIn
|
||||
case NodeSelectorOpExists:
|
||||
op = labels.ExistsOperator
|
||||
op = selection.Exists
|
||||
case NodeSelectorOpDoesNotExist:
|
||||
op = labels.DoesNotExistOperator
|
||||
op = selection.DoesNotExist
|
||||
case NodeSelectorOpGt:
|
||||
op = labels.GreaterThanOperator
|
||||
op = selection.GreaterThan
|
||||
case NodeSelectorOpLt:
|
||||
op = labels.LessThanOperator
|
||||
op = selection.LessThan
|
||||
default:
|
||||
return nil, fmt.Errorf("%q is not a valid node selector operator", expr.Operator)
|
||||
}
|
||||
|
|
@ -428,19 +434,38 @@ const (
|
|||
// CreatedByAnnotation represents the key used to store the spec(json)
|
||||
// used to create the resource.
|
||||
CreatedByAnnotation = "kubernetes.io/created-by"
|
||||
|
||||
// PreferAvoidPodsAnnotationKey represents the key of preferAvoidPods data (json serialized)
|
||||
// in the Annotations of a Node.
|
||||
PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods"
|
||||
|
||||
// SysctlsPodAnnotationKey represents the key of sysctls which are set for the infrastructure
|
||||
// container of a pod. The annotation value is a comma separated list of sysctl_name=value
|
||||
// key-value pairs. Only a limited set of whitelisted and isolated sysctls is supported by
|
||||
// the kubelet. Pods with other sysctls will fail to launch.
|
||||
SysctlsPodAnnotationKey string = "security.alpha.kubernetes.io/sysctls"
|
||||
|
||||
// UnsafeSysctlsPodAnnotationKey represents the key of sysctls which are set for the infrastructure
|
||||
// container of a pod. The annotation value is a comma separated list of sysctl_name=value
|
||||
// key-value pairs. Unsafe sysctls must be explicitly enabled for a kubelet. They are properly
|
||||
// namespaced to a pod or a container, but their isolation is usually unclear or weak. Their use
|
||||
// is at-your-own-risk. Pods that attempt to set an unsafe sysctl that is not enabled for a kubelet
|
||||
// will fail to launch.
|
||||
UnsafeSysctlsPodAnnotationKey string = "security.alpha.kubernetes.io/unsafe-sysctls"
|
||||
)
|
||||
|
||||
// GetAffinityFromPod gets the json serialized affinity data from Pod.Annotations
|
||||
// and converts it to the Affinity type in api.
|
||||
func GetAffinityFromPodAnnotations(annotations map[string]string) (Affinity, error) {
|
||||
var affinity Affinity
|
||||
func GetAffinityFromPodAnnotations(annotations map[string]string) (*Affinity, error) {
|
||||
if len(annotations) > 0 && annotations[AffinityAnnotationKey] != "" {
|
||||
var affinity Affinity
|
||||
err := json.Unmarshal([]byte(annotations[AffinityAnnotationKey]), &affinity)
|
||||
if err != nil {
|
||||
return affinity, err
|
||||
return nil, err
|
||||
}
|
||||
return &affinity, nil
|
||||
}
|
||||
return affinity, nil
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetTolerationsFromPodAnnotations gets the json serialized tolerations data from Pod.Annotations
|
||||
|
|
@ -500,3 +525,62 @@ func TaintToleratedByTolerations(taint *Taint, tolerations []Toleration) bool {
|
|||
}
|
||||
return tolerated
|
||||
}
|
||||
|
||||
func GetAvoidPodsFromNodeAnnotations(annotations map[string]string) (AvoidPods, error) {
|
||||
var avoidPods AvoidPods
|
||||
if len(annotations) > 0 && annotations[PreferAvoidPodsAnnotationKey] != "" {
|
||||
err := json.Unmarshal([]byte(annotations[PreferAvoidPodsAnnotationKey]), &avoidPods)
|
||||
if err != nil {
|
||||
return avoidPods, err
|
||||
}
|
||||
}
|
||||
return avoidPods, nil
|
||||
}
|
||||
|
||||
// SysctlsFromPodAnnotations parses the sysctl annotations into a slice of safe Sysctls
|
||||
// and a slice of unsafe Sysctls. This is only a convenience wrapper around
|
||||
// SysctlsFromPodAnnotation.
|
||||
func SysctlsFromPodAnnotations(a map[string]string) ([]Sysctl, []Sysctl, error) {
|
||||
safe, err := SysctlsFromPodAnnotation(a[SysctlsPodAnnotationKey])
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
unsafe, err := SysctlsFromPodAnnotation(a[UnsafeSysctlsPodAnnotationKey])
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return safe, unsafe, nil
|
||||
}
|
||||
|
||||
// SysctlsFromPodAnnotation parses an annotation value into a slice of Sysctls.
|
||||
func SysctlsFromPodAnnotation(annotation string) ([]Sysctl, error) {
|
||||
if len(annotation) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
kvs := strings.Split(annotation, ",")
|
||||
sysctls := make([]Sysctl, len(kvs))
|
||||
for i, kv := range kvs {
|
||||
cs := strings.Split(kv, "=")
|
||||
if len(cs) != 2 {
|
||||
return nil, fmt.Errorf("sysctl %q not of the format sysctl_name=value", kv)
|
||||
}
|
||||
sysctls[i].Name = cs[0]
|
||||
sysctls[i].Value = cs[1]
|
||||
}
|
||||
return sysctls, nil
|
||||
}
|
||||
|
||||
// PodAnnotationsFromSysctls creates an annotation value for a slice of Sysctls.
|
||||
func PodAnnotationsFromSysctls(sysctls []Sysctl) string {
|
||||
if len(sysctls) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
kvs := make([]string, len(sysctls))
|
||||
for i := range sysctls {
|
||||
kvs[i] = fmt.Sprintf("%s=%s", sysctls[i].Name, sysctls[i].Value)
|
||||
}
|
||||
return strings.Join(kvs, ",")
|
||||
}
|
||||
|
|
|
|||
108
vendor/k8s.io/kubernetes/pkg/api/install/install.go
generated
vendored
108
vendor/k8s.io/kubernetes/pkg/api/install/install.go
generated
vendored
|
|
@ -29,10 +29,8 @@ import (
|
|||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/apimachinery"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/watch/versioned"
|
||||
)
|
||||
|
||||
const importPrefix = "k8s.io/kubernetes/pkg/api"
|
||||
|
|
@ -140,7 +138,10 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e
|
|||
|
||||
func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
||||
// add the internal version to Scheme
|
||||
api.AddToScheme(api.Scheme)
|
||||
if err := api.AddToScheme(api.Scheme); err != nil {
|
||||
// Programmer error, detect immediately
|
||||
panic(err)
|
||||
}
|
||||
// add the enabled external versions to Scheme
|
||||
for _, v := range externalVersions {
|
||||
if !registered.IsEnabledVersion(v) {
|
||||
|
|
@ -149,103 +150,10 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
|||
}
|
||||
switch v {
|
||||
case v1.SchemeGroupVersion:
|
||||
v1.AddToScheme(api.Scheme)
|
||||
if err := v1.AddToScheme(api.Scheme); err != nil {
|
||||
// Programmer error, detect immediately
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is a "fast-path" that avoids reflection for common types. It focuses on the objects that are
|
||||
// converted the most in the cluster.
|
||||
// TODO: generate one of these for every external API group - this is to prove the impact
|
||||
api.Scheme.AddGenericConversionFunc(func(objA, objB interface{}, s conversion.Scope) (bool, error) {
|
||||
switch a := objA.(type) {
|
||||
case *v1.Pod:
|
||||
switch b := objB.(type) {
|
||||
case *api.Pod:
|
||||
return true, v1.Convert_v1_Pod_To_api_Pod(a, b, s)
|
||||
}
|
||||
case *api.Pod:
|
||||
switch b := objB.(type) {
|
||||
case *v1.Pod:
|
||||
return true, v1.Convert_api_Pod_To_v1_Pod(a, b, s)
|
||||
}
|
||||
|
||||
case *v1.Event:
|
||||
switch b := objB.(type) {
|
||||
case *api.Event:
|
||||
return true, v1.Convert_v1_Event_To_api_Event(a, b, s)
|
||||
}
|
||||
case *api.Event:
|
||||
switch b := objB.(type) {
|
||||
case *v1.Event:
|
||||
return true, v1.Convert_api_Event_To_v1_Event(a, b, s)
|
||||
}
|
||||
|
||||
case *v1.ReplicationController:
|
||||
switch b := objB.(type) {
|
||||
case *api.ReplicationController:
|
||||
return true, v1.Convert_v1_ReplicationController_To_api_ReplicationController(a, b, s)
|
||||
}
|
||||
case *api.ReplicationController:
|
||||
switch b := objB.(type) {
|
||||
case *v1.ReplicationController:
|
||||
return true, v1.Convert_api_ReplicationController_To_v1_ReplicationController(a, b, s)
|
||||
}
|
||||
|
||||
case *v1.Node:
|
||||
switch b := objB.(type) {
|
||||
case *api.Node:
|
||||
return true, v1.Convert_v1_Node_To_api_Node(a, b, s)
|
||||
}
|
||||
case *api.Node:
|
||||
switch b := objB.(type) {
|
||||
case *v1.Node:
|
||||
return true, v1.Convert_api_Node_To_v1_Node(a, b, s)
|
||||
}
|
||||
|
||||
case *v1.Namespace:
|
||||
switch b := objB.(type) {
|
||||
case *api.Namespace:
|
||||
return true, v1.Convert_v1_Namespace_To_api_Namespace(a, b, s)
|
||||
}
|
||||
case *api.Namespace:
|
||||
switch b := objB.(type) {
|
||||
case *v1.Namespace:
|
||||
return true, v1.Convert_api_Namespace_To_v1_Namespace(a, b, s)
|
||||
}
|
||||
|
||||
case *v1.Service:
|
||||
switch b := objB.(type) {
|
||||
case *api.Service:
|
||||
return true, v1.Convert_v1_Service_To_api_Service(a, b, s)
|
||||
}
|
||||
case *api.Service:
|
||||
switch b := objB.(type) {
|
||||
case *v1.Service:
|
||||
return true, v1.Convert_api_Service_To_v1_Service(a, b, s)
|
||||
}
|
||||
|
||||
case *v1.Endpoints:
|
||||
switch b := objB.(type) {
|
||||
case *api.Endpoints:
|
||||
return true, v1.Convert_v1_Endpoints_To_api_Endpoints(a, b, s)
|
||||
}
|
||||
case *api.Endpoints:
|
||||
switch b := objB.(type) {
|
||||
case *v1.Endpoints:
|
||||
return true, v1.Convert_api_Endpoints_To_v1_Endpoints(a, b, s)
|
||||
}
|
||||
|
||||
case *versioned.Event:
|
||||
switch b := objB.(type) {
|
||||
case *versioned.InternalEvent:
|
||||
return true, versioned.Convert_versioned_Event_to_versioned_InternalEvent(a, b, s)
|
||||
}
|
||||
case *versioned.InternalEvent:
|
||||
switch b := objB.(type) {
|
||||
case *versioned.Event:
|
||||
return true, versioned.Convert_versioned_InternalEvent_to_versioned_Event(a, b, s)
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
}
|
||||
|
|
|
|||
10
vendor/k8s.io/kubernetes/pkg/api/mapper.go
generated
vendored
10
vendor/k8s.io/kubernetes/pkg/api/mapper.go
generated
vendored
|
|
@ -21,6 +21,7 @@ import (
|
|||
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
|
||||
|
|
@ -34,14 +35,21 @@ func RegisterRESTMapper(m meta.RESTMapper) {
|
|||
RESTMapper = append(RESTMapper.(meta.MultiRESTMapper), m)
|
||||
}
|
||||
|
||||
// Instantiates a DefaultRESTMapper based on types registered in api.Scheme
|
||||
func NewDefaultRESTMapper(defaultGroupVersions []unversioned.GroupVersion, interfacesFunc meta.VersionInterfacesFunc,
|
||||
importPathPrefix string, ignoredKinds, rootScoped sets.String) *meta.DefaultRESTMapper {
|
||||
return NewDefaultRESTMapperFromScheme(defaultGroupVersions, interfacesFunc, importPathPrefix, ignoredKinds, rootScoped, Scheme)
|
||||
}
|
||||
|
||||
// Instantiates a DefaultRESTMapper based on types registered in the given scheme.
|
||||
func NewDefaultRESTMapperFromScheme(defaultGroupVersions []unversioned.GroupVersion, interfacesFunc meta.VersionInterfacesFunc,
|
||||
importPathPrefix string, ignoredKinds, rootScoped sets.String, scheme *runtime.Scheme) *meta.DefaultRESTMapper {
|
||||
|
||||
mapper := meta.NewDefaultRESTMapper(defaultGroupVersions, interfacesFunc)
|
||||
// enumerate all supported versions, get the kinds, and register with the mapper how to address
|
||||
// our resources.
|
||||
for _, gv := range defaultGroupVersions {
|
||||
for kind, oType := range Scheme.KnownTypes(gv) {
|
||||
for kind, oType := range scheme.KnownTypes(gv) {
|
||||
gvk := gv.WithKind(kind)
|
||||
// TODO: Remove import path check.
|
||||
// We check the import path because we currently stuff both "api" and "extensions" objects
|
||||
|
|
|
|||
19
vendor/k8s.io/kubernetes/pkg/api/meta.go
generated
vendored
19
vendor/k8s.io/kubernetes/pkg/api/meta.go
generated
vendored
|
|
@ -23,13 +23,19 @@ import (
|
|||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/uuid"
|
||||
)
|
||||
|
||||
// FillObjectMetaSystemFields populates fields that are managed by the system on ObjectMeta.
|
||||
func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta) {
|
||||
meta.CreationTimestamp = unversioned.Now()
|
||||
meta.UID = util.NewUUID()
|
||||
// allows admission controllers to assign a UID earlier in the request processing
|
||||
// to support tracking resources pending creation.
|
||||
uid, found := UIDFrom(ctx)
|
||||
if !found {
|
||||
uid = uuid.NewUUID()
|
||||
}
|
||||
meta.UID = uid
|
||||
meta.SelfLink = ""
|
||||
}
|
||||
|
||||
|
|
@ -67,8 +73,6 @@ func ListMetaFor(obj runtime.Object) (*unversioned.ListMeta, error) {
|
|||
|
||||
func (obj *ObjectMeta) GetObjectMeta() meta.Object { return obj }
|
||||
|
||||
func (obj *ObjectReference) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||
|
||||
// Namespace implements meta.Object for any object with an ObjectMeta typed field. Allows
|
||||
// fast, direct access to metadata fields for API objects.
|
||||
func (meta *ObjectMeta) GetNamespace() string { return meta.Namespace }
|
||||
|
|
@ -127,3 +131,10 @@ func (meta *ObjectMeta) SetOwnerReferences(references []metatypes.OwnerReference
|
|||
}
|
||||
meta.OwnerReferences = newReferences
|
||||
}
|
||||
|
||||
func (meta *ObjectMeta) GetClusterName() string {
|
||||
return meta.ClusterName
|
||||
}
|
||||
func (meta *ObjectMeta) SetClusterName(clusterName string) {
|
||||
meta.ClusterName = clusterName
|
||||
}
|
||||
|
|
|
|||
53
vendor/k8s.io/kubernetes/pkg/api/meta/errors.go
generated
vendored
53
vendor/k8s.io/kubernetes/pkg/api/meta/errors.go
generated
vendored
|
|
@ -38,19 +38,40 @@ func (e *AmbiguousResourceError) Error() string {
|
|||
return fmt.Sprintf("%v matches multiple kinds %v", e.PartialResource, e.MatchingKinds)
|
||||
case len(e.MatchingResources) > 0:
|
||||
return fmt.Sprintf("%v matches multiple resources %v", e.PartialResource, e.MatchingResources)
|
||||
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialResource)
|
||||
}
|
||||
|
||||
func IsAmbiguousResourceError(err error) bool {
|
||||
// AmbiguousKindError is returned if the RESTMapper finds multiple matches for a kind
|
||||
type AmbiguousKindError struct {
|
||||
PartialKind unversioned.GroupVersionKind
|
||||
|
||||
MatchingResources []unversioned.GroupVersionResource
|
||||
MatchingKinds []unversioned.GroupVersionKind
|
||||
}
|
||||
|
||||
func (e *AmbiguousKindError) Error() string {
|
||||
switch {
|
||||
case len(e.MatchingKinds) > 0 && len(e.MatchingResources) > 0:
|
||||
return fmt.Sprintf("%v matches multiple resources %v and kinds %v", e.PartialKind, e.MatchingResources, e.MatchingKinds)
|
||||
case len(e.MatchingKinds) > 0:
|
||||
return fmt.Sprintf("%v matches multiple kinds %v", e.PartialKind, e.MatchingKinds)
|
||||
case len(e.MatchingResources) > 0:
|
||||
return fmt.Sprintf("%v matches multiple resources %v", e.PartialKind, e.MatchingResources)
|
||||
}
|
||||
return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialKind)
|
||||
}
|
||||
|
||||
func IsAmbiguousError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
_, ok := err.(*AmbiguousResourceError)
|
||||
return ok
|
||||
switch err.(type) {
|
||||
case *AmbiguousResourceError, *AmbiguousKindError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// NoResourceMatchError is returned if the RESTMapper can't find any match for a resource
|
||||
|
|
@ -62,11 +83,23 @@ func (e *NoResourceMatchError) Error() string {
|
|||
return fmt.Sprintf("no matches for %v", e.PartialResource)
|
||||
}
|
||||
|
||||
func IsNoResourceMatchError(err error) bool {
|
||||
// NoKindMatchError is returned if the RESTMapper can't find any match for a kind
|
||||
type NoKindMatchError struct {
|
||||
PartialKind unversioned.GroupVersionKind
|
||||
}
|
||||
|
||||
func (e *NoKindMatchError) Error() string {
|
||||
return fmt.Sprintf("no matches for %v", e.PartialKind)
|
||||
}
|
||||
|
||||
func IsNoMatchError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
_, ok := err.(*NoResourceMatchError)
|
||||
return ok
|
||||
switch err.(type) {
|
||||
case *NoResourceMatchError, *NoKindMatchError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
5
vendor/k8s.io/kubernetes/pkg/api/meta/interfaces.go
generated
vendored
5
vendor/k8s.io/kubernetes/pkg/api/meta/interfaces.go
generated
vendored
|
|
@ -62,6 +62,8 @@ type Object interface {
|
|||
SetFinalizers(finalizers []string)
|
||||
GetOwnerReferences() []metatypes.OwnerReference
|
||||
SetOwnerReferences([]metatypes.OwnerReference)
|
||||
GetClusterName() string
|
||||
SetClusterName(clusterName string)
|
||||
}
|
||||
|
||||
var _ Object = &runtime.Unstructured{}
|
||||
|
|
@ -173,7 +175,10 @@ type RESTMapper interface {
|
|||
// ResourcesFor takes a partial resource and returns back the list of potential resource in priority order
|
||||
ResourcesFor(input unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error)
|
||||
|
||||
// RESTMapping identifies a preferred resource mapping for the provided group kind.
|
||||
RESTMapping(gk unversioned.GroupKind, versions ...string) (*RESTMapping, error)
|
||||
// RESTMappings returns all resource mappings for the provided group kind.
|
||||
RESTMappings(gk unversioned.GroupKind) ([]*RESTMapping, error)
|
||||
|
||||
AliasesForResource(resource string) ([]string, bool)
|
||||
ResourceSingularizer(resource string) (singular string, err error)
|
||||
|
|
|
|||
41
vendor/k8s.io/kubernetes/pkg/api/meta/multirestmapper.go
generated
vendored
41
vendor/k8s.io/kubernetes/pkg/api/meta/multirestmapper.go
generated
vendored
|
|
@ -56,7 +56,7 @@ func (m MultiRESTMapper) ResourcesFor(resource unversioned.GroupVersionResource)
|
|||
for _, t := range m {
|
||||
gvrs, err := t.ResourcesFor(resource)
|
||||
// ignore "no match" errors, but any other error percolates back up
|
||||
if IsNoResourceMatchError(err) {
|
||||
if IsNoMatchError(err) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
|
|
@ -91,7 +91,7 @@ func (m MultiRESTMapper) KindsFor(resource unversioned.GroupVersionResource) (gv
|
|||
for _, t := range m {
|
||||
gvks, err := t.KindsFor(resource)
|
||||
// ignore "no match" errors, but any other error percolates back up
|
||||
if IsNoResourceMatchError(err) {
|
||||
if IsNoMatchError(err) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
|
|
@ -155,7 +155,7 @@ func (m MultiRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...strin
|
|||
for _, t := range m {
|
||||
currMapping, err := t.RESTMapping(gk, versions...)
|
||||
// ignore "no match" errors, but any other error percolates back up
|
||||
if IsNoResourceMatchError(err) {
|
||||
if IsNoMatchError(err) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
|
|
@ -171,12 +171,43 @@ func (m MultiRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...strin
|
|||
return allMappings[0], nil
|
||||
}
|
||||
if len(allMappings) > 1 {
|
||||
return nil, fmt.Errorf("multiple matches found for %v in %v", gk, versions)
|
||||
var kinds []unversioned.GroupVersionKind
|
||||
for _, m := range allMappings {
|
||||
kinds = append(kinds, m.GroupVersionKind)
|
||||
}
|
||||
return nil, &AmbiguousKindError{PartialKind: gk.WithVersion(""), MatchingKinds: kinds}
|
||||
}
|
||||
if len(errors) > 0 {
|
||||
return nil, utilerrors.NewAggregate(errors)
|
||||
}
|
||||
return nil, fmt.Errorf("no match found for %v in %v", gk, versions)
|
||||
return nil, &NoKindMatchError{PartialKind: gk.WithVersion("")}
|
||||
}
|
||||
|
||||
// RESTMappings returns all possible RESTMappings for the provided group kind, or an error
|
||||
// if the type is not recognized.
|
||||
func (m MultiRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*RESTMapping, error) {
|
||||
var allMappings []*RESTMapping
|
||||
var errors []error
|
||||
|
||||
for _, t := range m {
|
||||
currMappings, err := t.RESTMappings(gk)
|
||||
// ignore "no match" errors, but any other error percolates back up
|
||||
if IsNoMatchError(err) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
errors = append(errors, err)
|
||||
continue
|
||||
}
|
||||
allMappings = append(allMappings, currMappings...)
|
||||
}
|
||||
if len(errors) > 0 {
|
||||
return nil, utilerrors.NewAggregate(errors)
|
||||
}
|
||||
if len(allMappings) == 0 {
|
||||
return nil, &NoKindMatchError{PartialKind: gk.WithVersion("")}
|
||||
}
|
||||
return allMappings, nil
|
||||
}
|
||||
|
||||
// AliasesForResource finds the first alias response for the provided mappers.
|
||||
|
|
|
|||
55
vendor/k8s.io/kubernetes/pkg/api/meta/priority.go
generated
vendored
55
vendor/k8s.io/kubernetes/pkg/api/meta/priority.go
generated
vendored
|
|
@ -153,7 +153,60 @@ func kindMatches(pattern unversioned.GroupVersionKind, kind unversioned.GroupVer
|
|||
}
|
||||
|
||||
func (m PriorityRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (mapping *RESTMapping, err error) {
|
||||
return m.Delegate.RESTMapping(gk, versions...)
|
||||
mappings, err := m.Delegate.RESTMappings(gk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// any versions the user provides take priority
|
||||
priorities := m.KindPriority
|
||||
if len(versions) > 0 {
|
||||
priorities = make([]unversioned.GroupVersionKind, 0, len(m.KindPriority)+len(versions))
|
||||
for _, version := range versions {
|
||||
gv, err := unversioned.ParseGroupVersion(version)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
priorities = append(priorities, gv.WithKind(AnyKind))
|
||||
}
|
||||
priorities = append(priorities, m.KindPriority...)
|
||||
}
|
||||
|
||||
remaining := append([]*RESTMapping{}, mappings...)
|
||||
for _, pattern := range priorities {
|
||||
var matching []*RESTMapping
|
||||
for _, m := range remaining {
|
||||
if kindMatches(pattern, m.GroupVersionKind) {
|
||||
matching = append(matching, m)
|
||||
}
|
||||
}
|
||||
|
||||
switch len(matching) {
|
||||
case 0:
|
||||
// if you have no matches, then nothing matched this pattern just move to the next
|
||||
continue
|
||||
case 1:
|
||||
// one match, return
|
||||
return matching[0], nil
|
||||
default:
|
||||
// more than one match, use the matched hits as the list moving to the next pattern.
|
||||
// this way you can have a series of selection criteria
|
||||
remaining = matching
|
||||
}
|
||||
}
|
||||
if len(remaining) == 1 {
|
||||
return remaining[0], nil
|
||||
}
|
||||
|
||||
var kinds []unversioned.GroupVersionKind
|
||||
for _, m := range mappings {
|
||||
kinds = append(kinds, m.GroupVersionKind)
|
||||
}
|
||||
return nil, &AmbiguousKindError{PartialKind: gk.WithVersion(""), MatchingKinds: kinds}
|
||||
}
|
||||
|
||||
func (m PriorityRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*RESTMapping, error) {
|
||||
return m.Delegate.RESTMappings(gk)
|
||||
}
|
||||
|
||||
func (m PriorityRESTMapper) AliasesForResource(alias string) (aliases []string, ok bool) {
|
||||
|
|
|
|||
50
vendor/k8s.io/kubernetes/pkg/api/meta/restmapper.go
generated
vendored
50
vendor/k8s.io/kubernetes/pkg/api/meta/restmapper.go
generated
vendored
|
|
@ -183,7 +183,7 @@ func (m *DefaultRESTMapper) ResourceSingularizer(resourceType string) (string, e
|
|||
if !ok {
|
||||
continue
|
||||
}
|
||||
if singular.IsEmpty() {
|
||||
if singular.Empty() {
|
||||
singular = currSingular
|
||||
continue
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ func (m *DefaultRESTMapper) ResourceSingularizer(resourceType string) (string, e
|
|||
}
|
||||
}
|
||||
|
||||
if singular.IsEmpty() {
|
||||
if singular.Empty() {
|
||||
return resourceType, fmt.Errorf("no singular of resource %v has been defined", resourceType)
|
||||
}
|
||||
|
||||
|
|
@ -431,6 +431,7 @@ func (o resourceByPreferredGroupVersion) Less(i, j int) bool {
|
|||
// RESTClient should use to operate on the provided group/kind in order of versions. If a version search
|
||||
// order is not provided, the search order provided to DefaultRESTMapper will be used to resolve which
|
||||
// version should be used to access the named group/kind.
|
||||
// TODO: consider refactoring to use RESTMappings in a way that preserves version ordering and preference
|
||||
func (m *DefaultRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (*RESTMapping, error) {
|
||||
// Pick an appropriate version
|
||||
var gvk *unversioned.GroupVersionKind
|
||||
|
|
@ -462,7 +463,7 @@ func (m *DefaultRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...st
|
|||
}
|
||||
}
|
||||
if gvk == nil {
|
||||
return nil, fmt.Errorf("no kind named %q is registered in versions %q", gk, versions)
|
||||
return nil, &NoKindMatchError{PartialKind: gk.WithVersion("")}
|
||||
}
|
||||
|
||||
// Ensure we have a REST mapping
|
||||
|
|
@ -503,6 +504,49 @@ func (m *DefaultRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...st
|
|||
return retVal, nil
|
||||
}
|
||||
|
||||
// RESTMappings returns the RESTMappings for the provided group kind in a rough internal preferred order. If no
|
||||
// kind is found it will return a NoResourceMatchError.
|
||||
func (m *DefaultRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*RESTMapping, error) {
|
||||
// Use the default preferred versions
|
||||
var mappings []*RESTMapping
|
||||
for _, gv := range m.defaultGroupVersions {
|
||||
if gv.Group != gk.Group {
|
||||
continue
|
||||
}
|
||||
|
||||
gvk := gk.WithVersion(gv.Version)
|
||||
gvr, ok := m.kindToPluralResource[gvk]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
// Ensure we have a REST scope
|
||||
scope, ok := m.kindToScope[gvk]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("the provided version %q and kind %q cannot be mapped to a supported scope", gvk.GroupVersion(), gvk.Kind)
|
||||
}
|
||||
|
||||
interfaces, err := m.interfacesFunc(gvk.GroupVersion())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the provided version %q has no relevant versions", gvk.GroupVersion().String())
|
||||
}
|
||||
|
||||
mappings = append(mappings, &RESTMapping{
|
||||
Resource: gvr.Resource,
|
||||
GroupVersionKind: gvk,
|
||||
Scope: scope,
|
||||
|
||||
ObjectConvertor: interfaces.ObjectConvertor,
|
||||
MetadataAccessor: interfaces.MetadataAccessor,
|
||||
})
|
||||
}
|
||||
|
||||
if len(mappings) == 0 {
|
||||
return nil, &NoResourceMatchError{PartialResource: unversioned.GroupVersionResource{Group: gk.Group, Resource: gk.Kind}}
|
||||
}
|
||||
return mappings, nil
|
||||
}
|
||||
|
||||
// AddResourceAlias maps aliases to resources
|
||||
func (m *DefaultRESTMapper) AddResourceAlias(alias string, resources ...string) {
|
||||
if len(resources) == 0 {
|
||||
|
|
|
|||
31
vendor/k8s.io/kubernetes/pkg/api/meta/unstructured.go
generated
vendored
Normal file
31
vendor/k8s.io/kubernetes/pkg/api/meta/unstructured.go
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package meta
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
// InterfacesForUnstructured returns VersionInterfaces suitable for
|
||||
// dealing with runtime.Unstructured objects.
|
||||
func InterfacesForUnstructured(unversioned.GroupVersion) (*VersionInterfaces, error) {
|
||||
return &VersionInterfaces{
|
||||
ObjectConvertor: &runtime.UnstructuredObjectConverter{},
|
||||
MetadataAccessor: NewAccessor(),
|
||||
}, nil
|
||||
}
|
||||
102
vendor/k8s.io/kubernetes/pkg/api/pod_example.json
generated
vendored
102
vendor/k8s.io/kubernetes/pkg/api/pod_example.json
generated
vendored
|
|
@ -1,102 +0,0 @@
|
|||
{
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etcd-server-e2e-test-wojtekt-master",
|
||||
"namespace": "default",
|
||||
"selfLink": "/api/v1/namespaces/default/pods/etcd-server-e2e-test-wojtekt-master",
|
||||
"uid": "a671734a-e8e5-11e4-8fde-42010af09327",
|
||||
"resourceVersion": "22",
|
||||
"creationTimestamp": "2015-04-22T11:49:36Z",
|
||||
"annotations": {
|
||||
"kubernetes.io/config.mirror": "mirror",
|
||||
"kubernetes.io/config.source": "file"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "varetcd",
|
||||
"hostPath": {
|
||||
"path": "/mnt/master-pd/var/etcd"
|
||||
},
|
||||
"emptyDir": null,
|
||||
"gcePersistentDisk": null,
|
||||
"awsElasticBlockStore": null,
|
||||
"gitRepo": null,
|
||||
"secret": null,
|
||||
"nfs": null,
|
||||
"iscsi": null,
|
||||
"glusterfs": null
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"image": "gcr.io/google_containers/etcd:2.0.9",
|
||||
"command": [
|
||||
"/usr/local/bin/etcd",
|
||||
"--addr",
|
||||
"127.0.0.1:4001",
|
||||
"--bind-addr",
|
||||
"127.0.0.1:4001",
|
||||
"--data-dir",
|
||||
"/var/etcd/data"
|
||||
],
|
||||
"ports": [
|
||||
{
|
||||
"name": "serverport",
|
||||
"hostPort": 2380,
|
||||
"containerPort": 2380,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
{
|
||||
"name": "clientport",
|
||||
"hostPort": 4001,
|
||||
"containerPort": 4001,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "varetcd",
|
||||
"mountPath": "/var/etcd"
|
||||
}
|
||||
],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"imagePullPolicy": "IfNotPresent",
|
||||
"capabilities": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"nodeName": "e2e-test-wojtekt-master",
|
||||
"hostNetwork": true
|
||||
},
|
||||
"status": {
|
||||
"phase": "Running",
|
||||
"conditions": [
|
||||
{
|
||||
"type": "Ready",
|
||||
"status": "True"
|
||||
}
|
||||
],
|
||||
"containerStatuses": [
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"state": {
|
||||
"running": {
|
||||
"startedAt": "2015-04-22T11:49:32Z"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": true,
|
||||
"restartCount": 0,
|
||||
"image": "gcr.io/google_containers/etcd:2.0.9",
|
||||
"imageID": "docker://b6b9a86dc06aa1361357ca1b105feba961f6a4145adca6c54e142c0be0fe87b0",
|
||||
"containerID": "docker://3cbbf818f1addfc252957b4504f56ef2907a313fe6afc47fc75373674255d46d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
2
vendor/k8s.io/kubernetes/pkg/api/ref.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/api/ref.go
generated
vendored
|
|
@ -128,3 +128,5 @@ func (obj *ObjectReference) SetGroupVersionKind(gvk unversioned.GroupVersionKind
|
|||
func (obj *ObjectReference) GroupVersionKind() unversioned.GroupVersionKind {
|
||||
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
|
||||
}
|
||||
|
||||
func (obj *ObjectReference) GetObjectKind() unversioned.ObjectKind { return obj }
|
||||
|
|
|
|||
32
vendor/k8s.io/kubernetes/pkg/api/register.go
generated
vendored
32
vendor/k8s.io/kubernetes/pkg/api/register.go
generated
vendored
|
|
@ -23,6 +23,10 @@ import (
|
|||
)
|
||||
|
||||
// Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered.
|
||||
// NOTE: If you are copying this file to start a new api group, STOP! Copy the
|
||||
// extensions group instead. This Scheme is special and should appear ONLY in
|
||||
// the api group, unless you really know what you're doing.
|
||||
// TODO(lavalamp): make the above error impossible.
|
||||
var Scheme = runtime.NewScheme()
|
||||
|
||||
// Codecs provides access to encoding and decoding for the scheme
|
||||
|
|
@ -34,7 +38,7 @@ const GroupName = ""
|
|||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Unversiond is group version for unversioned API objects
|
||||
// Unversioned is group version for unversioned API objects
|
||||
// TODO: this should be v1 probably
|
||||
var Unversioned = unversioned.GroupVersion{Group: "", Version: "v1"}
|
||||
|
||||
|
|
@ -51,10 +55,29 @@ func Resource(resource string) unversioned.GroupResource {
|
|||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
func AddToScheme(scheme *runtime.Scheme) {
|
||||
if err := Scheme.AddIgnoredConversionType(&unversioned.TypeMeta{}, &unversioned.TypeMeta{}); err != nil {
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// TODO(lavalamp): move this call to scheme builder above. Can't
|
||||
// remove it from here because lots of people inapropriately rely on it
|
||||
// (specifically the unversioned time conversion). Can't have it in
|
||||
// both places because then it gets double registered. Consequence of
|
||||
// current state is that it only ever gets registered in the main
|
||||
// api.Scheme, even though everyone that uses anything from unversioned
|
||||
// needs these.
|
||||
if err := addConversionFuncs(Scheme); err != nil {
|
||||
// Programmer error.
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
if err := scheme.AddIgnoredConversionType(&unversioned.TypeMeta{}, &unversioned.TypeMeta{}); err != nil {
|
||||
return err
|
||||
}
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Pod{},
|
||||
&PodList{},
|
||||
|
|
@ -104,7 +127,7 @@ func AddToScheme(scheme *runtime.Scheme) {
|
|||
)
|
||||
|
||||
// Register Unversioned types under their own special group
|
||||
Scheme.AddUnversionedTypes(Unversioned,
|
||||
scheme.AddUnversionedTypes(Unversioned,
|
||||
&unversioned.ExportOptions{},
|
||||
&unversioned.Status{},
|
||||
&unversioned.APIVersions{},
|
||||
|
|
@ -112,4 +135,5 @@ func AddToScheme(scheme *runtime.Scheme) {
|
|||
&unversioned.APIGroup{},
|
||||
&unversioned.APIResourceList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
3
vendor/k8s.io/kubernetes/pkg/api/replication_controller_example.json
generated
vendored
3
vendor/k8s.io/kubernetes/pkg/api/replication_controller_example.json
generated
vendored
|
|
@ -40,7 +40,8 @@
|
|||
"secret": null,
|
||||
"nfs": null,
|
||||
"iscsi": null,
|
||||
"glusterfs": null
|
||||
"glusterfs": null,
|
||||
"quobyte": null
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
|
|
|
|||
27
vendor/k8s.io/kubernetes/pkg/api/resource/generated.pb.go
generated
vendored
27
vendor/k8s.io/kubernetes/pkg/api/resource/generated.pb.go
generated
vendored
|
|
@ -38,9 +38,32 @@ var _ = proto.Marshal
|
|||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
func (m *Quantity) Reset() { *m = Quantity{} }
|
||||
func (*Quantity) ProtoMessage() {}
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
const _ = proto.GoGoProtoPackageIsVersion1
|
||||
|
||||
func (m *Quantity) Reset() { *m = Quantity{} }
|
||||
func (*Quantity) ProtoMessage() {}
|
||||
func (*Quantity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Quantity)(nil), "k8s.io.kubernetes.pkg.api.resource.Quantity")
|
||||
}
|
||||
|
||||
var fileDescriptorGenerated = []byte{
|
||||
// 222 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0xca, 0xb6, 0x28, 0xd6,
|
||||
0xcb, 0xcc, 0xd7, 0xcf, 0x2e, 0x4d, 0x4a, 0x2d, 0xca, 0x4b, 0x2d, 0x49, 0x2d, 0xd6, 0x2f, 0xc8,
|
||||
0x4e, 0xd7, 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x4f,
|
||||
0x4f, 0xcd, 0x4b, 0x2d, 0x4a, 0x2c, 0x49, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52,
|
||||
0x82, 0xe8, 0xd1, 0x43, 0xe8, 0xd1, 0x03, 0xea, 0xd1, 0x03, 0xea, 0xd1, 0x83, 0xe9, 0x91, 0xd2,
|
||||
0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7,
|
||||
0x07, 0x6b, 0x4d, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0x62, 0xa4, 0x94, 0x21, 0x76,
|
||||
0x67, 0x94, 0x96, 0x64, 0xe6, 0xe8, 0x67, 0xe6, 0x95, 0x14, 0x97, 0x14, 0xa1, 0xbb, 0x42, 0xc9,
|
||||
0x82, 0x8b, 0x23, 0xb0, 0x34, 0x31, 0xaf, 0x24, 0xb3, 0xa4, 0x52, 0x48, 0x8c, 0x8b, 0x0d, 0xa8,
|
||||
0x24, 0x33, 0x2f, 0x5d, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xca, 0xb3, 0x12, 0x99, 0xb1,
|
||||
0x40, 0x9e, 0xa1, 0x63, 0xa1, 0x3c, 0xc3, 0x04, 0x20, 0x5e, 0x00, 0xc4, 0x0d, 0x77, 0x14, 0x18,
|
||||
0x9c, 0xb4, 0x4e, 0x3c, 0x94, 0x63, 0xb8, 0x00, 0xc4, 0x37, 0x80, 0xb8, 0xe1, 0x91, 0x1c, 0xe3,
|
||||
0x09, 0x20, 0xbe, 0x00, 0xc4, 0x0f, 0x80, 0x78, 0xc2, 0x63, 0x39, 0x86, 0x28, 0x0e, 0x98, 0x3f,
|
||||
0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x1c, 0x7f, 0xff, 0x20, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
|||
7
vendor/k8s.io/kubernetes/pkg/api/rest/create.go
generated
vendored
7
vendor/k8s.io/kubernetes/pkg/api/rest/create.go
generated
vendored
|
|
@ -40,7 +40,7 @@ type RESTCreateStrategy interface {
|
|||
// the object. For example: remove fields that are not to be persisted,
|
||||
// sort order-insensitive list fields, etc. This should not remove fields
|
||||
// whose presence would be considered a validation error.
|
||||
PrepareForCreate(obj runtime.Object)
|
||||
PrepareForCreate(ctx api.Context, obj runtime.Object)
|
||||
// Validate is invoked after default fields in the object have been filled in before
|
||||
// the object is persisted. This method should not mutate the object.
|
||||
Validate(ctx api.Context, obj runtime.Object) field.ErrorList
|
||||
|
|
@ -67,10 +67,13 @@ func BeforeCreate(strategy RESTCreateStrategy, ctx api.Context, obj runtime.Obje
|
|||
}
|
||||
objectMeta.DeletionTimestamp = nil
|
||||
objectMeta.DeletionGracePeriodSeconds = nil
|
||||
strategy.PrepareForCreate(obj)
|
||||
strategy.PrepareForCreate(ctx, obj)
|
||||
api.FillObjectMetaSystemFields(ctx, objectMeta)
|
||||
api.GenerateName(strategy, objectMeta)
|
||||
|
||||
// ClusterName is ignored and should not be saved
|
||||
objectMeta.ClusterName = ""
|
||||
|
||||
if errs := strategy.Validate(ctx, obj); len(errs) > 0 {
|
||||
return errors.NewInvalid(kind.GroupKind(), objectMeta.Name, errs)
|
||||
}
|
||||
|
|
|
|||
18
vendor/k8s.io/kubernetes/pkg/api/rest/delete.go
generated
vendored
18
vendor/k8s.io/kubernetes/pkg/api/rest/delete.go
generated
vendored
|
|
@ -32,12 +32,26 @@ type RESTDeleteStrategy interface {
|
|||
runtime.ObjectTyper
|
||||
}
|
||||
|
||||
type GarbageCollectionPolicy string
|
||||
|
||||
const (
|
||||
DeleteDependents GarbageCollectionPolicy = "DeleteDependents"
|
||||
OrphanDependents GarbageCollectionPolicy = "OrphanDependents"
|
||||
)
|
||||
|
||||
// GarbageCollectionDeleteStrategy must be implemented by the registry that wants to
|
||||
// orphan dependents by default.
|
||||
type GarbageCollectionDeleteStrategy interface {
|
||||
// DefaultGarbageCollectionPolicy returns the default garbage collection behavior.
|
||||
DefaultGarbageCollectionPolicy() GarbageCollectionPolicy
|
||||
}
|
||||
|
||||
// RESTGracefulDeleteStrategy must be implemented by the registry that supports
|
||||
// graceful deletion.
|
||||
type RESTGracefulDeleteStrategy interface {
|
||||
// CheckGracefulDelete should return true if the object can be gracefully deleted and set
|
||||
// any default values on the DeleteOptions.
|
||||
CheckGracefulDelete(obj runtime.Object, options *api.DeleteOptions) bool
|
||||
CheckGracefulDelete(ctx api.Context, obj runtime.Object, options *api.DeleteOptions) bool
|
||||
}
|
||||
|
||||
// BeforeDelete tests whether the object can be gracefully deleted. If graceful is set the object
|
||||
|
|
@ -87,7 +101,7 @@ func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Obje
|
|||
return false, true, nil
|
||||
}
|
||||
|
||||
if !gracefulStrategy.CheckGracefulDelete(obj, options) {
|
||||
if !gracefulStrategy.CheckGracefulDelete(ctx, obj, options) {
|
||||
return false, false, nil
|
||||
}
|
||||
now := unversioned.NewTime(unversioned.Now().Add(time.Second * time.Duration(*options.GracePeriodSeconds)))
|
||||
|
|
|
|||
3
vendor/k8s.io/kubernetes/pkg/api/rest/export.go
generated
vendored
3
vendor/k8s.io/kubernetes/pkg/api/rest/export.go
generated
vendored
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package rest
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
|
|
@ -24,5 +25,5 @@ import (
|
|||
type RESTExportStrategy interface {
|
||||
// Export strips fields that can not be set by the user. If 'exact' is false
|
||||
// fields specific to the cluster are also stripped
|
||||
Export(obj runtime.Object, exact bool) error
|
||||
Export(ctx api.Context, obj runtime.Object, exact bool) error
|
||||
}
|
||||
|
|
|
|||
7
vendor/k8s.io/kubernetes/pkg/api/rest/update.go
generated
vendored
7
vendor/k8s.io/kubernetes/pkg/api/rest/update.go
generated
vendored
|
|
@ -41,7 +41,7 @@ type RESTUpdateStrategy interface {
|
|||
// the object. For example: remove fields that are not to be persisted,
|
||||
// sort order-insensitive list fields, etc. This should not remove fields
|
||||
// whose presence would be considered a validation error.
|
||||
PrepareForUpdate(obj, old runtime.Object)
|
||||
PrepareForUpdate(ctx api.Context, obj, old runtime.Object)
|
||||
// ValidateUpdate is invoked after default fields in the object have been
|
||||
// filled in before the object is persisted. This method should not mutate
|
||||
// the object.
|
||||
|
|
@ -93,7 +93,10 @@ func BeforeUpdate(strategy RESTUpdateStrategy, ctx api.Context, obj, old runtime
|
|||
}
|
||||
objectMeta.Generation = oldMeta.Generation
|
||||
|
||||
strategy.PrepareForUpdate(obj, old)
|
||||
strategy.PrepareForUpdate(ctx, obj, old)
|
||||
|
||||
// ClusterName is ignored and should not be saved
|
||||
objectMeta.ClusterName = ""
|
||||
|
||||
// Ensure some common fields, like UID, are validated for all resources.
|
||||
errs, err := validateCommonFields(obj, old)
|
||||
|
|
|
|||
61
vendor/k8s.io/kubernetes/pkg/api/service/annotations.go
generated
vendored
61
vendor/k8s.io/kubernetes/pkg/api/service/annotations.go
generated
vendored
|
|
@ -16,6 +16,13 @@ limitations under the License.
|
|||
|
||||
package service
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
)
|
||||
|
||||
const (
|
||||
// AnnotationLoadBalancerSourceRangesKey is the key of the annotation on a service to set allowed ingress ranges on their LoadBalancers
|
||||
//
|
||||
|
|
@ -25,4 +32,58 @@ const (
|
|||
//
|
||||
// Not all cloud providers support this annotation, though AWS & GCE do.
|
||||
AnnotationLoadBalancerSourceRangesKey = "service.beta.kubernetes.io/load-balancer-source-ranges"
|
||||
|
||||
// AnnotationExternalTraffic An annotation that denotes if this Service desires to route external traffic to local
|
||||
// endpoints only. This preserves Source IP and avoids a second hop.
|
||||
AnnotationExternalTraffic = "service.alpha.kubernetes.io/external-traffic"
|
||||
// AnnotationValueExternalTrafficLocal Value of annotation to specify local endpoints behaviour
|
||||
AnnotationValueExternalTrafficLocal = "OnlyLocal"
|
||||
// AnnotationValueExternalTrafficGlobal Value of annotation to specify global (legacy) behaviour
|
||||
AnnotationValueExternalTrafficGlobal = "Global"
|
||||
// AnnotationHealthCheckNodePort Annotation specifying the healthcheck nodePort for the service
|
||||
// If not specified, annotation is created by the service api backend with the allocated nodePort
|
||||
// Will use user-specified nodePort value if specified by the client
|
||||
AnnotationHealthCheckNodePort = "service.alpha.kubernetes.io/healthcheck-nodeport"
|
||||
)
|
||||
|
||||
// NeedsHealthCheck Check service for health check annotations
|
||||
func NeedsHealthCheck(service *api.Service) bool {
|
||||
if l, ok := service.Annotations[AnnotationExternalTraffic]; ok {
|
||||
if l == AnnotationValueExternalTrafficLocal {
|
||||
return true
|
||||
} else if l == AnnotationValueExternalTrafficGlobal {
|
||||
return false
|
||||
} else {
|
||||
glog.Errorf("Invalid value for annotation %v", AnnotationExternalTraffic)
|
||||
return false
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetServiceHealthCheckNodePort Return health check node port annotation for service, if one exists
|
||||
func GetServiceHealthCheckNodePort(service *api.Service) int32 {
|
||||
if NeedsHealthCheck(service) {
|
||||
if l, ok := service.Annotations[AnnotationHealthCheckNodePort]; ok {
|
||||
p, err := strconv.Atoi(l)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to parse annotation %v: %v", AnnotationHealthCheckNodePort, err)
|
||||
return 0
|
||||
}
|
||||
return int32(p)
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetServiceHealthCheckPathPort Return the path and nodePort programmed into the Cloud LB Health Check
|
||||
func GetServiceHealthCheckPathPort(service *api.Service) (string, int32) {
|
||||
if !NeedsHealthCheck(service) {
|
||||
return "", 0
|
||||
}
|
||||
port := GetServiceHealthCheckNodePort(service)
|
||||
if port == 0 {
|
||||
return "", 0
|
||||
}
|
||||
return "/healthz", port
|
||||
}
|
||||
|
|
|
|||
73
vendor/k8s.io/kubernetes/pkg/api/testapi/testapi.go
generated
vendored
73
vendor/k8s.io/kubernetes/pkg/api/testapi/testapi.go
generated
vendored
|
|
@ -34,6 +34,7 @@ import (
|
|||
"k8s.io/kubernetes/pkg/apis/batch"
|
||||
"k8s.io/kubernetes/pkg/apis/certificates"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/apis/imagepolicy"
|
||||
"k8s.io/kubernetes/pkg/apis/policy"
|
||||
"k8s.io/kubernetes/pkg/apis/rbac"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
|
|
@ -42,11 +43,14 @@ import (
|
|||
_ "k8s.io/kubernetes/federation/apis/federation/install"
|
||||
_ "k8s.io/kubernetes/pkg/api/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/apps/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/authentication/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/authorization/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/batch/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/certificates/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/componentconfig/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/imagepolicy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
)
|
||||
|
|
@ -62,6 +66,7 @@ var (
|
|||
Federation TestGroup
|
||||
Rbac TestGroup
|
||||
Certificates TestGroup
|
||||
ImagePolicy TestGroup
|
||||
|
||||
serializer runtime.SerializerInfo
|
||||
storageSerializer runtime.SerializerInfo
|
||||
|
|
@ -71,6 +76,7 @@ type TestGroup struct {
|
|||
externalGroupVersion unversioned.GroupVersion
|
||||
internalGroupVersion unversioned.GroupVersion
|
||||
internalTypes map[string]reflect.Type
|
||||
externalTypes map[string]reflect.Type
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
@ -112,22 +118,27 @@ func init() {
|
|||
externalGroupVersion: groupVersion,
|
||||
internalGroupVersion: internalGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(internalGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(groupVersion),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := Groups[api.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: api.GroupName, Version: registered.GroupOrDie(api.GroupName).GroupVersion.Version}
|
||||
Groups[api.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: api.GroupName, Version: registered.GroupOrDie(api.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: api.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(api.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[extensions.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: extensions.GroupName, Version: registered.GroupOrDie(extensions.GroupName).GroupVersion.Version}
|
||||
Groups[extensions.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: extensions.GroupName, Version: registered.GroupOrDie(extensions.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: extensions.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(extensions.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[autoscaling.GroupName]; !ok {
|
||||
|
|
@ -138,10 +149,12 @@ func init() {
|
|||
}
|
||||
internalTypes[k] = t
|
||||
}
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: autoscaling.GroupName, Version: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.Version}
|
||||
Groups[autoscaling.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: autoscaling.GroupName, Version: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: extensions.SchemeGroupVersion,
|
||||
internalTypes: internalTypes,
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[autoscaling.GroupName+"IntraGroup"]; !ok {
|
||||
|
|
@ -152,52 +165,76 @@ func init() {
|
|||
break
|
||||
}
|
||||
}
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: autoscaling.GroupName, Version: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.Version}
|
||||
Groups[autoscaling.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: autoscaling.GroupName, Version: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: autoscaling.SchemeGroupVersion,
|
||||
internalTypes: internalTypes,
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[batch.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: batch.GroupName, Version: registered.GroupOrDie(batch.GroupName).GroupVersion.Version}
|
||||
Groups[batch.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: batch.GroupName, Version: registered.GroupOrDie(batch.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: batch.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(batch.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[apps.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: apps.GroupName, Version: registered.GroupOrDie(apps.GroupName).GroupVersion.Version}
|
||||
Groups[apps.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: apps.GroupName, Version: registered.GroupOrDie(apps.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: extensions.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(extensions.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[policy.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: policy.GroupName, Version: registered.GroupOrDie(policy.GroupName).GroupVersion.Version}
|
||||
Groups[policy.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: policy.GroupName, Version: registered.GroupOrDie(policy.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: policy.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(policy.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[federation.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: federation.GroupName, Version: registered.GroupOrDie(federation.GroupName).GroupVersion.Version}
|
||||
Groups[federation.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: federation.GroupName, Version: registered.GroupOrDie(federation.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: federation.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(federation.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[rbac.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: rbac.GroupName, Version: registered.GroupOrDie(rbac.GroupName).GroupVersion.Version}
|
||||
Groups[rbac.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: rbac.GroupName, Version: registered.GroupOrDie(rbac.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: rbac.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(rbac.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
if _, ok := Groups[certificates.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: certificates.GroupName, Version: registered.GroupOrDie(certificates.GroupName).GroupVersion.Version}
|
||||
Groups[certificates.GroupName] = TestGroup{
|
||||
externalGroupVersion: unversioned.GroupVersion{Group: certificates.GroupName, Version: registered.GroupOrDie(certificates.GroupName).GroupVersion.Version},
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: certificates.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(certificates.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := Groups[imagepolicy.GroupName]; !ok {
|
||||
externalGroupVersion := unversioned.GroupVersion{Group: imagepolicy.GroupName, Version: registered.GroupOrDie(imagepolicy.GroupName).GroupVersion.Version}
|
||||
Groups[imagepolicy.GroupName] = TestGroup{
|
||||
externalGroupVersion: externalGroupVersion,
|
||||
internalGroupVersion: imagepolicy.SchemeGroupVersion,
|
||||
internalTypes: api.Scheme.KnownTypes(imagepolicy.SchemeGroupVersion),
|
||||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -210,6 +247,7 @@ func init() {
|
|||
Extensions = Groups[extensions.GroupName]
|
||||
Federation = Groups[federation.GroupName]
|
||||
Rbac = Groups[rbac.GroupName]
|
||||
ImagePolicy = Groups[imagepolicy.GroupName]
|
||||
}
|
||||
|
||||
func (g TestGroup) ContentConfig() (string, *unversioned.GroupVersion, runtime.Codec) {
|
||||
|
|
@ -232,13 +270,18 @@ func (g TestGroup) InternalTypes() map[string]reflect.Type {
|
|||
return g.internalTypes
|
||||
}
|
||||
|
||||
// ExternalTypes returns a map of external API types' kind names to their Go types.
|
||||
func (g TestGroup) ExternalTypes() map[string]reflect.Type {
|
||||
return g.externalTypes
|
||||
}
|
||||
|
||||
// Codec returns the codec for the API version to test against, as set by the
|
||||
// KUBE_TEST_API_TYPE env var.
|
||||
func (g TestGroup) Codec() runtime.Codec {
|
||||
if serializer.Serializer == nil {
|
||||
return api.Codecs.LegacyCodec(g.externalGroupVersion)
|
||||
}
|
||||
return api.Codecs.CodecForVersions(serializer, api.Codecs.UniversalDeserializer(), []unversioned.GroupVersion{g.externalGroupVersion}, nil)
|
||||
return api.Codecs.CodecForVersions(serializer, api.Codecs.UniversalDeserializer(), unversioned.GroupVersions{g.externalGroupVersion}, nil)
|
||||
}
|
||||
|
||||
// NegotiatedSerializer returns the negotiated serializer for the server.
|
||||
|
|
@ -266,7 +309,7 @@ func (g TestGroup) StorageCodec() runtime.Codec {
|
|||
}
|
||||
ds := recognizer.NewDecoder(s, api.Codecs.UniversalDeserializer())
|
||||
|
||||
return api.Codecs.CodecForVersions(s, ds, []unversioned.GroupVersion{g.externalGroupVersion}, nil)
|
||||
return api.Codecs.CodecForVersions(s, ds, unversioned.GroupVersions{g.externalGroupVersion}, nil)
|
||||
}
|
||||
|
||||
// Converter returns the api.Scheme for the API version to test against, as set by the
|
||||
|
|
@ -350,7 +393,7 @@ func (g TestGroup) RESTMapper() meta.RESTMapper {
|
|||
}
|
||||
|
||||
// ExternalGroupVersions returns all external group versions allowed for the server.
|
||||
func ExternalGroupVersions() []unversioned.GroupVersion {
|
||||
func ExternalGroupVersions() unversioned.GroupVersions {
|
||||
versions := []unversioned.GroupVersion{}
|
||||
for _, g := range Groups {
|
||||
gv := g.GroupVersion()
|
||||
|
|
@ -387,6 +430,6 @@ func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) {
|
|||
return nil, fmt.Errorf("unexpected kind: %v", kind)
|
||||
}
|
||||
|
||||
func NewTestGroup(external, internal unversioned.GroupVersion, internalTypes map[string]reflect.Type) TestGroup {
|
||||
return TestGroup{external, internal, internalTypes}
|
||||
func NewTestGroup(external, internal unversioned.GroupVersion, internalTypes map[string]reflect.Type, externalTypes map[string]reflect.Type) TestGroup {
|
||||
return TestGroup{external, internal, internalTypes, externalTypes}
|
||||
}
|
||||
|
|
|
|||
51468
vendor/k8s.io/kubernetes/pkg/api/types.generated.go
generated
vendored
51468
vendor/k8s.io/kubernetes/pkg/api/types.generated.go
generated
vendored
File diff suppressed because it is too large
Load diff
197
vendor/k8s.io/kubernetes/pkg/api/types.go
generated
vendored
197
vendor/k8s.io/kubernetes/pkg/api/types.go
generated
vendored
|
|
@ -130,7 +130,6 @@ type ObjectMeta struct {
|
|||
// The prefix is optional. If the prefix is not specified, the key is assumed to be private
|
||||
// to the user. Other system components that wish to use labels must specify a prefix. The
|
||||
// "kubernetes.io/" prefix is reserved for use by kubernetes components.
|
||||
// TODO: replace map[string]string with labels.LabelSet type
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
||||
// Annotations are unstructured key value data stored with a resource that may be set by
|
||||
|
|
@ -150,6 +149,11 @@ type ObjectMeta struct {
|
|||
// from the list. If the deletionTimestamp of the object is non-nil, entries
|
||||
// in this list can only be removed.
|
||||
Finalizers []string `json:"finalizers,omitempty"`
|
||||
|
||||
// The name of the cluster which the object belongs to.
|
||||
// This is used to distinguish resources with same name and namespace in different clusters.
|
||||
// This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
@ -210,6 +214,10 @@ type VolumeSource struct {
|
|||
PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"`
|
||||
// RBD represents a Rados Block Device mount on the host that shares a pod's lifetime
|
||||
RBD *RBDVolumeSource `json:"rbd,omitempty"`
|
||||
|
||||
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
|
||||
Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty"`
|
||||
|
||||
// FlexVolume represents a generic volume resource that is
|
||||
// provisioned/attached using a exec based plugin. This is an alpha feature and may change in future.
|
||||
FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty"`
|
||||
|
|
@ -233,6 +241,8 @@ type VolumeSource struct {
|
|||
ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty"`
|
||||
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
|
||||
VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"`
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty"`
|
||||
}
|
||||
|
||||
// Similar to VolumeSource but meant for the administrator who creates PVs.
|
||||
|
|
@ -255,6 +265,8 @@ type PersistentVolumeSource struct {
|
|||
NFS *NFSVolumeSource `json:"nfs,omitempty"`
|
||||
// RBD represents a Rados Block Device mount on the host that shares a pod's lifetime
|
||||
RBD *RBDVolumeSource `json:"rbd,omitempty"`
|
||||
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
|
||||
Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty"`
|
||||
// ISCSIVolumeSource represents an ISCSI resource that is attached to a
|
||||
// kubelet's host machine and then exposed to the pod.
|
||||
ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"`
|
||||
|
|
@ -273,6 +285,8 @@ type PersistentVolumeSource struct {
|
|||
AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty"`
|
||||
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
|
||||
VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"`
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty"`
|
||||
}
|
||||
|
||||
type PersistentVolumeClaimVolumeSource struct {
|
||||
|
|
@ -607,6 +621,12 @@ type SecretVolumeSource struct {
|
|||
// the volume setup will error. Paths must be relative and may not contain
|
||||
// the '..' path or start with '..'.
|
||||
Items []KeyToPath `json:"items,omitempty"`
|
||||
// Mode bits to use on created files by default. Must be a value between
|
||||
// 0 and 0777.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
DefaultMode *int32 `json:"defaultMode,omitempty"`
|
||||
}
|
||||
|
||||
// Represents an NFS mount that lasts the lifetime of a pod.
|
||||
|
|
@ -623,6 +643,30 @@ type NFSVolumeSource struct {
|
|||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
}
|
||||
|
||||
// Represents a Quobyte mount that lasts the lifetime of a pod.
|
||||
// Quobyte volumes do not support ownership management or SELinux relabeling.
|
||||
type QuobyteVolumeSource struct {
|
||||
// Registry represents a single or multiple Quobyte Registry services
|
||||
// specified as a string as host:port pair (multiple entries are separated with commas)
|
||||
// which acts as the central registry for volumes
|
||||
Registry string `json:"registry"`
|
||||
|
||||
// Volume is a string that references an already created Quobyte volume by name.
|
||||
Volume string `json:"volume"`
|
||||
|
||||
// Defaults to false (read/write). ReadOnly here will force
|
||||
// the Quobyte to be mounted with read-only permissions
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
|
||||
// User to map volume access to
|
||||
// Defaults to the root user
|
||||
User string `json:"user,omitempty"`
|
||||
|
||||
// Group to map volume access to
|
||||
// Default is no group
|
||||
Group string `json:"group,omitempty"`
|
||||
}
|
||||
|
||||
// Represents a Glusterfs mount that lasts the lifetime of a pod.
|
||||
// Glusterfs volumes do not support ownership management or SELinux relabeling.
|
||||
type GlusterfsVolumeSource struct {
|
||||
|
|
@ -708,6 +752,12 @@ type FlockerVolumeSource struct {
|
|||
type DownwardAPIVolumeSource struct {
|
||||
// Items is a list of DownwardAPIVolume file
|
||||
Items []DownwardAPIVolumeFile `json:"items,omitempty"`
|
||||
// Mode bits to use on created files by default. Must be a value between
|
||||
// 0 and 0777.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
DefaultMode *int32 `json:"defaultMode,omitempty"`
|
||||
}
|
||||
|
||||
// Represents a single file containing information from the downward API
|
||||
|
|
@ -719,6 +769,11 @@ type DownwardAPIVolumeFile struct {
|
|||
// Selects a resource of the container: only resources limits and requests
|
||||
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
|
||||
ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty"`
|
||||
// Optional: mode bits to use on this file, must be a value between 0
|
||||
// and 0777. If not specified, the volume defaultMode will be used.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
Mode *int32 `json:"mode,omitempty"`
|
||||
}
|
||||
|
||||
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
|
||||
|
|
@ -742,6 +797,31 @@ type VsphereVirtualDiskVolumeSource struct {
|
|||
FSType string `json:"fsType,omitempty"`
|
||||
}
|
||||
|
||||
type AzureDataDiskCachingMode string
|
||||
|
||||
const (
|
||||
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
|
||||
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
|
||||
AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite"
|
||||
)
|
||||
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
type AzureDiskVolumeSource struct {
|
||||
// The Name of the data disk in the blob storage
|
||||
DiskName string `json:"diskName"`
|
||||
// The URI the the data disk in the blob storage
|
||||
DataDiskURI string `json:"diskURI"`
|
||||
// Host Caching mode: None, Read Only, Read Write.
|
||||
CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty"`
|
||||
// Filesystem type to mount.
|
||||
// Must be a filesystem type supported by the host operating system.
|
||||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
FSType *string `json:"fsType,omitempty"`
|
||||
// Defaults to false (read/write). ReadOnly here will force
|
||||
// the ReadOnly setting in VolumeMounts.
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
}
|
||||
|
||||
// Adapts a ConfigMap into a volume.
|
||||
//
|
||||
// The contents of the target ConfigMap's Data field will be presented in a
|
||||
|
|
@ -758,6 +838,12 @@ type ConfigMapVolumeSource struct {
|
|||
// the volume setup will error. Paths must be relative and may not contain
|
||||
// the '..' path or start with '..'.
|
||||
Items []KeyToPath `json:"items,omitempty"`
|
||||
// Mode bits to use on created files by default. Must be a value between
|
||||
// 0 and 0777.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
DefaultMode *int32 `json:"defaultMode,omitempty"`
|
||||
}
|
||||
|
||||
// Maps a string key to a path within a volume.
|
||||
|
|
@ -770,6 +856,11 @@ type KeyToPath struct {
|
|||
// May not contain the path element '..'.
|
||||
// May not start with the string '..'.
|
||||
Path string `json:"path"`
|
||||
// Optional: mode bits to use on this file, should be a value between 0
|
||||
// and 0777. If not specified, the volume defaultMode will be used.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
Mode *int32 `json:"mode,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerPort represents a network port in a single container
|
||||
|
|
@ -821,7 +912,8 @@ type EnvVar struct {
|
|||
// EnvVarSource represents a source for the value of an EnvVar.
|
||||
// Only one of its fields may be set.
|
||||
type EnvVarSource struct {
|
||||
// Selects a field of the pod; only name and namespace are supported.
|
||||
// Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations,
|
||||
// spec.nodeName, spec.serviceAccountName, status.podIP.
|
||||
FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty"`
|
||||
// Selects a resource of the container: only resources limits and requests
|
||||
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
|
||||
|
|
@ -1472,6 +1564,14 @@ type PodSpec struct {
|
|||
Subdomain string `json:"subdomain,omitempty"`
|
||||
}
|
||||
|
||||
// Sysctl defines a kernel parameter to be set
|
||||
type Sysctl struct {
|
||||
// Name of a property to set
|
||||
Name string `json:"name"`
|
||||
// Value of a property to set
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// PodSecurityContext holds pod-level security attributes and common container settings.
|
||||
// Some fields are also present in container.securityContext. Field values of
|
||||
// container.securityContext take precedence over field values of PodSecurityContext.
|
||||
|
|
@ -1636,6 +1736,9 @@ type ReplicationControllerStatus struct {
|
|||
// The number of pods that have labels matching the labels of the pod template of the replication controller.
|
||||
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`
|
||||
|
||||
// The number of ready replicas for this replication controller.
|
||||
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
|
||||
|
||||
// ObservedGeneration is the most recent generation observed by the controller.
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||
}
|
||||
|
|
@ -1704,6 +1807,11 @@ const (
|
|||
// external load balancer (if the cloud provider supports it), in addition
|
||||
// to 'NodePort' type.
|
||||
ServiceTypeLoadBalancer ServiceType = "LoadBalancer"
|
||||
|
||||
// ServiceTypeExternalName means a service consists of only a reference to
|
||||
// an external name that kubedns or equivalent will return as a CNAME
|
||||
// record, with no exposing or proxying of any pods involved.
|
||||
ServiceTypeExternalName ServiceType = "ExternalName"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service
|
||||
|
|
@ -1734,24 +1842,49 @@ type LoadBalancerIngress struct {
|
|||
|
||||
// ServiceSpec describes the attributes that a user creates on a service
|
||||
type ServiceSpec struct {
|
||||
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
|
||||
// Type determines how the Service is exposed. Defaults to ClusterIP. Valid
|
||||
// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
|
||||
// "ExternalName" maps to the specified externalName.
|
||||
// "ClusterIP" allocates a cluster-internal IP address for load-balancing to
|
||||
// endpoints. Endpoints are determined by the selector or if that is not
|
||||
// specified, by manual construction of an Endpoints object. If clusterIP is
|
||||
// "None", no virtual IP is allocated and the endpoints are published as a
|
||||
// set of endpoints rather than a stable IP.
|
||||
// "NodePort" builds on ClusterIP and allocates a port on every node which
|
||||
// routes to the clusterIP.
|
||||
// "LoadBalancer" builds on NodePort and creates an
|
||||
// external load-balancer (if supported in the current cloud) which routes
|
||||
// to the clusterIP.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview
|
||||
Type ServiceType `json:"type,omitempty"`
|
||||
|
||||
// Required: The list of ports that are exposed by this service.
|
||||
Ports []ServicePort `json:"ports"`
|
||||
|
||||
// This service will route traffic to pods having labels matching this selector. If empty or not present,
|
||||
// the service is assumed to have endpoints set by an external process and Kubernetes will not modify
|
||||
// those endpoints.
|
||||
// Route service traffic to pods with label keys and values matching this
|
||||
// selector. If empty or not present, the service is assumed to have an
|
||||
// external process managing its endpoints, which Kubernetes will not
|
||||
// modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
|
||||
// Ignored if type is ExternalName.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview
|
||||
Selector map[string]string `json:"selector"`
|
||||
|
||||
// ClusterIP is usually assigned by the master. If specified by the user
|
||||
// we will try to respect it or else fail the request. This field can
|
||||
// not be changed by updates.
|
||||
// Valid values are None, empty string (""), or a valid IP address
|
||||
// None can be specified for headless services when proxying is not required
|
||||
// ClusterIP is the IP address of the service and is usually assigned
|
||||
// randomly by the master. If an address is specified manually and is not in
|
||||
// use by others, it will be allocated to the service; otherwise, creation
|
||||
// of the service will fail. This field can not be changed through updates.
|
||||
// Valid values are "None", empty string (""), or a valid IP address. "None"
|
||||
// can be specified for headless services when proxying is not required.
|
||||
// Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if
|
||||
// type is ExternalName.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies
|
||||
ClusterIP string `json:"clusterIP,omitempty"`
|
||||
|
||||
// ExternalName is the external reference that kubedns or equivalent will
|
||||
// return as a CNAME record for this service. No proxying will be involved.
|
||||
// Must be a valid DNS name and requires Type to be ExternalName.
|
||||
ExternalName string
|
||||
|
||||
// ExternalIPs are used by external load balancers, or can be set by
|
||||
// users to handle external traffic that arrives at a node.
|
||||
ExternalIPs []string `json:"externalIPs,omitempty"`
|
||||
|
|
@ -1889,6 +2022,8 @@ type EndpointAddress struct {
|
|||
// Optional: Hostname of this endpoint
|
||||
// Meant to be used by DNS servers etc.
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
// Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
|
||||
NodeName *string `json:"nodeName,omitempty"`
|
||||
// Optional: The kubernetes object related to the entry point.
|
||||
TargetRef *ObjectReference
|
||||
}
|
||||
|
|
@ -2008,6 +2143,34 @@ type AttachedVolume struct {
|
|||
DevicePath string `json:"devicePath"`
|
||||
}
|
||||
|
||||
// AvoidPods describes pods that should avoid this node. This is the value for a
|
||||
// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and
|
||||
// will eventually become a field of NodeStatus.
|
||||
type AvoidPods struct {
|
||||
// Bounded-sized list of signatures of pods that should avoid this node, sorted
|
||||
// in timestamp order from oldest to newest. Size of the slice is unspecified.
|
||||
PreferAvoidPods []PreferAvoidPodsEntry `json:"preferAvoidPods,omitempty"`
|
||||
}
|
||||
|
||||
// Describes a class of pods that should avoid this node.
|
||||
type PreferAvoidPodsEntry struct {
|
||||
// The class of pods.
|
||||
PodSignature PodSignature `json:"podSignature"`
|
||||
// Time at which this entry was added to the list.
|
||||
EvictionTime unversioned.Time `json:"evictionTime,omitempty"`
|
||||
// (brief) reason why this entry was added to the list.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// Human readable message indicating why this entry was added to the list.
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Describes the class of pods that should avoid this node.
|
||||
// Exactly one field should be set.
|
||||
type PodSignature struct {
|
||||
// Reference to controller whose pods should avoid this node.
|
||||
PodController *OwnerReference `json:"podController,omitempty"`
|
||||
}
|
||||
|
||||
// Describe a container image
|
||||
type ContainerImage struct {
|
||||
// Names by which this image is known.
|
||||
|
|
@ -2041,6 +2204,8 @@ const (
|
|||
NodeOutOfDisk NodeConditionType = "OutOfDisk"
|
||||
// NodeMemoryPressure means the kubelet is under pressure due to insufficient available memory.
|
||||
NodeMemoryPressure NodeConditionType = "MemoryPressure"
|
||||
// NodeDiskPressure means the kubelet is under pressure due to insufficient available disk.
|
||||
NodeDiskPressure NodeConditionType = "DiskPressure"
|
||||
// NodeNetworkUnavailable means that network for the node is not correctly configured.
|
||||
NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable"
|
||||
)
|
||||
|
|
@ -2232,7 +2397,11 @@ type ListOptions struct {
|
|||
FieldSelector fields.Selector
|
||||
// If true, watch for changes to this list
|
||||
Watch bool
|
||||
// The resource version to watch (no effect on list yet)
|
||||
// For watch, it's the resource version to watch.
|
||||
// For list,
|
||||
// - if unset, then the result is returned from remote storage based on quorum-read flag;
|
||||
// - if it's 0, then we simply return what we currently have in cache, no guarantee;
|
||||
// - if set to non zero, then the result is as fresh as given rv.
|
||||
ResourceVersion string
|
||||
// Timeout for the list/watch call.
|
||||
TimeoutSeconds *int64
|
||||
|
|
@ -2536,6 +2705,8 @@ const (
|
|||
ResourceRequestsCPU ResourceName = "requests.cpu"
|
||||
// Memory request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
|
||||
ResourceRequestsMemory ResourceName = "requests.memory"
|
||||
// Storage request, in bytes
|
||||
ResourceRequestsStorage ResourceName = "requests.storage"
|
||||
// CPU limit, in cores. (500m = .5 cores)
|
||||
ResourceLimitsCPU ResourceName = "limits.cpu"
|
||||
// Memory limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
|
||||
|
|
@ -2757,6 +2928,8 @@ const (
|
|||
StreamTypeData = "data"
|
||||
// Value for streamType header for error stream
|
||||
StreamTypeError = "error"
|
||||
// Value for streamType header for terminal resize stream
|
||||
StreamTypeResize = "resize"
|
||||
|
||||
// Name of header that specifies the port being forwarded
|
||||
PortHeader = "port"
|
||||
|
|
|
|||
288
vendor/k8s.io/kubernetes/pkg/api/unversioned/deep_copy_generated.go
generated
vendored
288
vendor/k8s.io/kubernetes/pkg/api/unversioned/deep_copy_generated.go
generated
vendored
|
|
@ -1,288 +0,0 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
time "time"
|
||||
)
|
||||
|
||||
func DeepCopy_unversioned_APIGroup(in APIGroup, out *APIGroup, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Name = in.Name
|
||||
if in.Versions != nil {
|
||||
in, out := in.Versions, &out.Versions
|
||||
*out = make([]GroupVersionForDiscovery, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
out.PreferredVersion = in.PreferredVersion
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIGroupList(in APIGroupList, out *APIGroupList, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Groups != nil {
|
||||
in, out := in.Groups, &out.Groups
|
||||
*out = make([]APIGroup, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_unversioned_APIGroup(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Groups = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResource(in APIResource, out *APIResource, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
out.Namespaced = in.Namespaced
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResourceList(in APIResourceList, out *APIResourceList, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.GroupVersion = in.GroupVersion
|
||||
if in.APIResources != nil {
|
||||
in, out := in.APIResources, &out.APIResources
|
||||
*out = make([]APIResource, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.APIResources = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIVersions(in APIVersions, out *APIVersions, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Versions != nil {
|
||||
in, out := in.Versions, &out.Versions
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Duration(in Duration, out *Duration, c *conversion.Cloner) error {
|
||||
out.Duration = in.Duration
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Export = in.Export
|
||||
out.Exact = in.Exact
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupKind(in GroupKind, out *GroupKind, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupResource(in GroupResource, out *GroupResource, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersion(in GroupVersion, out *GroupVersion, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionForDiscovery(in GroupVersionForDiscovery, out *GroupVersionForDiscovery, c *conversion.Cloner) error {
|
||||
out.GroupVersion = in.GroupVersion
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionKind(in GroupVersionKind, out *GroupVersionKind, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionResource(in GroupVersionResource, out *GroupVersionResource, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelector(in LabelSelector, out *LabelSelector, c *conversion.Cloner) error {
|
||||
if in.MatchLabels != nil {
|
||||
in, out := in.MatchLabels, &out.MatchLabels
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.MatchLabels = nil
|
||||
}
|
||||
if in.MatchExpressions != nil {
|
||||
in, out := in.MatchExpressions, &out.MatchExpressions
|
||||
*out = make([]LabelSelectorRequirement, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_unversioned_LabelSelectorRequirement(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.MatchExpressions = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelectorRequirement(in LabelSelectorRequirement, out *LabelSelectorRequirement, c *conversion.Cloner) error {
|
||||
out.Key = in.Key
|
||||
out.Operator = in.Operator
|
||||
if in.Values != nil {
|
||||
in, out := in.Values, &out.Values
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Values = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ListMeta(in ListMeta, out *ListMeta, c *conversion.Cloner) error {
|
||||
out.SelfLink = in.SelfLink
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Patch(in Patch, out *Patch, c *conversion.Cloner) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_RootPaths(in RootPaths, out *RootPaths, c *conversion.Cloner) error {
|
||||
if in.Paths != nil {
|
||||
in, out := in.Paths, &out.Paths
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Paths = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ServerAddressByClientCIDR(in ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, c *conversion.Cloner) error {
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Status(in Status, out *Status, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Status = in.Status
|
||||
out.Message = in.Message
|
||||
out.Reason = in.Reason
|
||||
if in.Details != nil {
|
||||
in, out := in.Details, &out.Details
|
||||
*out = new(StatusDetails)
|
||||
if err := DeepCopy_unversioned_StatusDetails(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Details = nil
|
||||
}
|
||||
out.Code = in.Code
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_StatusCause(in StatusCause, out *StatusCause, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
out.Message = in.Message
|
||||
out.Field = in.Field
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_StatusDetails(in StatusDetails, out *StatusDetails, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
if in.Causes != nil {
|
||||
in, out := in.Causes, &out.Causes
|
||||
*out = make([]StatusCause, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.Causes = nil
|
||||
}
|
||||
out.RetryAfterSeconds = in.RetryAfterSeconds
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Time(in Time, out *Time, c *conversion.Cloner) error {
|
||||
if newVal, err := c.DeepCopy(in.Time); err != nil {
|
||||
return err
|
||||
} else {
|
||||
out.Time = newVal.(time.Time)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Timestamp(in Timestamp, out *Timestamp, c *conversion.Cloner) error {
|
||||
out.Seconds = in.Seconds
|
||||
out.Nanos = in.Nanos
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_TypeMeta(in TypeMeta, out *TypeMeta, c *conversion.Cloner) error {
|
||||
out.Kind = in.Kind
|
||||
out.APIVersion = in.APIVersion
|
||||
return nil
|
||||
}
|
||||
456
vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.pb.go
generated
vendored
456
vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.pb.go
generated
vendored
|
|
@ -58,6 +58,10 @@ import math "math"
|
|||
|
||||
import time "time"
|
||||
|
||||
import strings "strings"
|
||||
import reflect "reflect"
|
||||
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
|
||||
|
||||
import io "io"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
|
@ -65,95 +69,111 @@ var _ = proto.Marshal
|
|||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
func (m *APIGroup) Reset() { *m = APIGroup{} }
|
||||
func (m *APIGroup) String() string { return proto.CompactTextString(m) }
|
||||
func (*APIGroup) ProtoMessage() {}
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
const _ = proto.GoGoProtoPackageIsVersion1
|
||||
|
||||
func (m *APIGroupList) Reset() { *m = APIGroupList{} }
|
||||
func (m *APIGroupList) String() string { return proto.CompactTextString(m) }
|
||||
func (*APIGroupList) ProtoMessage() {}
|
||||
func (m *APIGroup) Reset() { *m = APIGroup{} }
|
||||
func (*APIGroup) ProtoMessage() {}
|
||||
func (*APIGroup) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
|
||||
|
||||
func (m *APIResource) Reset() { *m = APIResource{} }
|
||||
func (m *APIResource) String() string { return proto.CompactTextString(m) }
|
||||
func (*APIResource) ProtoMessage() {}
|
||||
func (m *APIGroupList) Reset() { *m = APIGroupList{} }
|
||||
func (*APIGroupList) ProtoMessage() {}
|
||||
func (*APIGroupList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
|
||||
|
||||
func (m *APIResourceList) Reset() { *m = APIResourceList{} }
|
||||
func (m *APIResourceList) String() string { return proto.CompactTextString(m) }
|
||||
func (*APIResourceList) ProtoMessage() {}
|
||||
func (m *APIResource) Reset() { *m = APIResource{} }
|
||||
func (*APIResource) ProtoMessage() {}
|
||||
func (*APIResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
|
||||
|
||||
func (m *APIVersions) Reset() { *m = APIVersions{} }
|
||||
func (*APIVersions) ProtoMessage() {}
|
||||
func (m *APIResourceList) Reset() { *m = APIResourceList{} }
|
||||
func (*APIResourceList) ProtoMessage() {}
|
||||
func (*APIResourceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} }
|
||||
|
||||
func (m *Duration) Reset() { *m = Duration{} }
|
||||
func (m *Duration) String() string { return proto.CompactTextString(m) }
|
||||
func (*Duration) ProtoMessage() {}
|
||||
func (m *APIVersions) Reset() { *m = APIVersions{} }
|
||||
func (*APIVersions) ProtoMessage() {}
|
||||
func (*APIVersions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} }
|
||||
|
||||
func (m *ExportOptions) Reset() { *m = ExportOptions{} }
|
||||
func (m *ExportOptions) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExportOptions) ProtoMessage() {}
|
||||
func (m *Duration) Reset() { *m = Duration{} }
|
||||
func (*Duration) ProtoMessage() {}
|
||||
func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} }
|
||||
|
||||
func (m *GroupKind) Reset() { *m = GroupKind{} }
|
||||
func (*GroupKind) ProtoMessage() {}
|
||||
func (m *ExportOptions) Reset() { *m = ExportOptions{} }
|
||||
func (*ExportOptions) ProtoMessage() {}
|
||||
func (*ExportOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} }
|
||||
|
||||
func (m *GroupResource) Reset() { *m = GroupResource{} }
|
||||
func (*GroupResource) ProtoMessage() {}
|
||||
func (m *GroupKind) Reset() { *m = GroupKind{} }
|
||||
func (*GroupKind) ProtoMessage() {}
|
||||
func (*GroupKind) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} }
|
||||
|
||||
func (m *GroupVersion) Reset() { *m = GroupVersion{} }
|
||||
func (*GroupVersion) ProtoMessage() {}
|
||||
func (m *GroupResource) Reset() { *m = GroupResource{} }
|
||||
func (*GroupResource) ProtoMessage() {}
|
||||
func (*GroupResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} }
|
||||
|
||||
func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
|
||||
func (m *GroupVersionForDiscovery) String() string { return proto.CompactTextString(m) }
|
||||
func (*GroupVersionForDiscovery) ProtoMessage() {}
|
||||
func (m *GroupVersion) Reset() { *m = GroupVersion{} }
|
||||
func (*GroupVersion) ProtoMessage() {}
|
||||
func (*GroupVersion) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} }
|
||||
|
||||
func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
|
||||
func (*GroupVersionKind) ProtoMessage() {}
|
||||
func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
|
||||
func (*GroupVersionForDiscovery) ProtoMessage() {}
|
||||
func (*GroupVersionForDiscovery) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptorGenerated, []int{10}
|
||||
}
|
||||
|
||||
func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
|
||||
func (*GroupVersionResource) ProtoMessage() {}
|
||||
func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
|
||||
func (*GroupVersionKind) ProtoMessage() {}
|
||||
func (*GroupVersionKind) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} }
|
||||
|
||||
func (m *LabelSelector) Reset() { *m = LabelSelector{} }
|
||||
func (m *LabelSelector) String() string { return proto.CompactTextString(m) }
|
||||
func (*LabelSelector) ProtoMessage() {}
|
||||
func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
|
||||
func (*GroupVersionResource) ProtoMessage() {}
|
||||
func (*GroupVersionResource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} }
|
||||
|
||||
func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
|
||||
func (m *LabelSelectorRequirement) String() string { return proto.CompactTextString(m) }
|
||||
func (*LabelSelectorRequirement) ProtoMessage() {}
|
||||
func (m *LabelSelector) Reset() { *m = LabelSelector{} }
|
||||
func (*LabelSelector) ProtoMessage() {}
|
||||
func (*LabelSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} }
|
||||
|
||||
func (m *ListMeta) Reset() { *m = ListMeta{} }
|
||||
func (m *ListMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListMeta) ProtoMessage() {}
|
||||
func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
|
||||
func (*LabelSelectorRequirement) ProtoMessage() {}
|
||||
func (*LabelSelectorRequirement) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptorGenerated, []int{14}
|
||||
}
|
||||
|
||||
func (m *RootPaths) Reset() { *m = RootPaths{} }
|
||||
func (m *RootPaths) String() string { return proto.CompactTextString(m) }
|
||||
func (*RootPaths) ProtoMessage() {}
|
||||
func (m *ListMeta) Reset() { *m = ListMeta{} }
|
||||
func (*ListMeta) ProtoMessage() {}
|
||||
func (*ListMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} }
|
||||
|
||||
func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
|
||||
func (m *ServerAddressByClientCIDR) String() string { return proto.CompactTextString(m) }
|
||||
func (*ServerAddressByClientCIDR) ProtoMessage() {}
|
||||
func (m *RootPaths) Reset() { *m = RootPaths{} }
|
||||
func (*RootPaths) ProtoMessage() {}
|
||||
func (*RootPaths) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} }
|
||||
|
||||
func (m *Status) Reset() { *m = Status{} }
|
||||
func (m *Status) String() string { return proto.CompactTextString(m) }
|
||||
func (*Status) ProtoMessage() {}
|
||||
func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
|
||||
func (*ServerAddressByClientCIDR) ProtoMessage() {}
|
||||
func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptorGenerated, []int{17}
|
||||
}
|
||||
|
||||
func (m *StatusCause) Reset() { *m = StatusCause{} }
|
||||
func (m *StatusCause) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatusCause) ProtoMessage() {}
|
||||
func (m *Status) Reset() { *m = Status{} }
|
||||
func (*Status) ProtoMessage() {}
|
||||
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{18} }
|
||||
|
||||
func (m *StatusDetails) Reset() { *m = StatusDetails{} }
|
||||
func (m *StatusDetails) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatusDetails) ProtoMessage() {}
|
||||
func (m *StatusCause) Reset() { *m = StatusCause{} }
|
||||
func (*StatusCause) ProtoMessage() {}
|
||||
func (*StatusCause) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{19} }
|
||||
|
||||
func (m *Time) Reset() { *m = Time{} }
|
||||
func (m *Time) String() string { return proto.CompactTextString(m) }
|
||||
func (*Time) ProtoMessage() {}
|
||||
func (m *StatusDetails) Reset() { *m = StatusDetails{} }
|
||||
func (*StatusDetails) ProtoMessage() {}
|
||||
func (*StatusDetails) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{20} }
|
||||
|
||||
func (m *Timestamp) Reset() { *m = Timestamp{} }
|
||||
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
|
||||
func (*Timestamp) ProtoMessage() {}
|
||||
func (m *Time) Reset() { *m = Time{} }
|
||||
func (*Time) ProtoMessage() {}
|
||||
func (*Time) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{21} }
|
||||
|
||||
func (m *TypeMeta) Reset() { *m = TypeMeta{} }
|
||||
func (m *TypeMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*TypeMeta) ProtoMessage() {}
|
||||
func (m *Timestamp) Reset() { *m = Timestamp{} }
|
||||
func (*Timestamp) ProtoMessage() {}
|
||||
func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{22} }
|
||||
|
||||
func (m *TypeMeta) Reset() { *m = TypeMeta{} }
|
||||
func (*TypeMeta) ProtoMessage() {}
|
||||
func (*TypeMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{23} }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*APIGroup)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIGroup")
|
||||
|
|
@ -1278,6 +1298,220 @@ func sovGenerated(x uint64) (n int) {
|
|||
func sozGenerated(x uint64) (n int) {
|
||||
return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (this *APIGroup) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&APIGroup{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Versions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Versions), "GroupVersionForDiscovery", "GroupVersionForDiscovery", 1), `&`, ``, 1) + `,`,
|
||||
`PreferredVersion:` + strings.Replace(strings.Replace(this.PreferredVersion.String(), "GroupVersionForDiscovery", "GroupVersionForDiscovery", 1), `&`, ``, 1) + `,`,
|
||||
`ServerAddressByClientCIDRs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ServerAddressByClientCIDRs), "ServerAddressByClientCIDR", "ServerAddressByClientCIDR", 1), `&`, ``, 1) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *APIGroupList) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&APIGroupList{`,
|
||||
`Groups:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Groups), "APIGroup", "APIGroup", 1), `&`, ``, 1) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *APIResource) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&APIResource{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Namespaced:` + fmt.Sprintf("%v", this.Namespaced) + `,`,
|
||||
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *APIResourceList) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&APIResourceList{`,
|
||||
`GroupVersion:` + fmt.Sprintf("%v", this.GroupVersion) + `,`,
|
||||
`APIResources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.APIResources), "APIResource", "APIResource", 1), `&`, ``, 1) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *Duration) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&Duration{`,
|
||||
`Duration:` + fmt.Sprintf("%v", this.Duration) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *ExportOptions) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&ExportOptions{`,
|
||||
`Export:` + fmt.Sprintf("%v", this.Export) + `,`,
|
||||
`Exact:` + fmt.Sprintf("%v", this.Exact) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *GroupVersionForDiscovery) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&GroupVersionForDiscovery{`,
|
||||
`GroupVersion:` + fmt.Sprintf("%v", this.GroupVersion) + `,`,
|
||||
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *LabelSelector) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
keysForMatchLabels := make([]string, 0, len(this.MatchLabels))
|
||||
for k := range this.MatchLabels {
|
||||
keysForMatchLabels = append(keysForMatchLabels, k)
|
||||
}
|
||||
github_com_gogo_protobuf_sortkeys.Strings(keysForMatchLabels)
|
||||
mapStringForMatchLabels := "map[string]string{"
|
||||
for _, k := range keysForMatchLabels {
|
||||
mapStringForMatchLabels += fmt.Sprintf("%v: %v,", k, this.MatchLabels[k])
|
||||
}
|
||||
mapStringForMatchLabels += "}"
|
||||
s := strings.Join([]string{`&LabelSelector{`,
|
||||
`MatchLabels:` + mapStringForMatchLabels + `,`,
|
||||
`MatchExpressions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.MatchExpressions), "LabelSelectorRequirement", "LabelSelectorRequirement", 1), `&`, ``, 1) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *LabelSelectorRequirement) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&LabelSelectorRequirement{`,
|
||||
`Key:` + fmt.Sprintf("%v", this.Key) + `,`,
|
||||
`Operator:` + fmt.Sprintf("%v", this.Operator) + `,`,
|
||||
`Values:` + fmt.Sprintf("%v", this.Values) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *ListMeta) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&ListMeta{`,
|
||||
`SelfLink:` + fmt.Sprintf("%v", this.SelfLink) + `,`,
|
||||
`ResourceVersion:` + fmt.Sprintf("%v", this.ResourceVersion) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *RootPaths) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&RootPaths{`,
|
||||
`Paths:` + fmt.Sprintf("%v", this.Paths) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *ServerAddressByClientCIDR) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&ServerAddressByClientCIDR{`,
|
||||
`ClientCIDR:` + fmt.Sprintf("%v", this.ClientCIDR) + `,`,
|
||||
`ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *Status) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&Status{`,
|
||||
`ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "ListMeta", 1), `&`, ``, 1) + `,`,
|
||||
`Status:` + fmt.Sprintf("%v", this.Status) + `,`,
|
||||
`Message:` + fmt.Sprintf("%v", this.Message) + `,`,
|
||||
`Reason:` + fmt.Sprintf("%v", this.Reason) + `,`,
|
||||
`Details:` + strings.Replace(fmt.Sprintf("%v", this.Details), "StatusDetails", "StatusDetails", 1) + `,`,
|
||||
`Code:` + fmt.Sprintf("%v", this.Code) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *StatusCause) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&StatusCause{`,
|
||||
`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
|
||||
`Message:` + fmt.Sprintf("%v", this.Message) + `,`,
|
||||
`Field:` + fmt.Sprintf("%v", this.Field) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *StatusDetails) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&StatusDetails{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Group:` + fmt.Sprintf("%v", this.Group) + `,`,
|
||||
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
||||
`Causes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Causes), "StatusCause", "StatusCause", 1), `&`, ``, 1) + `,`,
|
||||
`RetryAfterSeconds:` + fmt.Sprintf("%v", this.RetryAfterSeconds) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *Timestamp) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&Timestamp{`,
|
||||
`Seconds:` + fmt.Sprintf("%v", this.Seconds) + `,`,
|
||||
`Nanos:` + fmt.Sprintf("%v", this.Nanos) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *TypeMeta) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&TypeMeta{`,
|
||||
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
||||
`APIVersion:` + fmt.Sprintf("%v", this.APIVersion) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func valueToStringGenerated(v interface{}) string {
|
||||
rv := reflect.ValueOf(v)
|
||||
if rv.IsNil() {
|
||||
return "nil"
|
||||
}
|
||||
pv := reflect.Indirect(rv).Interface()
|
||||
return fmt.Sprintf("*%v", pv)
|
||||
}
|
||||
func (m *APIGroup) Unmarshal(data []byte) error {
|
||||
l := len(data)
|
||||
iNdEx := 0
|
||||
|
|
@ -4210,3 +4444,93 @@ var (
|
|||
ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
var fileDescriptorGenerated = []byte{
|
||||
// 1376 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6f, 0x1b, 0x45,
|
||||
0x14, 0xf7, 0x47, 0xec, 0xae, 0x9f, 0x63, 0x92, 0x0e, 0xa9, 0x70, 0x2d, 0x11, 0x87, 0x45, 0xa0,
|
||||
0x54, 0x6a, 0x6d, 0x35, 0x02, 0x54, 0x15, 0xf1, 0x11, 0x27, 0x69, 0x15, 0x35, 0x49, 0xa3, 0x49,
|
||||
0x15, 0xa4, 0x16, 0x24, 0x36, 0xde, 0xb1, 0xb3, 0xb2, 0xbd, 0xbb, 0xec, 0xec, 0x56, 0x8d, 0x40,
|
||||
0xa2, 0x17, 0x24, 0x0e, 0x08, 0xe5, 0xc8, 0x05, 0xd4, 0x4a, 0xfc, 0x07, 0xfc, 0x13, 0x11, 0xa7,
|
||||
0x5e, 0x90, 0x38, 0xa0, 0x08, 0xca, 0x85, 0x2b, 0x57, 0x4e, 0xcc, 0xcc, 0xce, 0xec, 0x87, 0x53,
|
||||
0x93, 0x0d, 0xf4, 0xc0, 0x61, 0x15, 0xcf, 0xfb, 0x9e, 0xf7, 0x7e, 0xf3, 0xde, 0x0b, 0xbc, 0x39,
|
||||
0xb8, 0x46, 0x5b, 0x96, 0xd3, 0x1e, 0x04, 0x7b, 0xc4, 0xb3, 0x89, 0x4f, 0x68, 0xdb, 0x1d, 0xf4,
|
||||
0xdb, 0x86, 0x6b, 0xb5, 0x03, 0xfb, 0x3e, 0xf1, 0xa8, 0xe5, 0xd8, 0xc4, 0x6c, 0xf7, 0x89, 0x4d,
|
||||
0x3c, 0xc3, 0x27, 0x66, 0xcb, 0xf5, 0x1c, 0xdf, 0x41, 0xaf, 0x85, 0x6a, 0xad, 0x58, 0xad, 0xc5,
|
||||
0xd4, 0x5a, 0x4c, 0xad, 0x95, 0x50, 0x6b, 0x5c, 0xe9, 0x5b, 0xfe, 0x7e, 0xb0, 0xd7, 0xea, 0x3a,
|
||||
0xa3, 0x76, 0xdf, 0xe9, 0x3b, 0x6d, 0xa1, 0xbd, 0x17, 0xf4, 0xc4, 0x49, 0x1c, 0xc4, 0xaf, 0xd0,
|
||||
0x6a, 0xe3, 0xca, 0xb3, 0x83, 0xf1, 0x02, 0xdb, 0xb7, 0x46, 0x64, 0x3c, 0x88, 0xc6, 0xd5, 0x67,
|
||||
0x8b, 0x07, 0xbe, 0x35, 0x6c, 0x5b, 0xb6, 0x4f, 0x7d, 0x6f, 0x5c, 0x45, 0xff, 0xb1, 0x08, 0xda,
|
||||
0xf2, 0xf6, 0xfa, 0x4d, 0xcf, 0x09, 0x5c, 0xb4, 0x00, 0x53, 0xb6, 0x31, 0x22, 0xf5, 0xfc, 0x42,
|
||||
0x7e, 0xb1, 0xd2, 0x99, 0x3e, 0x3a, 0x6e, 0xe6, 0x9e, 0x1e, 0x37, 0xa7, 0xb6, 0x18, 0x0d, 0x0b,
|
||||
0x0e, 0x1a, 0x81, 0x26, 0x2f, 0x43, 0xeb, 0x85, 0x85, 0xe2, 0x62, 0x75, 0xe9, 0xbd, 0x56, 0xa6,
|
||||
0x9b, 0xb7, 0x84, 0x87, 0xdd, 0xf0, 0x78, 0xc3, 0xf1, 0x56, 0x2d, 0xda, 0x75, 0x18, 0xf7, 0xa0,
|
||||
0x33, 0x2b, 0xdd, 0x68, 0x92, 0x49, 0x71, 0xe4, 0x02, 0x7d, 0x91, 0x87, 0x59, 0xd7, 0x23, 0x3d,
|
||||
0xe2, 0x79, 0xc4, 0x94, 0xfc, 0x7a, 0x91, 0x45, 0xf7, 0x1c, 0xfc, 0xd6, 0xa5, 0xdf, 0xd9, 0xed,
|
||||
0x31, 0x07, 0xf8, 0x84, 0x4b, 0xf4, 0x7d, 0x1e, 0x1a, 0x94, 0x78, 0x4c, 0x6f, 0xd9, 0x34, 0x3d,
|
||||
0x42, 0x69, 0xe7, 0x60, 0x65, 0x68, 0x11, 0xdb, 0x5f, 0x59, 0x5f, 0xc5, 0xb4, 0x3e, 0x25, 0x32,
|
||||
0xf1, 0x7e, 0xc6, 0x88, 0x76, 0x26, 0x19, 0xea, 0xe8, 0x32, 0xa4, 0xc6, 0x44, 0x11, 0x8a, 0xff,
|
||||
0x21, 0x0e, 0xbd, 0x0f, 0xd3, 0xaa, 0x96, 0x1b, 0x16, 0xf5, 0xd1, 0x07, 0x50, 0xee, 0xf3, 0x03,
|
||||
0x65, 0x15, 0xe5, 0x11, 0xb6, 0x33, 0x46, 0xa8, 0x8c, 0x74, 0x5e, 0x90, 0x01, 0x95, 0xc5, 0x91,
|
||||
0x62, 0x69, 0x4e, 0x67, 0x75, 0xa9, 0x32, 0x21, 0x4c, 0xa8, 0x13, 0x78, 0x5d, 0x92, 0x01, 0x38,
|
||||
0x4b, 0x00, 0xfc, 0x2f, 0x75, 0x8d, 0x2e, 0x31, 0x19, 0x74, 0xf2, 0x8b, 0x5a, 0x07, 0x49, 0x39,
|
||||
0xd8, 0x8a, 0x38, 0x38, 0x21, 0xc5, 0xad, 0x0e, 0x2c, 0xdb, 0x14, 0x05, 0x4f, 0x58, 0xbd, 0xc5,
|
||||
0x68, 0x58, 0x70, 0xf4, 0x1f, 0xf2, 0x30, 0x93, 0x88, 0x43, 0x5c, 0xfa, 0x1a, 0x4c, 0xf7, 0x13,
|
||||
0x35, 0x97, 0x31, 0xcd, 0x49, 0xed, 0xe9, 0x24, 0x1e, 0x70, 0x4a, 0x12, 0xf5, 0xa0, 0xe2, 0x49,
|
||||
0x4b, 0x0a, 0xdd, 0x4b, 0xd9, 0x33, 0xa6, 0x82, 0x88, 0x5d, 0x25, 0x88, 0x14, 0xc7, 0xa6, 0xf5,
|
||||
0x3f, 0xc2, 0xec, 0x29, 0xbc, 0xa3, 0xc5, 0xc4, 0xa3, 0xe2, 0x85, 0x62, 0x77, 0x9d, 0xf0, 0x1e,
|
||||
0x4e, 0xc1, 0x61, 0xe1, 0xff, 0x81, 0xc3, 0xeb, 0xda, 0x37, 0x8f, 0x9a, 0xb9, 0x87, 0xbf, 0x2c,
|
||||
0xe4, 0xf4, 0x75, 0xd0, 0x56, 0x03, 0xd6, 0x6f, 0x78, 0x7a, 0xdf, 0x01, 0xcd, 0x94, 0xbf, 0x45,
|
||||
0x51, 0x8a, 0x9d, 0x57, 0xd4, 0xd3, 0x57, 0x32, 0x7f, 0x1d, 0x37, 0x6b, 0xbc, 0xb3, 0xb5, 0x14,
|
||||
0x01, 0x47, 0x2a, 0xfa, 0x87, 0x50, 0x5b, 0x7b, 0xe0, 0x3a, 0x9e, 0x7f, 0xdb, 0xf5, 0x45, 0x32,
|
||||
0x5e, 0x87, 0x32, 0x11, 0x04, 0x61, 0x4d, 0x8b, 0xc1, 0x1a, 0x8a, 0x61, 0xc9, 0x45, 0xaf, 0x42,
|
||||
0x89, 0x3c, 0x30, 0xba, 0xbe, 0x44, 0x5d, 0x4d, 0x8a, 0x95, 0xd6, 0x38, 0x11, 0x87, 0x3c, 0x66,
|
||||
0xbd, 0x22, 0x90, 0xc1, 0xc1, 0xc5, 0x35, 0x04, 0x30, 0x24, 0x76, 0x22, 0x0d, 0x21, 0x81, 0x43,
|
||||
0x5e, 0x84, 0xce, 0xc2, 0x24, 0x74, 0x26, 0xd2, 0x30, 0x84, 0x5a, 0xa8, 0xab, 0x1e, 0x4c, 0x26,
|
||||
0x0f, 0x97, 0x41, 0x53, 0xa0, 0x91, 0x5e, 0xa2, 0x5e, 0xa9, 0x0c, 0xe1, 0x48, 0x22, 0xe1, 0x6d,
|
||||
0x1f, 0x52, 0x28, 0xcf, 0xe6, 0xec, 0x12, 0x9c, 0x93, 0xd0, 0x90, 0xbe, 0x66, 0xa4, 0xd8, 0x39,
|
||||
0xf5, 0x58, 0x14, 0x3f, 0xe1, 0xe9, 0x73, 0xa8, 0x4f, 0xea, 0xaf, 0xff, 0xe1, 0x1d, 0x66, 0x0f,
|
||||
0x45, 0xff, 0x9a, 0x0d, 0x88, 0xa4, 0xa5, 0xec, 0xe5, 0xcb, 0xee, 0xe4, 0xf4, 0x3e, 0x94, 0xc8,
|
||||
0xc8, 0x77, 0x79, 0x98, 0x4b, 0x5d, 0xed, 0x4c, 0x15, 0x3f, 0x43, 0x50, 0x49, 0x70, 0x14, 0xcf,
|
||||
0x00, 0x8e, 0x9f, 0x0a, 0x50, 0xdb, 0x30, 0xf6, 0xc8, 0x70, 0x87, 0x0c, 0x49, 0xd7, 0x77, 0x3c,
|
||||
0xf4, 0x19, 0x54, 0x47, 0x86, 0xdf, 0xdd, 0x17, 0x54, 0x35, 0x2a, 0xd6, 0x32, 0x36, 0x91, 0x94,
|
||||
0xa9, 0xd6, 0x66, 0x6c, 0x67, 0xcd, 0xf6, 0xd9, 0x90, 0x7d, 0x51, 0xc6, 0x54, 0x4d, 0x70, 0x70,
|
||||
0xd2, 0x9d, 0x18, 0xf1, 0xe2, 0xcc, 0x5e, 0x2d, 0xef, 0x24, 0xff, 0x62, 0xb5, 0x48, 0xc5, 0x80,
|
||||
0xc9, 0x27, 0x81, 0xe5, 0x91, 0x11, 0x6b, 0x46, 0xf1, 0x88, 0xdf, 0x1c, 0x73, 0x80, 0x4f, 0xb8,
|
||||
0x6c, 0xbc, 0x0b, 0xb3, 0xe3, 0xd1, 0xa3, 0x59, 0x28, 0x0e, 0xc8, 0x41, 0x58, 0x31, 0xcc, 0x7f,
|
||||
0xa2, 0x39, 0x28, 0xdd, 0x37, 0x86, 0x81, 0x7c, 0x8f, 0x38, 0x3c, 0x5c, 0x2f, 0x5c, 0xcb, 0xeb,
|
||||
0xac, 0x35, 0xd7, 0x27, 0x05, 0x82, 0x5e, 0x4e, 0x18, 0xea, 0x54, 0x65, 0x54, 0xc5, 0x5b, 0xe4,
|
||||
0x20, 0xb4, 0xba, 0x06, 0x9a, 0xe3, 0xf2, 0xb5, 0xcc, 0xf1, 0x64, 0xdd, 0x2f, 0xa9, 0x5a, 0xde,
|
||||
0x96, 0x74, 0xd6, 0x19, 0x2f, 0xa4, 0xcc, 0x2b, 0x06, 0x8e, 0x54, 0x91, 0x0e, 0x65, 0x11, 0x0f,
|
||||
0x65, 0x80, 0xe0, 0x53, 0x04, 0x78, 0x33, 0xdc, 0x15, 0x14, 0x2c, 0x39, 0xfa, 0xa7, 0xa0, 0xf1,
|
||||
0x29, 0xb9, 0x49, 0x7c, 0x83, 0x43, 0x88, 0x92, 0x61, 0x6f, 0xc3, 0xb2, 0x07, 0x32, 0xb4, 0x08,
|
||||
0x42, 0x3b, 0x92, 0x8e, 0x23, 0x09, 0xb4, 0x0c, 0x33, 0x0a, 0x4e, 0xbb, 0x29, 0x8c, 0xbe, 0x24,
|
||||
0x95, 0x66, 0x70, 0x9a, 0x8d, 0xc7, 0xe5, 0xf5, 0xcb, 0x50, 0xc1, 0x8e, 0xe3, 0x6f, 0x1b, 0xfe,
|
||||
0x3e, 0x45, 0x4d, 0x28, 0xb9, 0xfc, 0x87, 0x1c, 0x79, 0x15, 0xfe, 0x18, 0x04, 0x07, 0x87, 0x74,
|
||||
0xfd, 0xab, 0x3c, 0x5c, 0x9c, 0x38, 0x80, 0xf8, 0x42, 0xd1, 0x8d, 0x4e, 0x32, 0xfc, 0x68, 0xa1,
|
||||
0x88, 0xe5, 0x70, 0x42, 0x0a, 0xbd, 0x0d, 0xb5, 0xd4, 0xd4, 0x92, 0x17, 0xb8, 0x20, 0xd5, 0x6a,
|
||||
0x29, 0x6f, 0x38, 0x2d, 0xab, 0xff, 0x59, 0x80, 0xf2, 0x8e, 0x6f, 0xf8, 0x01, 0x45, 0x1f, 0x81,
|
||||
0x36, 0x62, 0x09, 0x34, 0x0d, 0xdf, 0x10, 0x9e, 0xb3, 0x6f, 0x56, 0x2a, 0xf7, 0x71, 0xa6, 0x15,
|
||||
0x05, 0x47, 0x26, 0xf9, 0x60, 0xa3, 0xc2, 0x91, 0x8c, 0x2f, 0x1a, 0x6c, 0xa1, 0x7b, 0x2c, 0xb9,
|
||||
0xbc, 0x5b, 0xb0, 0x5d, 0x89, 0x1a, 0x7d, 0xd5, 0x01, 0xa2, 0x6e, 0xb1, 0x19, 0x92, 0xb1, 0xe2,
|
||||
0xa3, 0xb7, 0xa0, 0xec, 0x11, 0x83, 0xb2, 0x9a, 0x4d, 0x09, 0xc9, 0x79, 0x65, 0x12, 0x0b, 0x2a,
|
||||
0x43, 0xd7, 0xb4, 0x34, 0x2e, 0xce, 0x58, 0x4a, 0xa3, 0x7b, 0x70, 0xce, 0x64, 0x61, 0x59, 0xac,
|
||||
0x2f, 0x94, 0xc4, 0x45, 0xdf, 0xc8, 0xba, 0x5c, 0x08, 0x6b, 0xab, 0xa1, 0x6e, 0xa7, 0xca, 0x83,
|
||||
0x92, 0x07, 0xac, 0x2c, 0xf2, 0xbe, 0xda, 0x75, 0x4c, 0x52, 0x2f, 0x33, 0xcb, 0xa5, 0xb8, 0xaf,
|
||||
0xae, 0x30, 0x1a, 0x16, 0x1c, 0xfd, 0x90, 0x6d, 0x4a, 0xa1, 0xa5, 0x15, 0x23, 0xa0, 0x04, 0x5d,
|
||||
0x8d, 0xae, 0x11, 0x16, 0xfc, 0xa2, 0xd2, 0xb9, 0x73, 0xe0, 0x12, 0x76, 0x89, 0x8a, 0x10, 0xe3,
|
||||
0x87, 0xe8, 0x06, 0x89, 0x24, 0x15, 0x4e, 0x49, 0x12, 0x6b, 0xd1, 0x3d, 0x8b, 0x0c, 0x55, 0xa3,
|
||||
0x8f, 0x5a, 0xf4, 0x0d, 0x4e, 0xc4, 0x21, 0x4f, 0xff, 0x96, 0xf5, 0xcf, 0xd4, 0xe5, 0x32, 0x2c,
|
||||
0xbf, 0x51, 0xef, 0x2f, 0x64, 0xd8, 0x27, 0x26, 0x4e, 0x19, 0x74, 0x17, 0xca, 0x5d, 0x7e, 0x3f,
|
||||
0xf5, 0x0f, 0xc7, 0xd2, 0x99, 0x6a, 0x21, 0x52, 0x13, 0x63, 0x49, 0x1c, 0x19, 0x96, 0x42, 0x8b,
|
||||
0xe8, 0x26, 0x9c, 0xf7, 0x08, 0xeb, 0x79, 0xcb, 0x3d, 0x9f, 0x78, 0x3b, 0xa4, 0xeb, 0xd8, 0x66,
|
||||
0x58, 0xf2, 0x52, 0x94, 0xe4, 0xf3, 0x78, 0x5c, 0x00, 0x9f, 0xd4, 0x61, 0xab, 0xce, 0xd4, 0x1d,
|
||||
0xb6, 0xc1, 0xf1, 0xbc, 0x53, 0x69, 0x26, 0x5c, 0xf6, 0xa2, 0xbc, 0x2b, 0x65, 0xc5, 0xe7, 0xe9,
|
||||
0xb1, 0x0d, 0xdb, 0x09, 0xe1, 0x5e, 0x8a, 0xd3, 0xb3, 0xc5, 0x89, 0x38, 0xe4, 0x5d, 0x9f, 0xe3,
|
||||
0x13, 0xec, 0xcb, 0xc7, 0xcd, 0xdc, 0x21, 0xfb, 0x1e, 0x3d, 0x96, 0xd3, 0xec, 0x1e, 0x54, 0xb8,
|
||||
0x37, 0xf6, 0x20, 0x46, 0xee, 0xf3, 0x76, 0xa9, 0x7f, 0x0c, 0x1a, 0x87, 0x92, 0xe8, 0x95, 0xaa,
|
||||
0x3a, 0xf9, 0x89, 0xd5, 0x61, 0x0d, 0x89, 0x25, 0x3e, 0xdd, 0x1a, 0xa3, 0x86, 0x14, 0xaf, 0xfb,
|
||||
0x38, 0x21, 0xd5, 0xb9, 0x72, 0xf4, 0xdb, 0x7c, 0xee, 0x09, 0xfb, 0x7e, 0x66, 0xdf, 0xc3, 0xa7,
|
||||
0xf3, 0xf9, 0x23, 0xf6, 0x3d, 0x61, 0xdf, 0xaf, 0xec, 0x3b, 0xfc, 0x7d, 0x3e, 0x77, 0xb7, 0x9a,
|
||||
0x28, 0xe4, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x22, 0x00, 0xde, 0x9c, 0x10, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
|||
3
vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.proto
generated
vendored
3
vendor/k8s.io/kubernetes/pkg/api/unversioned/generated.proto
generated
vendored
|
|
@ -144,7 +144,7 @@ message GroupVersion {
|
|||
}
|
||||
|
||||
// GroupVersion contains the "group/version" and "version" string of a version.
|
||||
// It is made a struct to keep extensiblity.
|
||||
// It is made a struct to keep extensibility.
|
||||
message GroupVersionForDiscovery {
|
||||
// groupVersion specifies the API group and version in the form "group/version"
|
||||
optional string groupVersion = 1;
|
||||
|
|
@ -328,6 +328,7 @@ message StatusDetails {
|
|||
//
|
||||
// +protobuf.options.marshal=false
|
||||
// +protobuf.as=Timestamp
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
message Time {
|
||||
// Represents seconds of UTC time since Unix epoch
|
||||
// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
|
||||
|
|
|
|||
54
vendor/k8s.io/kubernetes/pkg/api/unversioned/group_version.go
generated
vendored
54
vendor/k8s.io/kubernetes/pkg/api/unversioned/group_version.go
generated
vendored
|
|
@ -50,7 +50,7 @@ func (gr GroupResource) WithVersion(version string) GroupVersionResource {
|
|||
return GroupVersionResource{Group: gr.Group, Version: version, Resource: gr.Resource}
|
||||
}
|
||||
|
||||
func (gr GroupResource) IsEmpty() bool {
|
||||
func (gr GroupResource) Empty() bool {
|
||||
return len(gr.Group) == 0 && len(gr.Resource) == 0
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ type GroupVersionResource struct {
|
|||
Resource string `protobuf:"bytes,3,opt,name=resource"`
|
||||
}
|
||||
|
||||
func (gvr GroupVersionResource) IsEmpty() bool {
|
||||
func (gvr GroupVersionResource) Empty() bool {
|
||||
return len(gvr.Group) == 0 && len(gvr.Version) == 0 && len(gvr.Resource) == 0
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ type GroupKind struct {
|
|||
Kind string `protobuf:"bytes,2,opt,name=kind"`
|
||||
}
|
||||
|
||||
func (gk GroupKind) IsEmpty() bool {
|
||||
func (gk GroupKind) Empty() bool {
|
||||
return len(gk.Group) == 0 && len(gk.Kind) == 0
|
||||
}
|
||||
|
||||
|
|
@ -131,8 +131,8 @@ type GroupVersionKind struct {
|
|||
Kind string `protobuf:"bytes,3,opt,name=kind"`
|
||||
}
|
||||
|
||||
// IsEmpty returns true if group, version, and kind are empty
|
||||
func (gvk GroupVersionKind) IsEmpty() bool {
|
||||
// Empty returns true if group, version, and kind are empty
|
||||
func (gvk GroupVersionKind) Empty() bool {
|
||||
return len(gvk.Group) == 0 && len(gvk.Version) == 0 && len(gvk.Kind) == 0
|
||||
}
|
||||
|
||||
|
|
@ -156,8 +156,8 @@ type GroupVersion struct {
|
|||
Version string `protobuf:"bytes,2,opt,name=version"`
|
||||
}
|
||||
|
||||
// IsEmpty returns true if group and version are empty
|
||||
func (gv GroupVersion) IsEmpty() bool {
|
||||
// Empty returns true if group and version are empty
|
||||
func (gv GroupVersion) Empty() bool {
|
||||
return len(gv.Group) == 0 && len(gv.Version) == 0
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ func (gv GroupVersion) IsEmpty() bool {
|
|||
// it returns "v1".
|
||||
func (gv GroupVersion) String() string {
|
||||
// special case the internal apiVersion for the legacy kube types
|
||||
if gv.IsEmpty() {
|
||||
if gv.Empty() {
|
||||
return ""
|
||||
}
|
||||
|
||||
|
|
@ -179,6 +179,25 @@ func (gv GroupVersion) String() string {
|
|||
return gv.Version
|
||||
}
|
||||
|
||||
// KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false
|
||||
// if none of the options match the group. It prefers a match to group and version over just group.
|
||||
// TODO: Move GroupVersion to a package under pkg/runtime, since it's used by scheme.
|
||||
// TODO: Introduce an adapter type between GroupVersion and runtime.GroupVersioner, and use LegacyCodec(GroupVersion)
|
||||
// in fewer places.
|
||||
func (gv GroupVersion) KindForGroupVersionKinds(kinds []GroupVersionKind) (target GroupVersionKind, ok bool) {
|
||||
for _, gvk := range kinds {
|
||||
if gvk.Group == gv.Group && gvk.Version == gv.Version {
|
||||
return gvk, true
|
||||
}
|
||||
}
|
||||
for _, gvk := range kinds {
|
||||
if gvk.Group == gv.Group {
|
||||
return gv.WithKind(gvk.Kind), true
|
||||
}
|
||||
}
|
||||
return GroupVersionKind{}, false
|
||||
}
|
||||
|
||||
// ParseGroupVersion turns "group/version" string into a GroupVersion struct. It reports error
|
||||
// if it cannot parse the string.
|
||||
func ParseGroupVersion(gv string) (GroupVersion, error) {
|
||||
|
|
@ -241,6 +260,25 @@ func (gv *GroupVersion) UnmarshalText(value []byte) error {
|
|||
return gv.unmarshal(value)
|
||||
}
|
||||
|
||||
// GroupVersions can be used to represent a set of desired group versions.
|
||||
// TODO: Move GroupVersions to a package under pkg/runtime, since it's used by scheme.
|
||||
// TODO: Introduce an adapter type between GroupVersions and runtime.GroupVersioner, and use LegacyCodec(GroupVersion)
|
||||
// in fewer places.
|
||||
type GroupVersions []GroupVersion
|
||||
|
||||
// KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false
|
||||
// if none of the options match the group.
|
||||
func (gvs GroupVersions) KindForGroupVersionKinds(kinds []GroupVersionKind) (target GroupVersionKind, ok bool) {
|
||||
for _, gv := range gvs {
|
||||
target, ok := gv.KindForGroupVersionKinds(kinds)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
return target, true
|
||||
}
|
||||
return GroupVersionKind{}, false
|
||||
}
|
||||
|
||||
// ToAPIVersionAndKind is a convenience method for satisfying runtime.Object on types that
|
||||
// do not use TypeMeta.
|
||||
func (gvk *GroupVersionKind) ToAPIVersionAndKind() (string, string) {
|
||||
|
|
|
|||
54
vendor/k8s.io/kubernetes/pkg/api/unversioned/helpers.go
generated
vendored
54
vendor/k8s.io/kubernetes/pkg/api/unversioned/helpers.go
generated
vendored
|
|
@ -20,6 +20,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/selection"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
|
||||
|
|
@ -35,23 +36,23 @@ func LabelSelectorAsSelector(ps *LabelSelector) (labels.Selector, error) {
|
|||
}
|
||||
selector := labels.NewSelector()
|
||||
for k, v := range ps.MatchLabels {
|
||||
r, err := labels.NewRequirement(k, labels.EqualsOperator, sets.NewString(v))
|
||||
r, err := labels.NewRequirement(k, selection.Equals, sets.NewString(v))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
selector = selector.Add(*r)
|
||||
}
|
||||
for _, expr := range ps.MatchExpressions {
|
||||
var op labels.Operator
|
||||
var op selection.Operator
|
||||
switch expr.Operator {
|
||||
case LabelSelectorOpIn:
|
||||
op = labels.InOperator
|
||||
op = selection.In
|
||||
case LabelSelectorOpNotIn:
|
||||
op = labels.NotInOperator
|
||||
op = selection.NotIn
|
||||
case LabelSelectorOpExists:
|
||||
op = labels.ExistsOperator
|
||||
op = selection.Exists
|
||||
case LabelSelectorOpDoesNotExist:
|
||||
op = labels.DoesNotExistOperator
|
||||
op = selection.DoesNotExist
|
||||
default:
|
||||
return nil, fmt.Errorf("%q is not a valid pod selector operator", expr.Operator)
|
||||
}
|
||||
|
|
@ -64,6 +65,35 @@ func LabelSelectorAsSelector(ps *LabelSelector) (labels.Selector, error) {
|
|||
return selector, nil
|
||||
}
|
||||
|
||||
// LabelSelectorAsMap converts the LabelSelector api type into a map of strings, ie. the
|
||||
// original structure of a label selector. Operators that cannot be converted into plain
|
||||
// labels (Exists, DoesNotExist, NotIn, and In with more than one value) will result in
|
||||
// an error.
|
||||
func LabelSelectorAsMap(ps *LabelSelector) (map[string]string, error) {
|
||||
if ps == nil {
|
||||
return nil, nil
|
||||
}
|
||||
selector := map[string]string{}
|
||||
for k, v := range ps.MatchLabels {
|
||||
selector[k] = v
|
||||
}
|
||||
for _, expr := range ps.MatchExpressions {
|
||||
switch expr.Operator {
|
||||
case LabelSelectorOpIn:
|
||||
if len(expr.Values) != 1 {
|
||||
return selector, fmt.Errorf("operator %q without a single value cannot be converted into the old label selector format", expr.Operator)
|
||||
}
|
||||
// Should we do anything in case this will override a previous key-value pair?
|
||||
selector[expr.Key] = expr.Values[0]
|
||||
case LabelSelectorOpNotIn, LabelSelectorOpExists, LabelSelectorOpDoesNotExist:
|
||||
return selector, fmt.Errorf("operator %q cannot be converted into the old label selector format", expr.Operator)
|
||||
default:
|
||||
return selector, fmt.Errorf("%q is not a valid selector operator", expr.Operator)
|
||||
}
|
||||
}
|
||||
return selector, nil
|
||||
}
|
||||
|
||||
// ParseToLabelSelector parses a string representing a selector into a LabelSelector object.
|
||||
// Note: This function should be kept in sync with the parser in pkg/labels/selector.go
|
||||
func ParseToLabelSelector(selector string) (*LabelSelector, error) {
|
||||
|
|
@ -79,7 +109,7 @@ func ParseToLabelSelector(selector string) (*LabelSelector, error) {
|
|||
for _, req := range reqs {
|
||||
var op LabelSelectorOperator
|
||||
switch req.Operator() {
|
||||
case labels.EqualsOperator, labels.DoubleEqualsOperator:
|
||||
case selection.Equals, selection.DoubleEquals:
|
||||
vals := req.Values()
|
||||
if vals.Len() != 1 {
|
||||
return nil, fmt.Errorf("equals operator must have exactly one value")
|
||||
|
|
@ -90,15 +120,15 @@ func ParseToLabelSelector(selector string) (*LabelSelector, error) {
|
|||
}
|
||||
labelSelector.MatchLabels[req.Key()] = val
|
||||
continue
|
||||
case labels.InOperator:
|
||||
case selection.In:
|
||||
op = LabelSelectorOpIn
|
||||
case labels.NotInOperator:
|
||||
case selection.NotIn:
|
||||
op = LabelSelectorOpNotIn
|
||||
case labels.ExistsOperator:
|
||||
case selection.Exists:
|
||||
op = LabelSelectorOpExists
|
||||
case labels.DoesNotExistOperator:
|
||||
case selection.DoesNotExist:
|
||||
op = LabelSelectorOpDoesNotExist
|
||||
case labels.GreaterThanOperator, labels.LessThanOperator:
|
||||
case selection.GreaterThan, selection.LessThan:
|
||||
// Adding a separate case for these operators to indicate that this is deliberate
|
||||
return nil, fmt.Errorf("%q isn't supported in label selectors", req.Operator())
|
||||
default:
|
||||
|
|
|
|||
6
vendor/k8s.io/kubernetes/pkg/api/unversioned/time.go
generated
vendored
6
vendor/k8s.io/kubernetes/pkg/api/unversioned/time.go
generated
vendored
|
|
@ -29,6 +29,7 @@ import (
|
|||
//
|
||||
// +protobuf.options.marshal=false
|
||||
// +protobuf.as=Timestamp
|
||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||
type Time struct {
|
||||
time.Time `protobuf:"-"`
|
||||
}
|
||||
|
|
@ -40,6 +41,11 @@ func (t Time) DeepCopy() Time {
|
|||
return t
|
||||
}
|
||||
|
||||
// String returns the representation of the time.
|
||||
func (t Time) String() string {
|
||||
return t.Time.String()
|
||||
}
|
||||
|
||||
// NewTime returns a wrapped instance of the provided time
|
||||
func NewTime(time time.Time) Time {
|
||||
return Time{time}
|
||||
|
|
|
|||
2
vendor/k8s.io/kubernetes/pkg/api/unversioned/types.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/api/unversioned/types.go
generated
vendored
|
|
@ -357,7 +357,7 @@ type ServerAddressByClientCIDR struct {
|
|||
}
|
||||
|
||||
// GroupVersion contains the "group/version" and "version" string of a version.
|
||||
// It is made a struct to keep extensiblity.
|
||||
// It is made a struct to keep extensibility.
|
||||
type GroupVersionForDiscovery struct {
|
||||
// groupVersion specifies the API group and version in the form "group/version"
|
||||
GroupVersion string `json:"groupVersion" protobuf:"bytes,1,opt,name=groupVersion"`
|
||||
|
|
|
|||
2
vendor/k8s.io/kubernetes/pkg/api/unversioned/types_swagger_doc_generated.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/api/unversioned/types_swagger_doc_generated.go
generated
vendored
|
|
@ -90,7 +90,7 @@ func (ExportOptions) SwaggerDoc() map[string]string {
|
|||
}
|
||||
|
||||
var map_GroupVersionForDiscovery = map[string]string{
|
||||
"": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensiblity.",
|
||||
"": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
|
||||
"groupVersion": "groupVersion specifies the API group and version in the form \"group/version\"",
|
||||
"version": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
|
||||
}
|
||||
|
|
|
|||
390
vendor/k8s.io/kubernetes/pkg/api/unversioned/zz_generated.deepcopy.go
generated
vendored
Normal file
390
vendor/k8s.io/kubernetes/pkg/api/unversioned/zz_generated.deepcopy.go
generated
vendored
Normal file
|
|
@ -0,0 +1,390 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
time "time"
|
||||
)
|
||||
|
||||
func DeepCopy_unversioned_APIGroup(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIGroup)
|
||||
out := out.(*APIGroup)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Name = in.Name
|
||||
if in.Versions != nil {
|
||||
in, out := &in.Versions, &out.Versions
|
||||
*out = make([]GroupVersionForDiscovery, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
out.PreferredVersion = in.PreferredVersion
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIGroupList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIGroupList)
|
||||
out := out.(*APIGroupList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]APIGroup, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_unversioned_APIGroup(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Groups = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResource(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIResource)
|
||||
out := out.(*APIResource)
|
||||
out.Name = in.Name
|
||||
out.Namespaced = in.Namespaced
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResourceList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIResourceList)
|
||||
out := out.(*APIResourceList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.GroupVersion = in.GroupVersion
|
||||
if in.APIResources != nil {
|
||||
in, out := &in.APIResources, &out.APIResources
|
||||
*out = make([]APIResource, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.APIResources = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIVersions(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIVersions)
|
||||
out := out.(*APIVersions)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Versions != nil {
|
||||
in, out := &in.Versions, &out.Versions
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Duration(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Duration)
|
||||
out := out.(*Duration)
|
||||
out.Duration = in.Duration
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ExportOptions(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ExportOptions)
|
||||
out := out.(*ExportOptions)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Export = in.Export
|
||||
out.Exact = in.Exact
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupKind(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupKind)
|
||||
out := out.(*GroupKind)
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupResource(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupResource)
|
||||
out := out.(*GroupResource)
|
||||
out.Group = in.Group
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersion(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersion)
|
||||
out := out.(*GroupVersion)
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionForDiscovery(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersionForDiscovery)
|
||||
out := out.(*GroupVersionForDiscovery)
|
||||
out.GroupVersion = in.GroupVersion
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionKind(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersionKind)
|
||||
out := out.(*GroupVersionKind)
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionResource(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersionResource)
|
||||
out := out.(*GroupVersionResource)
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*LabelSelector)
|
||||
out := out.(*LabelSelector)
|
||||
if in.MatchLabels != nil {
|
||||
in, out := &in.MatchLabels, &out.MatchLabels
|
||||
*out = make(map[string]string)
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.MatchLabels = nil
|
||||
}
|
||||
if in.MatchExpressions != nil {
|
||||
in, out := &in.MatchExpressions, &out.MatchExpressions
|
||||
*out = make([]LabelSelectorRequirement, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.MatchExpressions = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*LabelSelectorRequirement)
|
||||
out := out.(*LabelSelectorRequirement)
|
||||
out.Key = in.Key
|
||||
out.Operator = in.Operator
|
||||
if in.Values != nil {
|
||||
in, out := &in.Values, &out.Values
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Values = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ListMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ListMeta)
|
||||
out := out.(*ListMeta)
|
||||
out.SelfLink = in.SelfLink
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Patch(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Patch)
|
||||
out := out.(*Patch)
|
||||
_ = in
|
||||
_ = out
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_RootPaths(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RootPaths)
|
||||
out := out.(*RootPaths)
|
||||
if in.Paths != nil {
|
||||
in, out := &in.Paths, &out.Paths
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Paths = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ServerAddressByClientCIDR)
|
||||
out := out.(*ServerAddressByClientCIDR)
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Status(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Status)
|
||||
out := out.(*Status)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Status = in.Status
|
||||
out.Message = in.Message
|
||||
out.Reason = in.Reason
|
||||
if in.Details != nil {
|
||||
in, out := &in.Details, &out.Details
|
||||
*out = new(StatusDetails)
|
||||
if err := DeepCopy_unversioned_StatusDetails(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Details = nil
|
||||
}
|
||||
out.Code = in.Code
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_StatusCause(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*StatusCause)
|
||||
out := out.(*StatusCause)
|
||||
out.Type = in.Type
|
||||
out.Message = in.Message
|
||||
out.Field = in.Field
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_StatusDetails(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*StatusDetails)
|
||||
out := out.(*StatusDetails)
|
||||
out.Name = in.Name
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
if in.Causes != nil {
|
||||
in, out := &in.Causes, &out.Causes
|
||||
*out = make([]StatusCause, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.Causes = nil
|
||||
}
|
||||
out.RetryAfterSeconds = in.RetryAfterSeconds
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Time(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Time)
|
||||
out := out.(*Time)
|
||||
if newVal, err := c.DeepCopy(&in.Time); err != nil {
|
||||
return err
|
||||
} else {
|
||||
out.Time = *newVal.(*time.Time)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Timestamp(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Timestamp)
|
||||
out := out.(*Timestamp)
|
||||
out.Seconds = in.Seconds
|
||||
out.Nanos = in.Nanos
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*TypeMeta)
|
||||
out := out.(*TypeMeta)
|
||||
out.Kind = in.Kind
|
||||
out.APIVersion = in.APIVersion
|
||||
return nil
|
||||
}
|
||||
}
|
||||
424
vendor/k8s.io/kubernetes/pkg/api/v1/conversion.go
generated
vendored
424
vendor/k8s.io/kubernetes/pkg/api/v1/conversion.go
generated
vendored
|
|
@ -19,10 +19,14 @@ package v1
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||
"k8s.io/kubernetes/pkg/watch/versioned"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -31,9 +35,111 @@ const (
|
|||
|
||||
// Value used to identify mirror pods from pre-v1.1 kubelet.
|
||||
mirrorAnnotationValue_1_0 = "mirror"
|
||||
|
||||
// annotation key prefix used to identify non-convertible json paths.
|
||||
NonConvertibleAnnotationPrefix = "kubernetes.io/non-convertible"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) {
|
||||
// This is a "fast-path" that avoids reflection for common types. It focuses on the objects that are
|
||||
// converted the most in the cluster.
|
||||
// TODO: generate one of these for every external API group - this is to prove the impact
|
||||
func addFastPathConversionFuncs(scheme *runtime.Scheme) error {
|
||||
scheme.AddGenericConversionFunc(func(objA, objB interface{}, s conversion.Scope) (bool, error) {
|
||||
switch a := objA.(type) {
|
||||
case *Pod:
|
||||
switch b := objB.(type) {
|
||||
case *api.Pod:
|
||||
return true, Convert_v1_Pod_To_api_Pod(a, b, s)
|
||||
}
|
||||
case *api.Pod:
|
||||
switch b := objB.(type) {
|
||||
case *Pod:
|
||||
return true, Convert_api_Pod_To_v1_Pod(a, b, s)
|
||||
}
|
||||
|
||||
case *Event:
|
||||
switch b := objB.(type) {
|
||||
case *api.Event:
|
||||
return true, Convert_v1_Event_To_api_Event(a, b, s)
|
||||
}
|
||||
case *api.Event:
|
||||
switch b := objB.(type) {
|
||||
case *Event:
|
||||
return true, Convert_api_Event_To_v1_Event(a, b, s)
|
||||
}
|
||||
|
||||
case *ReplicationController:
|
||||
switch b := objB.(type) {
|
||||
case *api.ReplicationController:
|
||||
return true, Convert_v1_ReplicationController_To_api_ReplicationController(a, b, s)
|
||||
}
|
||||
case *api.ReplicationController:
|
||||
switch b := objB.(type) {
|
||||
case *ReplicationController:
|
||||
return true, Convert_api_ReplicationController_To_v1_ReplicationController(a, b, s)
|
||||
}
|
||||
|
||||
case *Node:
|
||||
switch b := objB.(type) {
|
||||
case *api.Node:
|
||||
return true, Convert_v1_Node_To_api_Node(a, b, s)
|
||||
}
|
||||
case *api.Node:
|
||||
switch b := objB.(type) {
|
||||
case *Node:
|
||||
return true, Convert_api_Node_To_v1_Node(a, b, s)
|
||||
}
|
||||
|
||||
case *Namespace:
|
||||
switch b := objB.(type) {
|
||||
case *api.Namespace:
|
||||
return true, Convert_v1_Namespace_To_api_Namespace(a, b, s)
|
||||
}
|
||||
case *api.Namespace:
|
||||
switch b := objB.(type) {
|
||||
case *Namespace:
|
||||
return true, Convert_api_Namespace_To_v1_Namespace(a, b, s)
|
||||
}
|
||||
|
||||
case *Service:
|
||||
switch b := objB.(type) {
|
||||
case *api.Service:
|
||||
return true, Convert_v1_Service_To_api_Service(a, b, s)
|
||||
}
|
||||
case *api.Service:
|
||||
switch b := objB.(type) {
|
||||
case *Service:
|
||||
return true, Convert_api_Service_To_v1_Service(a, b, s)
|
||||
}
|
||||
|
||||
case *Endpoints:
|
||||
switch b := objB.(type) {
|
||||
case *api.Endpoints:
|
||||
return true, Convert_v1_Endpoints_To_api_Endpoints(a, b, s)
|
||||
}
|
||||
case *api.Endpoints:
|
||||
switch b := objB.(type) {
|
||||
case *Endpoints:
|
||||
return true, Convert_api_Endpoints_To_v1_Endpoints(a, b, s)
|
||||
}
|
||||
|
||||
case *versioned.Event:
|
||||
switch b := objB.(type) {
|
||||
case *versioned.InternalEvent:
|
||||
return true, versioned.Convert_versioned_Event_to_versioned_InternalEvent(a, b, s)
|
||||
}
|
||||
case *versioned.InternalEvent:
|
||||
switch b := objB.(type) {
|
||||
case *versioned.Event:
|
||||
return true, versioned.Convert_versioned_InternalEvent_to_versioned_Event(a, b, s)
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
// Add non-generated conversion functions
|
||||
err := scheme.AddConversionFuncs(
|
||||
Convert_api_Pod_To_v1_Pod,
|
||||
|
|
@ -46,14 +152,19 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
Convert_v1_Secret_To_api_Secret,
|
||||
Convert_v1_ServiceSpec_To_api_ServiceSpec,
|
||||
Convert_v1_ResourceList_To_api_ResourceList,
|
||||
Convert_v1_ReplicationController_to_extensions_ReplicaSet,
|
||||
Convert_v1_ReplicationControllerSpec_to_extensions_ReplicaSetSpec,
|
||||
Convert_v1_ReplicationControllerStatus_to_extensions_ReplicaSetStatus,
|
||||
Convert_extensions_ReplicaSet_to_v1_ReplicationController,
|
||||
Convert_extensions_ReplicaSetSpec_to_v1_ReplicationControllerSpec,
|
||||
Convert_extensions_ReplicaSetStatus_to_v1_ReplicationControllerStatus,
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
|
||||
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
|
||||
for _, kind := range []string{
|
||||
for _, k := range []string{
|
||||
"Endpoints",
|
||||
"ResourceQuota",
|
||||
"PersistentVolumeClaim",
|
||||
|
|
@ -61,7 +172,8 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
"ServiceAccount",
|
||||
"ConfigMap",
|
||||
} {
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", kind,
|
||||
kind := k // don't close over range variables
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", kind,
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.namespace",
|
||||
|
|
@ -70,25 +182,26 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
default:
|
||||
return "", "", fmt.Errorf("field label %q not supported for %q", label, kind)
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Add field conversion funcs.
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "Pod",
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", "Pod",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.name",
|
||||
"metadata.namespace",
|
||||
case "metadata.annotations",
|
||||
"metadata.labels",
|
||||
"metadata.annotations",
|
||||
"status.phase",
|
||||
"status.podIP",
|
||||
"metadata.name",
|
||||
"metadata.namespace",
|
||||
"spec.nodeName",
|
||||
"spec.restartPolicy":
|
||||
"spec.restartPolicy",
|
||||
"spec.serviceAccountName",
|
||||
"status.phase",
|
||||
"status.podIP":
|
||||
return label, value, nil
|
||||
// This is for backwards compatibility with old v1 clients which send spec.host
|
||||
case "spec.host":
|
||||
|
|
@ -96,12 +209,12 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "Node",
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", "Node",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.name":
|
||||
|
|
@ -111,12 +224,12 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "ReplicationController",
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", "ReplicationController",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.name",
|
||||
|
|
@ -128,48 +241,9 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
}
|
||||
})
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "Event",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "involvedObject.kind",
|
||||
"involvedObject.namespace",
|
||||
"involvedObject.name",
|
||||
"involvedObject.uid",
|
||||
"involvedObject.apiVersion",
|
||||
"involvedObject.resourceVersion",
|
||||
"involvedObject.fieldPath",
|
||||
"reason",
|
||||
"source",
|
||||
"type",
|
||||
"metadata.namespace",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "Namespace",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "status.phase",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "PersistentVolume",
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", "PersistentVolume",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.name":
|
||||
|
|
@ -177,39 +251,124 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
|||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
err = api.Scheme.AddFieldLabelConversionFunc("v1", "Secret",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "type",
|
||||
"metadata.namespace",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
if err := AddFieldLabelConversionsForEvent(scheme); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := AddFieldLabelConversionsForNamespace(scheme); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := AddFieldLabelConversionsForSecret(scheme); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ReplicationController_to_extensions_ReplicaSet(in *ReplicationController, out *extensions.ReplicaSet, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ReplicationController))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ReplicationControllerSpec_to_extensions_ReplicaSetSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ReplicationControllerStatus_to_extensions_ReplicaSetStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ReplicationControllerSpec_to_extensions_ReplicaSetSpec(in *ReplicationControllerSpec, out *extensions.ReplicaSetSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ReplicationControllerSpec))(in)
|
||||
}
|
||||
out.Replicas = *in.Replicas
|
||||
if in.Selector != nil {
|
||||
api.Convert_map_to_unversioned_LabelSelector(&in.Selector, out.Selector, s)
|
||||
}
|
||||
if in.Template != nil {
|
||||
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, &out.Template, s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ReplicationControllerStatus_to_extensions_ReplicaSetStatus(in *ReplicationControllerStatus, out *extensions.ReplicaSetStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ReplicationControllerStatus))(in)
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
out.FullyLabeledReplicas = in.FullyLabeledReplicas
|
||||
out.ObservedGeneration = in.ObservedGeneration
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_extensions_ReplicaSet_to_v1_ReplicationController(in *extensions.ReplicaSet, out *ReplicationController, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.ReplicaSet))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_extensions_ReplicaSetSpec_to_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
fieldErr, ok := err.(*field.Error)
|
||||
if !ok {
|
||||
return err
|
||||
}
|
||||
if out.Annotations == nil {
|
||||
out.Annotations = make(map[string]string)
|
||||
}
|
||||
out.Annotations[NonConvertibleAnnotationPrefix+"/"+fieldErr.Field] = reflect.ValueOf(fieldErr.BadValue).String()
|
||||
}
|
||||
if err := Convert_extensions_ReplicaSetStatus_to_v1_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_extensions_ReplicaSetSpec_to_v1_ReplicationControllerSpec(in *extensions.ReplicaSetSpec, out *ReplicationControllerSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.ReplicaSetSpec))(in)
|
||||
}
|
||||
out.Replicas = new(int32)
|
||||
*out.Replicas = in.Replicas
|
||||
var invalidErr error
|
||||
if in.Selector != nil {
|
||||
invalidErr = api.Convert_unversioned_LabelSelector_to_map(in.Selector, &out.Selector, s)
|
||||
}
|
||||
out.Template = new(PodTemplateSpec)
|
||||
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, out.Template, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return invalidErr
|
||||
}
|
||||
|
||||
func Convert_extensions_ReplicaSetStatus_to_v1_ReplicationControllerStatus(in *extensions.ReplicaSetStatus, out *ReplicationControllerStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.ReplicaSetStatus))(in)
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
out.FullyLabeledReplicas = in.FullyLabeledReplicas
|
||||
out.ObservedGeneration = in.ObservedGeneration
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *api.ReplicationControllerSpec, out *ReplicationControllerSpec, s conversion.Scope) error {
|
||||
out.Replicas = &in.Replicas
|
||||
out.Selector = in.Selector
|
||||
//if in.TemplateRef != nil {
|
||||
// out.TemplateRef = new(ObjectReference)
|
||||
// if err := Convert_api_ObjectReference_To_v1_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
||||
// return err
|
||||
// }
|
||||
//} else {
|
||||
// out.TemplateRef = nil
|
||||
//}
|
||||
if in.Template != nil {
|
||||
out.Template = new(PodTemplateSpec)
|
||||
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
||||
|
|
@ -224,15 +383,6 @@ func Convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *a
|
|||
func Convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(in *ReplicationControllerSpec, out *api.ReplicationControllerSpec, s conversion.Scope) error {
|
||||
out.Replicas = *in.Replicas
|
||||
out.Selector = in.Selector
|
||||
|
||||
//if in.TemplateRef != nil {
|
||||
// out.TemplateRef = new(api.ObjectReference)
|
||||
// if err := Convert_v1_ObjectReference_To_api_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
||||
// return err
|
||||
// }
|
||||
//} else {
|
||||
// out.TemplateRef = nil
|
||||
//}
|
||||
if in.Template != nil {
|
||||
out.Template = new(api.PodTemplateSpec)
|
||||
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
||||
|
|
@ -271,7 +421,7 @@ func Convert_api_PodStatusResult_To_v1_PodStatusResult(in *api.PodStatusResult,
|
|||
}
|
||||
|
||||
func Convert_v1_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult, out *api.PodStatusResult, s conversion.Scope) error {
|
||||
// TODO: when we move init container to beta, remove these conversions
|
||||
// TODO: sometime after we move init container to stable, remove these conversions
|
||||
if value, ok := in.Annotations[PodInitContainerStatusesAnnotationKey]; ok {
|
||||
var values []ContainerStatus
|
||||
if err := json.Unmarshal([]byte(value), &values); err != nil {
|
||||
|
|
@ -305,7 +455,7 @@ func Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in *api.PodTemplateSpec,
|
|||
return err
|
||||
}
|
||||
|
||||
// TODO: when we move init container to beta, remove these conversions
|
||||
// TODO: sometime after we move init container to stable, remove these conversions.
|
||||
if old := out.Annotations; old != nil {
|
||||
out.Annotations = make(map[string]string, len(old))
|
||||
for k, v := range old {
|
||||
|
|
@ -321,14 +471,22 @@ func Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in *api.PodTemplateSpec,
|
|||
return err
|
||||
}
|
||||
out.Annotations[PodInitContainersAnnotationKey] = string(value)
|
||||
out.Annotations[PodInitContainersBetaAnnotationKey] = string(value)
|
||||
} else {
|
||||
delete(out.Annotations, PodInitContainersAnnotationKey)
|
||||
delete(out.Annotations, PodInitContainersBetaAnnotationKey)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out *api.PodTemplateSpec, s conversion.Scope) error {
|
||||
// TODO: when we move init container to beta, remove these conversions
|
||||
// TODO: sometime after we move init container to stable, remove these conversions
|
||||
// If there is a beta annotation, copy to alpha key.
|
||||
// See commit log for PR #31026 for why we do this.
|
||||
if valueBeta, okBeta := in.Annotations[PodInitContainersBetaAnnotationKey]; okBeta {
|
||||
in.Annotations[PodInitContainersAnnotationKey] = valueBeta
|
||||
}
|
||||
// Move the annotation to the internal repr. field
|
||||
if value, ok := in.Annotations[PodInitContainersAnnotationKey]; ok {
|
||||
var values []Container
|
||||
if err := json.Unmarshal([]byte(value), &values); err != nil {
|
||||
|
|
@ -353,6 +511,7 @@ func Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out
|
|||
out.Annotations[k] = v
|
||||
}
|
||||
delete(out.Annotations, PodInitContainersAnnotationKey)
|
||||
delete(out.Annotations, PodInitContainersBetaAnnotationKey)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -406,7 +565,7 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
|
|||
return err
|
||||
}
|
||||
|
||||
// TODO: when we move init container to beta, remove these conversions
|
||||
// TODO: sometime after we move init container to stable, remove these conversions
|
||||
if len(out.Spec.InitContainers) > 0 || len(out.Status.InitContainerStatuses) > 0 {
|
||||
old := out.Annotations
|
||||
out.Annotations = make(map[string]string, len(old))
|
||||
|
|
@ -414,6 +573,7 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
|
|||
out.Annotations[k] = v
|
||||
}
|
||||
delete(out.Annotations, PodInitContainersAnnotationKey)
|
||||
delete(out.Annotations, PodInitContainersBetaAnnotationKey)
|
||||
delete(out.Annotations, PodInitContainerStatusesAnnotationKey)
|
||||
}
|
||||
if len(out.Spec.InitContainers) > 0 {
|
||||
|
|
@ -422,6 +582,7 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
|
|||
return err
|
||||
}
|
||||
out.Annotations[PodInitContainersAnnotationKey] = string(value)
|
||||
out.Annotations[PodInitContainersBetaAnnotationKey] = string(value)
|
||||
}
|
||||
if len(out.Status.InitContainerStatuses) > 0 {
|
||||
value, err := json.Marshal(out.Status.InitContainerStatuses)
|
||||
|
|
@ -446,7 +607,13 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
|
|||
}
|
||||
|
||||
func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error {
|
||||
// TODO: when we move init container to beta, remove these conversions
|
||||
// If there is a beta annotation, copy to alpha key.
|
||||
// See commit log for PR #31026 for why we do this.
|
||||
if valueBeta, okBeta := in.Annotations[PodInitContainersBetaAnnotationKey]; okBeta {
|
||||
in.Annotations[PodInitContainersAnnotationKey] = valueBeta
|
||||
}
|
||||
// TODO: sometime after we move init container to stable, remove these conversions
|
||||
// Move the annotation to the internal repr. field
|
||||
if value, ok := in.Annotations[PodInitContainersAnnotationKey]; ok {
|
||||
var values []Container
|
||||
if err := json.Unmarshal([]byte(value), &values); err != nil {
|
||||
|
|
@ -484,6 +651,7 @@ func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error
|
|||
out.Annotations[k] = v
|
||||
}
|
||||
delete(out.Annotations, PodInitContainersAnnotationKey)
|
||||
delete(out.Annotations, PodInitContainersBetaAnnotationKey)
|
||||
delete(out.Annotations, PodInitContainerStatusesAnnotationKey)
|
||||
}
|
||||
return nil
|
||||
|
|
@ -577,3 +745,53 @@ func Convert_v1_ResourceList_To_api_ResourceList(in *ResourceList, out *api.Reso
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func AddFieldLabelConversionsForEvent(scheme *runtime.Scheme) error {
|
||||
return scheme.AddFieldLabelConversionFunc("v1", "Event",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "involvedObject.kind",
|
||||
"involvedObject.namespace",
|
||||
"involvedObject.name",
|
||||
"involvedObject.uid",
|
||||
"involvedObject.apiVersion",
|
||||
"involvedObject.resourceVersion",
|
||||
"involvedObject.fieldPath",
|
||||
"reason",
|
||||
"source",
|
||||
"type",
|
||||
"metadata.namespace",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func AddFieldLabelConversionsForNamespace(scheme *runtime.Scheme) error {
|
||||
return scheme.AddFieldLabelConversionFunc("v1", "Namespace",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "status.phase",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func AddFieldLabelConversionsForSecret(scheme *runtime.Scheme) error {
|
||||
return scheme.AddFieldLabelConversionFunc("v1", "Secret",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "type",
|
||||
"metadata.namespace",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
2924
vendor/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go
generated
vendored
2924
vendor/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go
generated
vendored
File diff suppressed because it is too large
Load diff
39
vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go
generated
vendored
39
vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go
generated
vendored
|
|
@ -23,8 +23,8 @@ import (
|
|||
"k8s.io/kubernetes/pkg/util/parsers"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) {
|
||||
scheme.AddDefaultingFuncs(
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddDefaultingFuncs(
|
||||
SetDefaults_PodExecOptions,
|
||||
SetDefaults_PodAttachOptions,
|
||||
SetDefaults_ReplicationController,
|
||||
|
|
@ -35,6 +35,9 @@ func addDefaultingFuncs(scheme *runtime.Scheme) {
|
|||
SetDefaults_Pod,
|
||||
SetDefaults_PodSpec,
|
||||
SetDefaults_Probe,
|
||||
SetDefaults_SecretVolumeSource,
|
||||
SetDefaults_ConfigMapVolumeSource,
|
||||
SetDefaults_DownwardAPIVolumeSource,
|
||||
SetDefaults_Secret,
|
||||
SetDefaults_PersistentVolume,
|
||||
SetDefaults_PersistentVolumeClaim,
|
||||
|
|
@ -174,6 +177,24 @@ func SetDefaults_Probe(obj *Probe) {
|
|||
obj.FailureThreshold = 3
|
||||
}
|
||||
}
|
||||
func SetDefaults_SecretVolumeSource(obj *SecretVolumeSource) {
|
||||
if obj.DefaultMode == nil {
|
||||
perm := int32(SecretVolumeSourceDefaultMode)
|
||||
obj.DefaultMode = &perm
|
||||
}
|
||||
}
|
||||
func SetDefaults_ConfigMapVolumeSource(obj *ConfigMapVolumeSource) {
|
||||
if obj.DefaultMode == nil {
|
||||
perm := int32(ConfigMapVolumeSourceDefaultMode)
|
||||
obj.DefaultMode = &perm
|
||||
}
|
||||
}
|
||||
func SetDefaults_DownwardAPIVolumeSource(obj *DownwardAPIVolumeSource) {
|
||||
if obj.DefaultMode == nil {
|
||||
perm := int32(DownwardAPIVolumeSourceDefaultMode)
|
||||
obj.DefaultMode = &perm
|
||||
}
|
||||
}
|
||||
func SetDefaults_Secret(obj *Secret) {
|
||||
if obj.Type == "" {
|
||||
obj.Type = SecretTypeOpaque
|
||||
|
|
@ -197,6 +218,20 @@ func SetDefaults_ISCSIVolumeSource(obj *ISCSIVolumeSource) {
|
|||
obj.ISCSIInterface = "default"
|
||||
}
|
||||
}
|
||||
func SetDefaults_AzureDiskVolumeSource(obj *AzureDiskVolumeSource) {
|
||||
if obj.CachingMode == nil {
|
||||
obj.CachingMode = new(AzureDataDiskCachingMode)
|
||||
*obj.CachingMode = AzureDataDiskCachingNone
|
||||
}
|
||||
if obj.FSType == nil {
|
||||
obj.FSType = new(string)
|
||||
*obj.FSType = "ext4"
|
||||
}
|
||||
if obj.ReadOnly == nil {
|
||||
obj.ReadOnly = new(bool)
|
||||
*obj.ReadOnly = false
|
||||
}
|
||||
}
|
||||
func SetDefaults_Endpoints(obj *Endpoints) {
|
||||
for i := range obj.Subsets {
|
||||
ss := &obj.Subsets[i]
|
||||
|
|
|
|||
5919
vendor/k8s.io/kubernetes/pkg/api/v1/generated.pb.go
generated
vendored
5919
vendor/k8s.io/kubernetes/pkg/api/v1/generated.pb.go
generated
vendored
File diff suppressed because it is too large
Load diff
185
vendor/k8s.io/kubernetes/pkg/api/v1/generated.proto
generated
vendored
185
vendor/k8s.io/kubernetes/pkg/api/v1/generated.proto
generated
vendored
|
|
@ -80,6 +80,36 @@ message AttachedVolume {
|
|||
optional string devicePath = 2;
|
||||
}
|
||||
|
||||
// AvoidPods describes pods that should avoid this node. This is the value for a
|
||||
// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and
|
||||
// will eventually become a field of NodeStatus.
|
||||
message AvoidPods {
|
||||
// Bounded-sized list of signatures of pods that should avoid this node, sorted
|
||||
// in timestamp order from oldest to newest. Size of the slice is unspecified.
|
||||
repeated PreferAvoidPodsEntry preferAvoidPods = 1;
|
||||
}
|
||||
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
message AzureDiskVolumeSource {
|
||||
// The Name of the data disk in the blob storage
|
||||
optional string diskName = 1;
|
||||
|
||||
// The URI the data disk in the blob storage
|
||||
optional string diskURI = 2;
|
||||
|
||||
// Host Caching mode: None, Read Only, Read Write.
|
||||
optional string cachingMode = 3;
|
||||
|
||||
// Filesystem type to mount.
|
||||
// Must be a filesystem type supported by the host operating system.
|
||||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
optional string fsType = 4;
|
||||
|
||||
// Defaults to false (read/write). ReadOnly here will force
|
||||
// the ReadOnly setting in VolumeMounts.
|
||||
optional bool readOnly = 5;
|
||||
}
|
||||
|
||||
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
|
||||
message AzureFileVolumeSource {
|
||||
// the name of secret that contains Azure Storage Account Name and Key
|
||||
|
|
@ -247,6 +277,13 @@ message ConfigMapVolumeSource {
|
|||
// the volume setup will error. Paths must be relative and may not contain
|
||||
// the '..' path or start with '..'.
|
||||
repeated KeyToPath items = 2;
|
||||
|
||||
// Optional: mode bits to use on created files by default. Must be a
|
||||
// value between 0 and 0777. Defaults to 0644.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
optional int32 defaultMode = 3;
|
||||
}
|
||||
|
||||
// A single application container that you want to run within a pod.
|
||||
|
|
@ -517,6 +554,12 @@ message DownwardAPIVolumeFile {
|
|||
// Selects a resource of the container: only resources limits and requests
|
||||
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
|
||||
optional ResourceFieldSelector resourceFieldRef = 3;
|
||||
|
||||
// Optional: mode bits to use on this file, must be a value between 0
|
||||
// and 0777. If not specified, the volume defaultMode will be used.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
optional int32 mode = 4;
|
||||
}
|
||||
|
||||
// DownwardAPIVolumeSource represents a volume containing downward API info.
|
||||
|
|
@ -524,6 +567,13 @@ message DownwardAPIVolumeFile {
|
|||
message DownwardAPIVolumeSource {
|
||||
// Items is a list of downward API volume file
|
||||
repeated DownwardAPIVolumeFile items = 1;
|
||||
|
||||
// Optional: mode bits to use on created files by default. Must be a
|
||||
// value between 0 and 0777. Defaults to 0644.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
optional int32 defaultMode = 2;
|
||||
}
|
||||
|
||||
// Represents an empty directory for a pod.
|
||||
|
|
@ -549,6 +599,9 @@ message EndpointAddress {
|
|||
// The Hostname of this endpoint
|
||||
optional string hostname = 3;
|
||||
|
||||
// Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
|
||||
optional string nodeName = 4;
|
||||
|
||||
// Reference to object providing the endpoint.
|
||||
optional ObjectReference targetRef = 2;
|
||||
}
|
||||
|
|
@ -651,7 +704,8 @@ message EnvVar {
|
|||
|
||||
// EnvVarSource represents a source for the value of an EnvVar.
|
||||
message EnvVarSource {
|
||||
// Selects a field of the pod; only name and namespace are supported.
|
||||
// Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations,
|
||||
// spec.nodeName, spec.serviceAccountName, status.podIP.
|
||||
optional ObjectFieldSelector fieldRef = 1;
|
||||
|
||||
// Selects a resource of the container: only resources limits and requests
|
||||
|
|
@ -951,6 +1005,12 @@ message KeyToPath {
|
|||
// May not contain the path element '..'.
|
||||
// May not start with the string '..'.
|
||||
optional string path = 2;
|
||||
|
||||
// Optional: mode bits to use on this file, must be a value between 0
|
||||
// and 0777. If not specified, the volume defaultMode will be used.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
optional int32 mode = 3;
|
||||
}
|
||||
|
||||
// Lifecycle describes actions that the management system should take in response to container lifecycle
|
||||
|
|
@ -1292,6 +1352,7 @@ message NodeStatus {
|
|||
|
||||
// NodePhase is the recently observed lifecycle phase of the node.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase
|
||||
// The field is never populated, and now is deprecated.
|
||||
optional string phase = 3;
|
||||
|
||||
// Conditions is an array of current observed node conditions.
|
||||
|
|
@ -1466,7 +1527,6 @@ message ObjectMeta {
|
|||
// (scope and select) objects. May match selectors of replication controllers
|
||||
// and services.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md
|
||||
// TODO: replace map[string]string with labels.LabelSet type
|
||||
map<string, string> labels = 11;
|
||||
|
||||
// Annotations is an unstructured key value map stored with a resource that may be
|
||||
|
|
@ -1486,6 +1546,11 @@ message ObjectMeta {
|
|||
// from the list. If the deletionTimestamp of the object is non-nil, entries
|
||||
// in this list can only be removed.
|
||||
repeated string finalizers = 14;
|
||||
|
||||
// The name of the cluster which the object belongs to.
|
||||
// This is used to distinguish resources with same name and namespace in different clusters.
|
||||
// This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
|
||||
optional string clusterName = 15;
|
||||
}
|
||||
|
||||
// ObjectReference contains enough information to let you inspect or modify the referred object.
|
||||
|
|
@ -1710,6 +1775,12 @@ message PersistentVolumeSource {
|
|||
|
||||
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
|
||||
optional VsphereVirtualDiskVolumeSource vsphereVolume = 14;
|
||||
|
||||
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
|
||||
optional QuobyteVolumeSource quobyte = 15;
|
||||
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
optional AzureDiskVolumeSource azureDisk = 16;
|
||||
}
|
||||
|
||||
// PersistentVolumeSpec is the specification of a persistent volume.
|
||||
|
|
@ -2040,6 +2111,13 @@ message PodSecurityContext {
|
|||
optional int64 fsGroup = 5;
|
||||
}
|
||||
|
||||
// Describes the class of pods that should avoid this node.
|
||||
// Exactly one field should be set.
|
||||
message PodSignature {
|
||||
// Reference to controller whose pods should avoid this node.
|
||||
optional OwnerReference podController = 1;
|
||||
}
|
||||
|
||||
// PodSpec is a description of a pod.
|
||||
message PodSpec {
|
||||
// List of volumes that can be mounted by containers belonging to the pod.
|
||||
|
|
@ -2219,6 +2297,21 @@ message Preconditions {
|
|||
optional string uid = 1;
|
||||
}
|
||||
|
||||
// Describes a class of pods that should avoid this node.
|
||||
message PreferAvoidPodsEntry {
|
||||
// The class of pods.
|
||||
optional PodSignature podSignature = 1;
|
||||
|
||||
// Time at which this entry was added to the list.
|
||||
optional k8s.io.kubernetes.pkg.api.unversioned.Time evictionTime = 2;
|
||||
|
||||
// (brief) reason why this entry was added to the list.
|
||||
optional string reason = 3;
|
||||
|
||||
// Human readable message indicating why this entry was added to the list.
|
||||
optional string message = 4;
|
||||
}
|
||||
|
||||
// An empty preferred scheduling term matches all objects with implicit weight 0
|
||||
// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
|
||||
message PreferredSchedulingTerm {
|
||||
|
|
@ -2257,6 +2350,30 @@ message Probe {
|
|||
optional int32 failureThreshold = 6;
|
||||
}
|
||||
|
||||
// Represents a Quobyte mount that lasts the lifetime of a pod.
|
||||
// Quobyte volumes do not support ownership management or SELinux relabeling.
|
||||
message QuobyteVolumeSource {
|
||||
// Registry represents a single or multiple Quobyte Registry services
|
||||
// specified as a string as host:port pair (multiple entries are separated with commas)
|
||||
// which acts as the central registry for volumes
|
||||
optional string registry = 1;
|
||||
|
||||
// Volume is a string that references an already created Quobyte volume by name.
|
||||
optional string volume = 2;
|
||||
|
||||
// ReadOnly here will force the Quobyte volume to be mounted with read-only permissions.
|
||||
// Defaults to false.
|
||||
optional bool readOnly = 3;
|
||||
|
||||
// User to map volume access to
|
||||
// Defaults to serivceaccount user
|
||||
optional string user = 4;
|
||||
|
||||
// Group to map volume access to
|
||||
// Default is no group
|
||||
optional string group = 5;
|
||||
}
|
||||
|
||||
// Represents a Rados Block Device mount that lasts the lifetime of a pod.
|
||||
// RBD volumes support ownership management and SELinux relabeling.
|
||||
message RBDVolumeSource {
|
||||
|
|
@ -2376,6 +2493,9 @@ message ReplicationControllerStatus {
|
|||
// The number of pods that have labels matching the labels of the pod template of the replication controller.
|
||||
optional int32 fullyLabeledReplicas = 2;
|
||||
|
||||
// The number of ready replicas for this replication controller.
|
||||
optional int32 readyReplicas = 4;
|
||||
|
||||
// ObservedGeneration reflects the generation of the most recently observed replication controller.
|
||||
optional int64 observedGeneration = 3;
|
||||
}
|
||||
|
|
@ -2442,13 +2562,13 @@ message ResourceQuotaStatus {
|
|||
// ResourceRequirements describes the compute resource requirements.
|
||||
message ResourceRequirements {
|
||||
// Limits describes the maximum amount of compute resources allowed.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications
|
||||
// More info: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
map<string, k8s.io.kubernetes.pkg.api.resource.Quantity> limits = 1;
|
||||
|
||||
// Requests describes the minimum amount of compute resources required.
|
||||
// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
|
||||
// otherwise to an implementation-defined value.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications
|
||||
// More info: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
map<string, k8s.io.kubernetes.pkg.api.resource.Quantity> requests = 2;
|
||||
}
|
||||
|
||||
|
|
@ -2530,6 +2650,13 @@ message SecretVolumeSource {
|
|||
// the volume setup will error. Paths must be relative and may not contain
|
||||
// the '..' path or start with '..'.
|
||||
repeated KeyToPath items = 2;
|
||||
|
||||
// Optional: mode bits to use on created files by default. Must be a
|
||||
// value between 0 and 0777. Defaults to 0644.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
optional int32 defaultMode = 3;
|
||||
}
|
||||
|
||||
// SecurityContext holds security configuration that will be applied to a container.
|
||||
|
|
@ -2685,24 +2812,39 @@ message ServiceSpec {
|
|||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies
|
||||
repeated ServicePort ports = 1;
|
||||
|
||||
// This service will route traffic to pods having labels matching this selector.
|
||||
// Label keys and values that must match in order to receive traffic for this service.
|
||||
// If not specified, endpoints must be manually specified and the system will not automatically manage them.
|
||||
// Route service traffic to pods with label keys and values matching this
|
||||
// selector. If empty or not present, the service is assumed to have an
|
||||
// external process managing its endpoints, which Kubernetes will not
|
||||
// modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
|
||||
// Ignored if type is ExternalName.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview
|
||||
map<string, string> selector = 2;
|
||||
|
||||
// ClusterIP is usually assigned by the master and is the IP address of the service.
|
||||
// If specified, it will be allocated to the service if it is unused
|
||||
// or else creation of the service will fail.
|
||||
// Valid values are None, empty string (""), or a valid IP address.
|
||||
// 'None' can be specified for a headless service when proxying is not required.
|
||||
// Cannot be updated.
|
||||
// clusterIP is the IP address of the service and is usually assigned
|
||||
// randomly by the master. If an address is specified manually and is not in
|
||||
// use by others, it will be allocated to the service; otherwise, creation
|
||||
// of the service will fail. This field can not be changed through updates.
|
||||
// Valid values are "None", empty string (""), or a valid IP address. "None"
|
||||
// can be specified for headless services when proxying is not required.
|
||||
// Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if
|
||||
// type is ExternalName.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies
|
||||
optional string clusterIP = 3;
|
||||
|
||||
// Type of exposed service. Must be ClusterIP, NodePort, or LoadBalancer.
|
||||
// Defaults to ClusterIP.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#external-services
|
||||
// type determines how the Service is exposed. Defaults to ClusterIP. Valid
|
||||
// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
|
||||
// "ExternalName" maps to the specified externalName.
|
||||
// "ClusterIP" allocates a cluster-internal IP address for load-balancing to
|
||||
// endpoints. Endpoints are determined by the selector or if that is not
|
||||
// specified, by manual construction of an Endpoints object. If clusterIP is
|
||||
// "None", no virtual IP is allocated and the endpoints are published as a
|
||||
// set of endpoints rather than a stable IP.
|
||||
// "NodePort" builds on ClusterIP and allocates a port on every node which
|
||||
// routes to the clusterIP.
|
||||
// "LoadBalancer" builds on NodePort and creates an
|
||||
// external load-balancer (if supported in the current cloud) which routes
|
||||
// to the clusterIP.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview
|
||||
optional string type = 4;
|
||||
|
||||
// externalIPs is a list of IP addresses for which nodes in the cluster
|
||||
|
|
@ -2741,6 +2883,11 @@ message ServiceSpec {
|
|||
// cloud-provider does not support the feature."
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services-firewalls.md
|
||||
repeated string loadBalancerSourceRanges = 9;
|
||||
|
||||
// externalName is the external reference that kubedns or equivalent will
|
||||
// return as a CNAME record for this service. No proxying will be involved.
|
||||
// Must be a valid DNS name and requires Type to be ExternalName.
|
||||
optional string externalName = 10;
|
||||
}
|
||||
|
||||
// ServiceStatus represents the current status of a service.
|
||||
|
|
@ -2910,6 +3057,12 @@ message VolumeSource {
|
|||
|
||||
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
|
||||
optional VsphereVirtualDiskVolumeSource vsphereVolume = 20;
|
||||
|
||||
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
|
||||
optional QuobyteVolumeSource quobyte = 21;
|
||||
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
optional AzureDiskVolumeSource azureDisk = 22;
|
||||
}
|
||||
|
||||
// Represents a vSphere volume resource.
|
||||
|
|
|
|||
7
vendor/k8s.io/kubernetes/pkg/api/v1/meta.go
generated
vendored
7
vendor/k8s.io/kubernetes/pkg/api/v1/meta.go
generated
vendored
|
|
@ -83,3 +83,10 @@ func (meta *ObjectMeta) SetOwnerReferences(references []metatypes.OwnerReference
|
|||
}
|
||||
meta.OwnerReferences = newReferences
|
||||
}
|
||||
|
||||
func (meta *ObjectMeta) GetClusterName() string {
|
||||
return meta.ClusterName
|
||||
}
|
||||
func (meta *ObjectMeta) SetClusterName(clusterName string) {
|
||||
meta.ClusterName = clusterName
|
||||
}
|
||||
|
|
|
|||
13
vendor/k8s.io/kubernetes/pkg/api/v1/register.go
generated
vendored
13
vendor/k8s.io/kubernetes/pkg/api/v1/register.go
generated
vendored
|
|
@ -28,15 +28,13 @@ const GroupName = ""
|
|||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
func AddToScheme(scheme *runtime.Scheme) {
|
||||
// Add the API to Scheme.
|
||||
addKnownTypes(scheme)
|
||||
addConversionFuncs(scheme)
|
||||
addDefaultingFuncs(scheme)
|
||||
}
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs, addFastPathConversionFuncs)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) {
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Pod{},
|
||||
&PodList{},
|
||||
|
|
@ -91,4 +89,5 @@ func addKnownTypes(scheme *runtime.Scheme) {
|
|||
|
||||
// Add the watch version that applies
|
||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
51408
vendor/k8s.io/kubernetes/pkg/api/v1/types.generated.go
generated
vendored
51408
vendor/k8s.io/kubernetes/pkg/api/v1/types.generated.go
generated
vendored
File diff suppressed because it is too large
Load diff
209
vendor/k8s.io/kubernetes/pkg/api/v1/types.go
generated
vendored
209
vendor/k8s.io/kubernetes/pkg/api/v1/types.go
generated
vendored
|
|
@ -24,7 +24,7 @@ import (
|
|||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// The comments for the structs and fields can be used from go-resful to
|
||||
// The comments for the structs and fields can be used from go-restful to
|
||||
// generate Swagger API documentation for its models. Please read this PR for more
|
||||
// information on the implementation: https://github.com/emicklei/go-restful/pull/215
|
||||
//
|
||||
|
|
@ -167,7 +167,6 @@ type ObjectMeta struct {
|
|||
// (scope and select) objects. May match selectors of replication controllers
|
||||
// and services.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md
|
||||
// TODO: replace map[string]string with labels.LabelSet type
|
||||
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`
|
||||
|
||||
// Annotations is an unstructured key value map stored with a resource that may be
|
||||
|
|
@ -187,6 +186,11 @@ type ObjectMeta struct {
|
|||
// from the list. If the deletionTimestamp of the object is non-nil, entries
|
||||
// in this list can only be removed.
|
||||
Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"`
|
||||
|
||||
// The name of the cluster which the object belongs to.
|
||||
// This is used to distinguish resources with same name and namespace in different clusters.
|
||||
// This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
|
||||
ClusterName string `json:"clusterName,omitempty" protobuf:"bytes,15,opt,name=clusterName"`
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
@ -260,13 +264,10 @@ type VolumeSource struct {
|
|||
// Cinder represents a cinder volume attached and mounted on kubelets host machine
|
||||
// More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md
|
||||
Cinder *CinderVolumeSource `json:"cinder,omitempty" protobuf:"bytes,13,opt,name=cinder"`
|
||||
|
||||
// CephFS represents a Ceph FS mount on the host that shares a pod's lifetime
|
||||
CephFS *CephFSVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,14,opt,name=cephfs"`
|
||||
|
||||
// Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
|
||||
Flocker *FlockerVolumeSource `json:"flocker,omitempty" protobuf:"bytes,15,opt,name=flocker"`
|
||||
|
||||
// DownwardAPI represents downward API about the pod that should populate this volume
|
||||
DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty" protobuf:"bytes,16,opt,name=downwardAPI"`
|
||||
// FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
|
||||
|
|
@ -277,6 +278,10 @@ type VolumeSource struct {
|
|||
ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty" protobuf:"bytes,19,opt,name=configMap"`
|
||||
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
|
||||
VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,20,opt,name=vsphereVolume"`
|
||||
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
|
||||
Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,21,opt,name=quobyte"`
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"`
|
||||
}
|
||||
|
||||
// PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace.
|
||||
|
|
@ -339,6 +344,10 @@ type PersistentVolumeSource struct {
|
|||
AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,13,opt,name=azureFile"`
|
||||
// VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
|
||||
VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,14,opt,name=vsphereVolume"`
|
||||
// Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
|
||||
Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,15,opt,name=quobyte"`
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,16,opt,name=azureDisk"`
|
||||
}
|
||||
|
||||
// +genclient=true
|
||||
|
|
@ -689,6 +698,30 @@ type GCEPersistentDiskVolumeSource struct {
|
|||
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"`
|
||||
}
|
||||
|
||||
// Represents a Quobyte mount that lasts the lifetime of a pod.
|
||||
// Quobyte volumes do not support ownership management or SELinux relabeling.
|
||||
type QuobyteVolumeSource struct {
|
||||
// Registry represents a single or multiple Quobyte Registry services
|
||||
// specified as a string as host:port pair (multiple entries are separated with commas)
|
||||
// which acts as the central registry for volumes
|
||||
Registry string `json:"registry" protobuf:"bytes,1,opt,name=registry"`
|
||||
|
||||
// Volume is a string that references an already created Quobyte volume by name.
|
||||
Volume string `json:"volume" protobuf:"bytes,2,opt,name=volume"`
|
||||
|
||||
// ReadOnly here will force the Quobyte volume to be mounted with read-only permissions.
|
||||
// Defaults to false.
|
||||
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"`
|
||||
|
||||
// User to map volume access to
|
||||
// Defaults to serivceaccount user
|
||||
User string `json:"user,omitempty" protobuf:"bytes,4,opt,name=user"`
|
||||
|
||||
// Group to map volume access to
|
||||
// Default is no group
|
||||
Group string `json:"group,omitempty" protobuf:"bytes,5,opt,name=group"`
|
||||
}
|
||||
|
||||
// FlexVolume represents a generic volume resource that is
|
||||
// provisioned/attached using a exec based plugin. This is an alpha feature and may change in future.
|
||||
type FlexVolumeSource struct {
|
||||
|
|
@ -770,8 +803,18 @@ type SecretVolumeSource struct {
|
|||
// the volume setup will error. Paths must be relative and may not contain
|
||||
// the '..' path or start with '..'.
|
||||
Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
|
||||
// Optional: mode bits to use on created files by default. Must be a
|
||||
// value between 0 and 0777. Defaults to 0644.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"bytes,3,opt,name=defaultMode"`
|
||||
}
|
||||
|
||||
const (
|
||||
SecretVolumeSourceDefaultMode int32 = 0644
|
||||
)
|
||||
|
||||
// Represents an NFS mount that lasts the lifetime of a pod.
|
||||
// NFS volumes do not support ownership management or SELinux relabeling.
|
||||
type NFSVolumeSource struct {
|
||||
|
|
@ -852,6 +895,30 @@ type VsphereVirtualDiskVolumeSource struct {
|
|||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"`
|
||||
}
|
||||
type AzureDataDiskCachingMode string
|
||||
|
||||
const (
|
||||
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
|
||||
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
|
||||
AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite"
|
||||
)
|
||||
|
||||
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
type AzureDiskVolumeSource struct {
|
||||
// The Name of the data disk in the blob storage
|
||||
DiskName string `json:"diskName" protobuf:"bytes,1,opt,name=diskName"`
|
||||
// The URI the data disk in the blob storage
|
||||
DataDiskURI string `json:"diskURI" protobuf:"bytes,2,opt,name=diskURI"`
|
||||
// Host Caching mode: None, Read Only, Read Write.
|
||||
CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty" protobuf:"bytes,3,opt,name=cachingMode,casttype=AzureDataDiskCachingMode"`
|
||||
// Filesystem type to mount.
|
||||
// Must be a filesystem type supported by the host operating system.
|
||||
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
FSType *string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"`
|
||||
// Defaults to false (read/write). ReadOnly here will force
|
||||
// the ReadOnly setting in VolumeMounts.
|
||||
ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"`
|
||||
}
|
||||
|
||||
// Adapts a ConfigMap into a volume.
|
||||
//
|
||||
|
|
@ -869,8 +936,18 @@ type ConfigMapVolumeSource struct {
|
|||
// the volume setup will error. Paths must be relative and may not contain
|
||||
// the '..' path or start with '..'.
|
||||
Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
|
||||
// Optional: mode bits to use on created files by default. Must be a
|
||||
// value between 0 and 0777. Defaults to 0644.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,3,opt,name=defaultMode"`
|
||||
}
|
||||
|
||||
const (
|
||||
ConfigMapVolumeSourceDefaultMode int32 = 0644
|
||||
)
|
||||
|
||||
// Maps a string key to a path within a volume.
|
||||
type KeyToPath struct {
|
||||
// The key to project.
|
||||
|
|
@ -881,6 +958,11 @@ type KeyToPath struct {
|
|||
// May not contain the path element '..'.
|
||||
// May not start with the string '..'.
|
||||
Path string `json:"path" protobuf:"bytes,2,opt,name=path"`
|
||||
// Optional: mode bits to use on this file, must be a value between 0
|
||||
// and 0777. If not specified, the volume defaultMode will be used.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
Mode *int32 `json:"mode,omitempty" protobuf:"varint,3,opt,name=mode"`
|
||||
}
|
||||
|
||||
// ContainerPort represents a network port in a single container.
|
||||
|
|
@ -941,7 +1023,8 @@ type EnvVar struct {
|
|||
|
||||
// EnvVarSource represents a source for the value of an EnvVar.
|
||||
type EnvVarSource struct {
|
||||
// Selects a field of the pod; only name and namespace are supported.
|
||||
// Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations,
|
||||
// spec.nodeName, spec.serviceAccountName, status.podIP.
|
||||
FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,1,opt,name=fieldRef"`
|
||||
// Selects a resource of the container: only resources limits and requests
|
||||
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
|
||||
|
|
@ -1089,12 +1172,12 @@ type Capabilities struct {
|
|||
// ResourceRequirements describes the compute resource requirements.
|
||||
type ResourceRequirements struct {
|
||||
// Limits describes the maximum amount of compute resources allowed.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications
|
||||
// More info: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
Limits ResourceList `json:"limits,omitempty" protobuf:"bytes,1,rep,name=limits,casttype=ResourceList,castkey=ResourceName"`
|
||||
// Requests describes the minimum amount of compute resources required.
|
||||
// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
|
||||
// otherwise to an implementation-defined value.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications
|
||||
// More info: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
Requests ResourceList `json:"requests,omitempty" protobuf:"bytes,2,rep,name=requests,casttype=ResourceList,castkey=ResourceName"`
|
||||
}
|
||||
|
||||
|
|
@ -1655,11 +1738,17 @@ const (
|
|||
const (
|
||||
// This annotation key will be used to contain an array of v1 JSON encoded Containers
|
||||
// for init containers. The annotation will be placed into the internal type and cleared.
|
||||
// This key is only recognized by version >= 1.4.
|
||||
PodInitContainersBetaAnnotationKey = "pod.beta.kubernetes.io/init-containers"
|
||||
// This annotation key will be used to contain an array of v1 JSON encoded Containers
|
||||
// for init containers. The annotation will be placed into the internal type and cleared.
|
||||
// This key is recognized by version >= 1.3. For version 1.4 code, this key
|
||||
// will have its value copied to the beta key.
|
||||
PodInitContainersAnnotationKey = "pod.alpha.kubernetes.io/init-containers"
|
||||
// This annotation key will be used to contain an array of v1 JSON encoded
|
||||
// ContainerStatuses for init containers. The annotation will be placed into the internal
|
||||
// type and cleared.
|
||||
PodInitContainerStatusesAnnotationKey = "pod.alpha.kubernetes.io/init-container-statuses"
|
||||
PodInitContainerStatusesAnnotationKey = "pod.beta.kubernetes.io/init-container-statuses"
|
||||
)
|
||||
|
||||
// PodSpec is a description of a pod.
|
||||
|
|
@ -1951,6 +2040,9 @@ type ReplicationControllerStatus struct {
|
|||
// The number of pods that have labels matching the labels of the pod template of the replication controller.
|
||||
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"`
|
||||
|
||||
// The number of ready replicas for this replication controller.
|
||||
ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"`
|
||||
|
||||
// ObservedGeneration reflects the generation of the most recently observed replication controller.
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
|
||||
}
|
||||
|
|
@ -2017,6 +2109,11 @@ const (
|
|||
// external load balancer (if the cloud provider supports it), in addition
|
||||
// to 'NodePort' type.
|
||||
ServiceTypeLoadBalancer ServiceType = "LoadBalancer"
|
||||
|
||||
// ServiceTypeExternalName means a service consists of only a reference to
|
||||
// an external name that kubedns or equivalent will return as a CNAME
|
||||
// record, with no exposing or proxying of any pods involved.
|
||||
ServiceTypeExternalName ServiceType = "ExternalName"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service.
|
||||
|
|
@ -2051,24 +2148,39 @@ type ServiceSpec struct {
|
|||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies
|
||||
Ports []ServicePort `json:"ports" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"`
|
||||
|
||||
// This service will route traffic to pods having labels matching this selector.
|
||||
// Label keys and values that must match in order to receive traffic for this service.
|
||||
// If not specified, endpoints must be manually specified and the system will not automatically manage them.
|
||||
// Route service traffic to pods with label keys and values matching this
|
||||
// selector. If empty or not present, the service is assumed to have an
|
||||
// external process managing its endpoints, which Kubernetes will not
|
||||
// modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
|
||||
// Ignored if type is ExternalName.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview
|
||||
Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
|
||||
|
||||
// ClusterIP is usually assigned by the master and is the IP address of the service.
|
||||
// If specified, it will be allocated to the service if it is unused
|
||||
// or else creation of the service will fail.
|
||||
// Valid values are None, empty string (""), or a valid IP address.
|
||||
// 'None' can be specified for a headless service when proxying is not required.
|
||||
// Cannot be updated.
|
||||
// clusterIP is the IP address of the service and is usually assigned
|
||||
// randomly by the master. If an address is specified manually and is not in
|
||||
// use by others, it will be allocated to the service; otherwise, creation
|
||||
// of the service will fail. This field can not be changed through updates.
|
||||
// Valid values are "None", empty string (""), or a valid IP address. "None"
|
||||
// can be specified for headless services when proxying is not required.
|
||||
// Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if
|
||||
// type is ExternalName.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies
|
||||
ClusterIP string `json:"clusterIP,omitempty" protobuf:"bytes,3,opt,name=clusterIP"`
|
||||
|
||||
// Type of exposed service. Must be ClusterIP, NodePort, or LoadBalancer.
|
||||
// Defaults to ClusterIP.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#external-services
|
||||
// type determines how the Service is exposed. Defaults to ClusterIP. Valid
|
||||
// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
|
||||
// "ExternalName" maps to the specified externalName.
|
||||
// "ClusterIP" allocates a cluster-internal IP address for load-balancing to
|
||||
// endpoints. Endpoints are determined by the selector or if that is not
|
||||
// specified, by manual construction of an Endpoints object. If clusterIP is
|
||||
// "None", no virtual IP is allocated and the endpoints are published as a
|
||||
// set of endpoints rather than a stable IP.
|
||||
// "NodePort" builds on ClusterIP and allocates a port on every node which
|
||||
// routes to the clusterIP.
|
||||
// "LoadBalancer" builds on NodePort and creates an
|
||||
// external load-balancer (if supported in the current cloud) which routes
|
||||
// to the clusterIP.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview
|
||||
Type ServiceType `json:"type,omitempty" protobuf:"bytes,4,opt,name=type,casttype=ServiceType"`
|
||||
|
||||
// externalIPs is a list of IP addresses for which nodes in the cluster
|
||||
|
|
@ -2107,6 +2219,11 @@ type ServiceSpec struct {
|
|||
// cloud-provider does not support the feature."
|
||||
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services-firewalls.md
|
||||
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty" protobuf:"bytes,9,opt,name=loadBalancerSourceRanges"`
|
||||
|
||||
// externalName is the external reference that kubedns or equivalent will
|
||||
// return as a CNAME record for this service. No proxying will be involved.
|
||||
// Must be a valid DNS name and requires Type to be ExternalName.
|
||||
ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"`
|
||||
}
|
||||
|
||||
// ServicePort contains information on service's port.
|
||||
|
|
@ -2279,6 +2396,8 @@ type EndpointAddress struct {
|
|||
IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
|
||||
// The Hostname of this endpoint
|
||||
Hostname string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"`
|
||||
// Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
|
||||
NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,4,opt,name=nodeName"`
|
||||
// Reference to object providing the endpoint.
|
||||
TargetRef *ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,2,opt,name=targetRef"`
|
||||
}
|
||||
|
|
@ -2376,6 +2495,7 @@ type NodeStatus struct {
|
|||
Allocatable ResourceList `json:"allocatable,omitempty" protobuf:"bytes,2,rep,name=allocatable,casttype=ResourceList,castkey=ResourceName"`
|
||||
// NodePhase is the recently observed lifecycle phase of the node.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase
|
||||
// The field is never populated, and now is deprecated.
|
||||
Phase NodePhase `json:"phase,omitempty" protobuf:"bytes,3,opt,name=phase,casttype=NodePhase"`
|
||||
// Conditions is an array of current observed node conditions.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-condition
|
||||
|
|
@ -2408,6 +2528,34 @@ type AttachedVolume struct {
|
|||
DevicePath string `json:"devicePath" protobuf:"bytes,2,rep,name=devicePath"`
|
||||
}
|
||||
|
||||
// AvoidPods describes pods that should avoid this node. This is the value for a
|
||||
// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and
|
||||
// will eventually become a field of NodeStatus.
|
||||
type AvoidPods struct {
|
||||
// Bounded-sized list of signatures of pods that should avoid this node, sorted
|
||||
// in timestamp order from oldest to newest. Size of the slice is unspecified.
|
||||
PreferAvoidPods []PreferAvoidPodsEntry `json:"preferAvoidPods,omitempty" protobuf:"bytes,1,rep,name=preferAvoidPods"`
|
||||
}
|
||||
|
||||
// Describes a class of pods that should avoid this node.
|
||||
type PreferAvoidPodsEntry struct {
|
||||
// The class of pods.
|
||||
PodSignature PodSignature `json:"podSignature" protobuf:"bytes,1,opt,name=podSignature"`
|
||||
// Time at which this entry was added to the list.
|
||||
EvictionTime unversioned.Time `json:"evictionTime,omitempty" protobuf:"bytes,2,opt,name=evictionTime"`
|
||||
// (brief) reason why this entry was added to the list.
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
|
||||
// Human readable message indicating why this entry was added to the list.
|
||||
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
|
||||
}
|
||||
|
||||
// Describes the class of pods that should avoid this node.
|
||||
// Exactly one field should be set.
|
||||
type PodSignature struct {
|
||||
// Reference to controller whose pods should avoid this node.
|
||||
PodController *OwnerReference `json:"podController,omitempty" protobuf:"bytes,1,opt,name=podController"`
|
||||
}
|
||||
|
||||
// Describe a container image
|
||||
type ContainerImage struct {
|
||||
// Names by which this image is known.
|
||||
|
|
@ -2442,6 +2590,8 @@ const (
|
|||
NodeOutOfDisk NodeConditionType = "OutOfDisk"
|
||||
// NodeMemoryPressure means the kubelet is under pressure due to insufficient available memory.
|
||||
NodeMemoryPressure NodeConditionType = "MemoryPressure"
|
||||
// NodeDiskPressure means the kubelet is under pressure due to insufficient available disk.
|
||||
NodeDiskPressure NodeConditionType = "DiskPressure"
|
||||
// NodeNetworkUnavailable means that network for the node is not correctly configured.
|
||||
NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable"
|
||||
)
|
||||
|
|
@ -3010,6 +3160,8 @@ const (
|
|||
ResourceRequestsCPU ResourceName = "requests.cpu"
|
||||
// Memory request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
|
||||
ResourceRequestsMemory ResourceName = "requests.memory"
|
||||
// Storage request, in bytes
|
||||
ResourceRequestsStorage ResourceName = "requests.storage"
|
||||
// CPU limit, in cores. (500m = .5 cores)
|
||||
ResourceLimitsCPU ResourceName = "limits.cpu"
|
||||
// Memory limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
|
||||
|
|
@ -3252,8 +3404,18 @@ type ComponentStatusList struct {
|
|||
type DownwardAPIVolumeSource struct {
|
||||
// Items is a list of downward API volume file
|
||||
Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"`
|
||||
// Optional: mode bits to use on created files by default. Must be a
|
||||
// value between 0 and 0777. Defaults to 0644.
|
||||
// Directories within the path are not affected by this setting.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"`
|
||||
}
|
||||
|
||||
const (
|
||||
DownwardAPIVolumeSourceDefaultMode int32 = 0644
|
||||
)
|
||||
|
||||
// DownwardAPIVolumeFile represents information to create the file containing the pod field
|
||||
type DownwardAPIVolumeFile struct {
|
||||
// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
|
||||
|
|
@ -3263,6 +3425,11 @@ type DownwardAPIVolumeFile struct {
|
|||
// Selects a resource of the container: only resources limits and requests
|
||||
// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
|
||||
ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" protobuf:"bytes,3,opt,name=resourceFieldRef"`
|
||||
// Optional: mode bits to use on this file, must be a value between 0
|
||||
// and 0777. If not specified, the volume defaultMode will be used.
|
||||
// This might be in conflict with other options that affect the file
|
||||
// mode, like fsGroup, and the result can be other mode bits set.
|
||||
Mode *int32 `json:"mode,omitempty" protobuf:"varint,4,opt,name=mode"`
|
||||
}
|
||||
|
||||
// SecurityContext holds security configuration that will be applied to a container.
|
||||
|
|
|
|||
97
vendor/k8s.io/kubernetes/pkg/api/v1/types_swagger_doc_generated.go
generated
vendored
97
vendor/k8s.io/kubernetes/pkg/api/v1/types_swagger_doc_generated.go
generated
vendored
|
|
@ -60,6 +60,28 @@ func (AttachedVolume) SwaggerDoc() map[string]string {
|
|||
return map_AttachedVolume
|
||||
}
|
||||
|
||||
var map_AvoidPods = map[string]string{
|
||||
"": "AvoidPods describes pods that should avoid this node. This is the value for a Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and will eventually become a field of NodeStatus.",
|
||||
"preferAvoidPods": "Bounded-sized list of signatures of pods that should avoid this node, sorted in timestamp order from oldest to newest. Size of the slice is unspecified.",
|
||||
}
|
||||
|
||||
func (AvoidPods) SwaggerDoc() map[string]string {
|
||||
return map_AvoidPods
|
||||
}
|
||||
|
||||
var map_AzureDiskVolumeSource = map[string]string{
|
||||
"": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.",
|
||||
"diskName": "The Name of the data disk in the blob storage",
|
||||
"diskURI": "The URI the data disk in the blob storage",
|
||||
"cachingMode": "Host Caching mode: None, Read Only, Read Write.",
|
||||
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
|
||||
"readOnly": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",
|
||||
}
|
||||
|
||||
func (AzureDiskVolumeSource) SwaggerDoc() map[string]string {
|
||||
return map_AzureDiskVolumeSource
|
||||
}
|
||||
|
||||
var map_AzureFileVolumeSource = map[string]string{
|
||||
"": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.",
|
||||
"secretName": "the name of secret that contains Azure Storage Account Name and Key",
|
||||
|
|
@ -178,8 +200,9 @@ func (ConfigMapList) SwaggerDoc() map[string]string {
|
|||
}
|
||||
|
||||
var map_ConfigMapVolumeSource = map[string]string{
|
||||
"": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.",
|
||||
"items": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.",
|
||||
"": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.",
|
||||
"items": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.",
|
||||
"defaultMode": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
|
||||
}
|
||||
|
||||
func (ConfigMapVolumeSource) SwaggerDoc() map[string]string {
|
||||
|
|
@ -321,6 +344,7 @@ var map_DownwardAPIVolumeFile = map[string]string{
|
|||
"path": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'",
|
||||
"fieldRef": "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.",
|
||||
"resourceFieldRef": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.",
|
||||
"mode": "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
|
||||
}
|
||||
|
||||
func (DownwardAPIVolumeFile) SwaggerDoc() map[string]string {
|
||||
|
|
@ -328,8 +352,9 @@ func (DownwardAPIVolumeFile) SwaggerDoc() map[string]string {
|
|||
}
|
||||
|
||||
var map_DownwardAPIVolumeSource = map[string]string{
|
||||
"": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.",
|
||||
"items": "Items is a list of downward API volume file",
|
||||
"": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.",
|
||||
"items": "Items is a list of downward API volume file",
|
||||
"defaultMode": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
|
||||
}
|
||||
|
||||
func (DownwardAPIVolumeSource) SwaggerDoc() map[string]string {
|
||||
|
|
@ -349,6 +374,7 @@ var map_EndpointAddress = map[string]string{
|
|||
"": "EndpointAddress is a tuple that describes single IP address.",
|
||||
"ip": "The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.",
|
||||
"hostname": "The Hostname of this endpoint",
|
||||
"nodeName": "Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.",
|
||||
"targetRef": "Reference to object providing the endpoint.",
|
||||
}
|
||||
|
||||
|
|
@ -411,7 +437,7 @@ func (EnvVar) SwaggerDoc() map[string]string {
|
|||
|
||||
var map_EnvVarSource = map[string]string{
|
||||
"": "EnvVarSource represents a source for the value of an EnvVar.",
|
||||
"fieldRef": "Selects a field of the pod; only name and namespace are supported.",
|
||||
"fieldRef": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP.",
|
||||
"resourceFieldRef": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.",
|
||||
"configMapKeyRef": "Selects a key of a ConfigMap.",
|
||||
"secretKeyRef": "Selects a key of a secret in the pod's namespace",
|
||||
|
|
@ -606,6 +632,7 @@ var map_KeyToPath = map[string]string{
|
|||
"": "Maps a string key to a path within a volume.",
|
||||
"key": "The key to project.",
|
||||
"path": "The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.",
|
||||
"mode": "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
|
||||
}
|
||||
|
||||
func (KeyToPath) SwaggerDoc() map[string]string {
|
||||
|
|
@ -884,7 +911,7 @@ var map_NodeStatus = map[string]string{
|
|||
"": "NodeStatus is information about the current status of a node.",
|
||||
"capacity": "Capacity represents the total resources of a node. More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#capacity for more details.",
|
||||
"allocatable": "Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.",
|
||||
"phase": "NodePhase is the recently observed lifecycle phase of the node. More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase",
|
||||
"phase": "NodePhase is the recently observed lifecycle phase of the node. More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase The field is never populated, and now is deprecated.",
|
||||
"conditions": "Conditions is an array of current observed node conditions. More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-condition",
|
||||
"addresses": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-addresses",
|
||||
"daemonEndpoints": "Endpoints of daemons running on the Node.",
|
||||
|
|
@ -942,6 +969,7 @@ var map_ObjectMeta = map[string]string{
|
|||
"annotations": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://releases.k8s.io/HEAD/docs/user-guide/annotations.md",
|
||||
"ownerReferences": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.",
|
||||
"finalizers": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.",
|
||||
"clusterName": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.",
|
||||
}
|
||||
|
||||
func (ObjectMeta) SwaggerDoc() map[string]string {
|
||||
|
|
@ -1067,6 +1095,8 @@ var map_PersistentVolumeSource = map[string]string{
|
|||
"flexVolume": "FlexVolume represents a generic volume resource that is provisioned/attached using a exec based plugin. This is an alpha feature and may change in future.",
|
||||
"azureFile": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.",
|
||||
"vsphereVolume": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine",
|
||||
"quobyte": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime",
|
||||
"azureDisk": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.",
|
||||
}
|
||||
|
||||
func (PersistentVolumeSource) SwaggerDoc() map[string]string {
|
||||
|
|
@ -1227,6 +1257,15 @@ func (PodSecurityContext) SwaggerDoc() map[string]string {
|
|||
return map_PodSecurityContext
|
||||
}
|
||||
|
||||
var map_PodSignature = map[string]string{
|
||||
"": "Describes the class of pods that should avoid this node. Exactly one field should be set.",
|
||||
"podController": "Reference to controller whose pods should avoid this node.",
|
||||
}
|
||||
|
||||
func (PodSignature) SwaggerDoc() map[string]string {
|
||||
return map_PodSignature
|
||||
}
|
||||
|
||||
var map_PodSpec = map[string]string{
|
||||
"": "PodSpec is a description of a pod.",
|
||||
"volumes": "List of volumes that can be mounted by containers belonging to the pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md",
|
||||
|
|
@ -1317,6 +1356,18 @@ func (Preconditions) SwaggerDoc() map[string]string {
|
|||
return map_Preconditions
|
||||
}
|
||||
|
||||
var map_PreferAvoidPodsEntry = map[string]string{
|
||||
"": "Describes a class of pods that should avoid this node.",
|
||||
"podSignature": "The class of pods.",
|
||||
"evictionTime": "Time at which this entry was added to the list.",
|
||||
"reason": "(brief) reason why this entry was added to the list.",
|
||||
"message": "Human readable message indicating why this entry was added to the list.",
|
||||
}
|
||||
|
||||
func (PreferAvoidPodsEntry) SwaggerDoc() map[string]string {
|
||||
return map_PreferAvoidPodsEntry
|
||||
}
|
||||
|
||||
var map_PreferredSchedulingTerm = map[string]string{
|
||||
"": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).",
|
||||
"weight": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.",
|
||||
|
|
@ -1340,6 +1391,19 @@ func (Probe) SwaggerDoc() map[string]string {
|
|||
return map_Probe
|
||||
}
|
||||
|
||||
var map_QuobyteVolumeSource = map[string]string{
|
||||
"": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.",
|
||||
"registry": "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes",
|
||||
"volume": "Volume is a string that references an already created Quobyte volume by name.",
|
||||
"readOnly": "ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.",
|
||||
"user": "User to map volume access to Defaults to serivceaccount user",
|
||||
"group": "Group to map volume access to Default is no group",
|
||||
}
|
||||
|
||||
func (QuobyteVolumeSource) SwaggerDoc() map[string]string {
|
||||
return map_QuobyteVolumeSource
|
||||
}
|
||||
|
||||
var map_RBDVolumeSource = map[string]string{
|
||||
"": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.",
|
||||
"monitors": "A collection of Ceph monitors. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it",
|
||||
|
|
@ -1403,6 +1467,7 @@ var map_ReplicationControllerStatus = map[string]string{
|
|||
"": "ReplicationControllerStatus represents the current status of a replication controller.",
|
||||
"replicas": "Replicas is the most recently oberved number of replicas. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller",
|
||||
"fullyLabeledReplicas": "The number of pods that have labels matching the labels of the pod template of the replication controller.",
|
||||
"readyReplicas": "The number of ready replicas for this replication controller.",
|
||||
"observedGeneration": "ObservedGeneration reflects the generation of the most recently observed replication controller.",
|
||||
}
|
||||
|
||||
|
|
@ -1464,8 +1529,8 @@ func (ResourceQuotaStatus) SwaggerDoc() map[string]string {
|
|||
|
||||
var map_ResourceRequirements = map[string]string{
|
||||
"": "ResourceRequirements describes the compute resource requirements.",
|
||||
"limits": "Limits describes the maximum amount of compute resources allowed. More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications",
|
||||
"requests": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications",
|
||||
"limits": "Limits describes the maximum amount of compute resources allowed. More info: http://kubernetes.io/docs/user-guide/compute-resources/",
|
||||
"requests": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: http://kubernetes.io/docs/user-guide/compute-resources/",
|
||||
}
|
||||
|
||||
func (ResourceRequirements) SwaggerDoc() map[string]string {
|
||||
|
|
@ -1516,9 +1581,10 @@ func (SecretList) SwaggerDoc() map[string]string {
|
|||
}
|
||||
|
||||
var map_SecretVolumeSource = map[string]string{
|
||||
"": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.",
|
||||
"secretName": "Name of the secret in the pod's namespace to use. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#secrets",
|
||||
"items": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.",
|
||||
"": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.",
|
||||
"secretName": "Name of the secret in the pod's namespace to use. More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#secrets",
|
||||
"items": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.",
|
||||
"defaultMode": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
|
||||
}
|
||||
|
||||
func (SecretVolumeSource) SwaggerDoc() map[string]string {
|
||||
|
|
@ -1615,14 +1681,15 @@ func (ServiceProxyOptions) SwaggerDoc() map[string]string {
|
|||
var map_ServiceSpec = map[string]string{
|
||||
"": "ServiceSpec describes the attributes that a user creates on a service.",
|
||||
"ports": "The list of ports that are exposed by this service. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies",
|
||||
"selector": "This service will route traffic to pods having labels matching this selector. Label keys and values that must match in order to receive traffic for this service. If not specified, endpoints must be manually specified and the system will not automatically manage them. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview",
|
||||
"clusterIP": "ClusterIP is usually assigned by the master and is the IP address of the service. If specified, it will be allocated to the service if it is unused or else creation of the service will fail. Valid values are None, empty string (\"\"), or a valid IP address. 'None' can be specified for a headless service when proxying is not required. Cannot be updated. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies",
|
||||
"type": "Type of exposed service. Must be ClusterIP, NodePort, or LoadBalancer. Defaults to ClusterIP. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#external-services",
|
||||
"selector": "Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview",
|
||||
"clusterIP": "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies",
|
||||
"type": "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ExternalName\" maps to the specified externalName. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview",
|
||||
"externalIPs": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. A previous form of this functionality exists as the deprecatedPublicIPs field. When using this field, callers should also clear the deprecatedPublicIPs field.",
|
||||
"deprecatedPublicIPs": "deprecatedPublicIPs is deprecated and replaced by the externalIPs field with almost the exact same semantics. This field is retained in the v1 API for compatibility until at least 8/20/2016. It will be removed from any new API revisions. If both deprecatedPublicIPs *and* externalIPs are set, deprecatedPublicIPs is used.",
|
||||
"sessionAffinity": "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies",
|
||||
"loadBalancerIP": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.",
|
||||
"loadBalancerSourceRanges": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: http://releases.k8s.io/HEAD/docs/user-guide/services-firewalls.md",
|
||||
"externalName": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName.",
|
||||
}
|
||||
|
||||
func (ServiceSpec) SwaggerDoc() map[string]string {
|
||||
|
|
@ -1713,6 +1780,8 @@ var map_VolumeSource = map[string]string{
|
|||
"azureFile": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.",
|
||||
"configMap": "ConfigMap represents a configMap that should populate this volume",
|
||||
"vsphereVolume": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine",
|
||||
"quobyte": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime",
|
||||
"azureDisk": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.",
|
||||
}
|
||||
|
||||
func (VolumeSource) SwaggerDoc() map[string]string {
|
||||
|
|
|
|||
|
|
@ -29,13 +29,23 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
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_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource,
|
||||
Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource,
|
||||
Convert_v1_Affinity_To_api_Affinity,
|
||||
Convert_api_Affinity_To_v1_Affinity,
|
||||
Convert_v1_AttachedVolume_To_api_AttachedVolume,
|
||||
Convert_api_AttachedVolume_To_v1_AttachedVolume,
|
||||
Convert_v1_AvoidPods_To_api_AvoidPods,
|
||||
Convert_api_AvoidPods_To_v1_AvoidPods,
|
||||
Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource,
|
||||
Convert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource,
|
||||
Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource,
|
||||
Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource,
|
||||
Convert_v1_Binding_To_api_Binding,
|
||||
|
|
@ -240,6 +250,8 @@ func init() {
|
|||
Convert_api_PodProxyOptions_To_v1_PodProxyOptions,
|
||||
Convert_v1_PodSecurityContext_To_api_PodSecurityContext,
|
||||
Convert_api_PodSecurityContext_To_v1_PodSecurityContext,
|
||||
Convert_v1_PodSignature_To_api_PodSignature,
|
||||
Convert_api_PodSignature_To_v1_PodSignature,
|
||||
Convert_v1_PodSpec_To_api_PodSpec,
|
||||
Convert_api_PodSpec_To_v1_PodSpec,
|
||||
Convert_v1_PodStatus_To_api_PodStatus,
|
||||
|
|
@ -254,10 +266,14 @@ func init() {
|
|||
Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec,
|
||||
Convert_v1_Preconditions_To_api_Preconditions,
|
||||
Convert_api_Preconditions_To_v1_Preconditions,
|
||||
Convert_v1_PreferAvoidPodsEntry_To_api_PreferAvoidPodsEntry,
|
||||
Convert_api_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry,
|
||||
Convert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm,
|
||||
Convert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm,
|
||||
Convert_v1_Probe_To_api_Probe,
|
||||
Convert_api_Probe_To_v1_Probe,
|
||||
Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource,
|
||||
Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource,
|
||||
Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource,
|
||||
Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource,
|
||||
Convert_v1_RangeAllocation_To_api_RangeAllocation,
|
||||
|
|
@ -328,10 +344,7 @@ func init() {
|
|||
Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource,
|
||||
Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm,
|
||||
Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm,
|
||||
); err != nil {
|
||||
// if one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
func autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in *AWSElasticBlockStoreVolumeSource, out *api.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error {
|
||||
|
|
@ -448,6 +461,83 @@ func Convert_api_AttachedVolume_To_v1_AttachedVolume(in *api.AttachedVolume, out
|
|||
return autoConvert_api_AttachedVolume_To_v1_AttachedVolume(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_AvoidPods_To_api_AvoidPods(in *AvoidPods, out *api.AvoidPods, s conversion.Scope) error {
|
||||
if in.PreferAvoidPods != nil {
|
||||
in, out := &in.PreferAvoidPods, &out.PreferAvoidPods
|
||||
*out = make([]api.PreferAvoidPodsEntry, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_PreferAvoidPodsEntry_To_api_PreferAvoidPodsEntry(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.PreferAvoidPods = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_AvoidPods_To_api_AvoidPods(in *AvoidPods, out *api.AvoidPods, s conversion.Scope) error {
|
||||
return autoConvert_v1_AvoidPods_To_api_AvoidPods(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_AvoidPods_To_v1_AvoidPods(in *api.AvoidPods, out *AvoidPods, s conversion.Scope) error {
|
||||
if in.PreferAvoidPods != nil {
|
||||
in, out := &in.PreferAvoidPods, &out.PreferAvoidPods
|
||||
*out = make([]PreferAvoidPodsEntry, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_api_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.PreferAvoidPods = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_AvoidPods_To_v1_AvoidPods(in *api.AvoidPods, out *AvoidPods, s conversion.Scope) error {
|
||||
return autoConvert_api_AvoidPods_To_v1_AvoidPods(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in *AzureDiskVolumeSource, out *api.AzureDiskVolumeSource, s conversion.Scope) error {
|
||||
SetDefaults_AzureDiskVolumeSource(in)
|
||||
out.DiskName = in.DiskName
|
||||
out.DataDiskURI = in.DataDiskURI
|
||||
if in.CachingMode != nil {
|
||||
in, out := &in.CachingMode, &out.CachingMode
|
||||
*out = new(api.AzureDataDiskCachingMode)
|
||||
**out = api.AzureDataDiskCachingMode(**in)
|
||||
} else {
|
||||
out.CachingMode = nil
|
||||
}
|
||||
out.FSType = in.FSType
|
||||
out.ReadOnly = in.ReadOnly
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in *AzureDiskVolumeSource, out *api.AzureDiskVolumeSource, s conversion.Scope) error {
|
||||
return autoConvert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *api.AzureDiskVolumeSource, out *AzureDiskVolumeSource, s conversion.Scope) error {
|
||||
out.DiskName = in.DiskName
|
||||
out.DataDiskURI = in.DataDiskURI
|
||||
if in.CachingMode != nil {
|
||||
in, out := &in.CachingMode, &out.CachingMode
|
||||
*out = new(AzureDataDiskCachingMode)
|
||||
**out = AzureDataDiskCachingMode(**in)
|
||||
} else {
|
||||
out.CachingMode = nil
|
||||
}
|
||||
out.FSType = in.FSType
|
||||
out.ReadOnly = in.ReadOnly
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *api.AzureDiskVolumeSource, out *AzureDiskVolumeSource, s conversion.Scope) error {
|
||||
return autoConvert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error {
|
||||
out.SecretName = in.SecretName
|
||||
out.ShareName = in.ShareName
|
||||
|
|
@ -852,6 +942,7 @@ func Convert_api_ConfigMapList_To_v1_ConfigMapList(in *api.ConfigMapList, out *C
|
|||
}
|
||||
|
||||
func autoConvert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in *ConfigMapVolumeSource, out *api.ConfigMapVolumeSource, s conversion.Scope) error {
|
||||
SetDefaults_ConfigMapVolumeSource(in)
|
||||
if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -866,6 +957,7 @@ func autoConvert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in *Confi
|
|||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
out.DefaultMode = in.DefaultMode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -888,6 +980,7 @@ func autoConvert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *api.C
|
|||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
out.DefaultMode = in.DefaultMode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1395,6 +1488,7 @@ func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *Downw
|
|||
} else {
|
||||
out.ResourceFieldRef = nil
|
||||
}
|
||||
out.Mode = in.Mode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1422,6 +1516,7 @@ func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.D
|
|||
} else {
|
||||
out.ResourceFieldRef = nil
|
||||
}
|
||||
out.Mode = in.Mode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1430,6 +1525,7 @@ func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.Downw
|
|||
}
|
||||
|
||||
func autoConvert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *DownwardAPIVolumeSource, out *api.DownwardAPIVolumeSource, s conversion.Scope) error {
|
||||
SetDefaults_DownwardAPIVolumeSource(in)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]api.DownwardAPIVolumeFile, len(*in))
|
||||
|
|
@ -1441,6 +1537,7 @@ func autoConvert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *D
|
|||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
out.DefaultMode = in.DefaultMode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1460,6 +1557,7 @@ func autoConvert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in *a
|
|||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
out.DefaultMode = in.DefaultMode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1488,6 +1586,7 @@ func Convert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in *api.EmptyDi
|
|||
func autoConvert_v1_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out *api.EndpointAddress, s conversion.Scope) error {
|
||||
out.IP = in.IP
|
||||
out.Hostname = in.Hostname
|
||||
out.NodeName = in.NodeName
|
||||
if in.TargetRef != nil {
|
||||
in, out := &in.TargetRef, &out.TargetRef
|
||||
*out = new(api.ObjectReference)
|
||||
|
|
@ -1507,6 +1606,7 @@ func Convert_v1_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out
|
|||
func autoConvert_api_EndpointAddress_To_v1_EndpointAddress(in *api.EndpointAddress, out *EndpointAddress, s conversion.Scope) error {
|
||||
out.IP = in.IP
|
||||
out.Hostname = in.Hostname
|
||||
out.NodeName = in.NodeName
|
||||
if in.TargetRef != nil {
|
||||
in, out := &in.TargetRef, &out.TargetRef
|
||||
*out = new(ObjectReference)
|
||||
|
|
@ -2371,6 +2471,7 @@ func Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *api.ISCSIVolumeSo
|
|||
func autoConvert_v1_KeyToPath_To_api_KeyToPath(in *KeyToPath, out *api.KeyToPath, s conversion.Scope) error {
|
||||
out.Key = in.Key
|
||||
out.Path = in.Path
|
||||
out.Mode = in.Mode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -2381,6 +2482,7 @@ func Convert_v1_KeyToPath_To_api_KeyToPath(in *KeyToPath, out *api.KeyToPath, s
|
|||
func autoConvert_api_KeyToPath_To_v1_KeyToPath(in *api.KeyToPath, out *KeyToPath, s conversion.Scope) error {
|
||||
out.Key = in.Key
|
||||
out.Path = in.Path
|
||||
out.Mode = in.Mode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -3616,6 +3718,7 @@ func autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in *ObjectMeta, out *api.Object
|
|||
out.OwnerReferences = nil
|
||||
}
|
||||
out.Finalizers = in.Finalizers
|
||||
out.ClusterName = in.ClusterName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -3650,6 +3753,7 @@ func autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *Object
|
|||
out.OwnerReferences = nil
|
||||
}
|
||||
out.Finalizers = in.Finalizers
|
||||
out.ClusterName = in.ClusterName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -4138,6 +4242,24 @@ func autoConvert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *Per
|
|||
} else {
|
||||
out.VsphereVolume = nil
|
||||
}
|
||||
if in.Quobyte != nil {
|
||||
in, out := &in.Quobyte, &out.Quobyte
|
||||
*out = new(api.QuobyteVolumeSource)
|
||||
if err := Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Quobyte = nil
|
||||
}
|
||||
if in.AzureDisk != nil {
|
||||
in, out := &in.AzureDisk, &out.AzureDisk
|
||||
*out = new(api.AzureDiskVolumeSource)
|
||||
if err := Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.AzureDisk = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -4200,6 +4322,15 @@ func autoConvert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api
|
|||
} else {
|
||||
out.RBD = nil
|
||||
}
|
||||
if in.Quobyte != nil {
|
||||
in, out := &in.Quobyte, &out.Quobyte
|
||||
*out = new(QuobyteVolumeSource)
|
||||
if err := Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Quobyte = nil
|
||||
}
|
||||
if in.ISCSI != nil {
|
||||
in, out := &in.ISCSI, &out.ISCSI
|
||||
*out = new(ISCSIVolumeSource)
|
||||
|
|
@ -4272,6 +4403,15 @@ func autoConvert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api
|
|||
} else {
|
||||
out.VsphereVolume = nil
|
||||
}
|
||||
if in.AzureDisk != nil {
|
||||
in, out := &in.AzureDisk, &out.AzureDisk
|
||||
*out = new(AzureDiskVolumeSource)
|
||||
if err := Convert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.AzureDisk = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -4802,6 +4942,40 @@ func autoConvert_api_PodSecurityContext_To_v1_PodSecurityContext(in *api.PodSecu
|
|||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1_PodSignature_To_api_PodSignature(in *PodSignature, out *api.PodSignature, s conversion.Scope) error {
|
||||
if in.PodController != nil {
|
||||
in, out := &in.PodController, &out.PodController
|
||||
*out = new(api.OwnerReference)
|
||||
if err := Convert_v1_OwnerReference_To_api_OwnerReference(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.PodController = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_PodSignature_To_api_PodSignature(in *PodSignature, out *api.PodSignature, s conversion.Scope) error {
|
||||
return autoConvert_v1_PodSignature_To_api_PodSignature(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_PodSignature_To_v1_PodSignature(in *api.PodSignature, out *PodSignature, s conversion.Scope) error {
|
||||
if in.PodController != nil {
|
||||
in, out := &in.PodController, &out.PodController
|
||||
*out = new(OwnerReference)
|
||||
if err := Convert_api_OwnerReference_To_v1_OwnerReference(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.PodController = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_PodSignature_To_v1_PodSignature(in *api.PodSignature, out *PodSignature, s conversion.Scope) error {
|
||||
return autoConvert_api_PodSignature_To_v1_PodSignature(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conversion.Scope) error {
|
||||
SetDefaults_PodSpec(in)
|
||||
if in.Volumes != nil {
|
||||
|
|
@ -5177,6 +5351,38 @@ func Convert_api_Preconditions_To_v1_Preconditions(in *api.Preconditions, out *P
|
|||
return autoConvert_api_Preconditions_To_v1_Preconditions(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_PreferAvoidPodsEntry_To_api_PreferAvoidPodsEntry(in *PreferAvoidPodsEntry, out *api.PreferAvoidPodsEntry, s conversion.Scope) error {
|
||||
if err := Convert_v1_PodSignature_To_api_PodSignature(&in.PodSignature, &out.PodSignature, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.EvictionTime, &out.EvictionTime, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_PreferAvoidPodsEntry_To_api_PreferAvoidPodsEntry(in *PreferAvoidPodsEntry, out *api.PreferAvoidPodsEntry, s conversion.Scope) error {
|
||||
return autoConvert_v1_PreferAvoidPodsEntry_To_api_PreferAvoidPodsEntry(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(in *api.PreferAvoidPodsEntry, out *PreferAvoidPodsEntry, s conversion.Scope) error {
|
||||
if err := Convert_api_PodSignature_To_v1_PodSignature(&in.PodSignature, &out.PodSignature, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.EvictionTime, &out.EvictionTime, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(in *api.PreferAvoidPodsEntry, out *PreferAvoidPodsEntry, s conversion.Scope) error {
|
||||
return autoConvert_api_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm(in *PreferredSchedulingTerm, out *api.PreferredSchedulingTerm, s conversion.Scope) error {
|
||||
out.Weight = in.Weight
|
||||
if err := Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(&in.Preference, &out.Preference, s); err != nil {
|
||||
|
|
@ -5234,6 +5440,32 @@ func Convert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.Scope
|
|||
return autoConvert_api_Probe_To_v1_Probe(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(in *QuobyteVolumeSource, out *api.QuobyteVolumeSource, s conversion.Scope) error {
|
||||
out.Registry = in.Registry
|
||||
out.Volume = in.Volume
|
||||
out.ReadOnly = in.ReadOnly
|
||||
out.User = in.User
|
||||
out.Group = in.Group
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(in *QuobyteVolumeSource, out *api.QuobyteVolumeSource, s conversion.Scope) error {
|
||||
return autoConvert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in *api.QuobyteVolumeSource, out *QuobyteVolumeSource, s conversion.Scope) error {
|
||||
out.Registry = in.Registry
|
||||
out.Volume = in.Volume
|
||||
out.ReadOnly = in.ReadOnly
|
||||
out.User = in.User
|
||||
out.Group = in.Group
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in *api.QuobyteVolumeSource, out *QuobyteVolumeSource, s conversion.Scope) error {
|
||||
return autoConvert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out *api.RBDVolumeSource, s conversion.Scope) error {
|
||||
SetDefaults_RBDVolumeSource(in)
|
||||
out.CephMonitors = in.CephMonitors
|
||||
|
|
@ -5410,9 +5642,44 @@ func Convert_api_ReplicationControllerList_To_v1_ReplicationControllerList(in *a
|
|||
return autoConvert_api_ReplicationControllerList_To_v1_ReplicationControllerList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(in *ReplicationControllerSpec, out *api.ReplicationControllerSpec, s conversion.Scope) error {
|
||||
if err := api.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Selector = in.Selector
|
||||
if in.Template != nil {
|
||||
in, out := &in.Template, &out.Template
|
||||
*out = new(api.PodTemplateSpec)
|
||||
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Template = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *api.ReplicationControllerSpec, out *ReplicationControllerSpec, s conversion.Scope) error {
|
||||
if err := api.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Selector = in.Selector
|
||||
if in.Template != nil {
|
||||
in, out := &in.Template, &out.Template
|
||||
*out = new(PodTemplateSpec)
|
||||
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Template = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus(in *ReplicationControllerStatus, out *api.ReplicationControllerStatus, s conversion.Scope) error {
|
||||
out.Replicas = in.Replicas
|
||||
out.FullyLabeledReplicas = in.FullyLabeledReplicas
|
||||
out.ReadyReplicas = in.ReadyReplicas
|
||||
out.ObservedGeneration = in.ObservedGeneration
|
||||
return nil
|
||||
}
|
||||
|
|
@ -5424,6 +5691,7 @@ func Convert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus(i
|
|||
func autoConvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in *api.ReplicationControllerStatus, out *ReplicationControllerStatus, s conversion.Scope) error {
|
||||
out.Replicas = in.Replicas
|
||||
out.FullyLabeledReplicas = in.FullyLabeledReplicas
|
||||
out.ReadyReplicas = in.ReadyReplicas
|
||||
out.ObservedGeneration = in.ObservedGeneration
|
||||
return nil
|
||||
}
|
||||
|
|
@ -5822,6 +6090,7 @@ func Convert_api_SecretList_To_v1_SecretList(in *api.SecretList, out *SecretList
|
|||
}
|
||||
|
||||
func autoConvert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSource, out *api.SecretVolumeSource, s conversion.Scope) error {
|
||||
SetDefaults_SecretVolumeSource(in)
|
||||
out.SecretName = in.SecretName
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
|
|
@ -5834,6 +6103,7 @@ func autoConvert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolum
|
|||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
out.DefaultMode = in.DefaultMode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -5854,6 +6124,7 @@ func autoConvert_api_SecretVolumeSource_To_v1_SecretVolumeSource(in *api.SecretV
|
|||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
out.DefaultMode = in.DefaultMode
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -6235,6 +6506,7 @@ func autoConvert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.Ser
|
|||
out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity)
|
||||
out.LoadBalancerIP = in.LoadBalancerIP
|
||||
out.LoadBalancerSourceRanges = in.LoadBalancerSourceRanges
|
||||
out.ExternalName = in.ExternalName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -6253,6 +6525,7 @@ func autoConvert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *Ser
|
|||
}
|
||||
out.Selector = in.Selector
|
||||
out.ClusterIP = in.ClusterIP
|
||||
out.ExternalName = in.ExternalName
|
||||
out.ExternalIPs = in.ExternalIPs
|
||||
out.LoadBalancerIP = in.LoadBalancerIP
|
||||
out.SessionAffinity = ServiceAffinity(in.SessionAffinity)
|
||||
|
|
@ -6580,6 +6853,24 @@ func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.
|
|||
} else {
|
||||
out.VsphereVolume = nil
|
||||
}
|
||||
if in.Quobyte != nil {
|
||||
in, out := &in.Quobyte, &out.Quobyte
|
||||
*out = new(api.QuobyteVolumeSource)
|
||||
if err := Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Quobyte = nil
|
||||
}
|
||||
if in.AzureDisk != nil {
|
||||
in, out := &in.AzureDisk, &out.AzureDisk
|
||||
*out = new(api.AzureDiskVolumeSource)
|
||||
if err := Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.AzureDisk = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -6687,6 +6978,15 @@ func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *
|
|||
} else {
|
||||
out.RBD = nil
|
||||
}
|
||||
if in.Quobyte != nil {
|
||||
in, out := &in.Quobyte, &out.Quobyte
|
||||
*out = new(QuobyteVolumeSource)
|
||||
if err := Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Quobyte = nil
|
||||
}
|
||||
if in.FlexVolume != nil {
|
||||
in, out := &in.FlexVolume, &out.FlexVolume
|
||||
*out = new(FlexVolumeSource)
|
||||
|
|
@ -6768,6 +7068,15 @@ func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *
|
|||
} else {
|
||||
out.VsphereVolume = nil
|
||||
}
|
||||
if in.AzureDisk != nil {
|
||||
in, out := &in.AzureDisk, &out.AzureDisk
|
||||
*out = new(AzureDiskVolumeSource)
|
||||
if err := Convert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.AzureDisk = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
3703
vendor/k8s.io/kubernetes/pkg/api/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
3703
vendor/k8s.io/kubernetes/pkg/api/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
57
vendor/k8s.io/kubernetes/pkg/api/validation/events.go
generated
vendored
57
vendor/k8s.io/kubernetes/pkg/api/validation/events.go
generated
vendored
|
|
@ -17,7 +17,13 @@ limitations under the License.
|
|||
package validation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
apiutil "k8s.io/kubernetes/pkg/api/util"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/util/validation"
|
||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||
)
|
||||
|
|
@ -25,21 +31,50 @@ import (
|
|||
// ValidateEvent makes sure that the event makes sense.
|
||||
func ValidateEvent(event *api.Event) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
// There is no namespace required for node or persistent volume.
|
||||
// However, older client code accidentally sets event.Namespace
|
||||
// to api.NamespaceDefault, so we accept that too, but "" is preferred.
|
||||
if (event.InvolvedObject.Kind == "Node" || event.InvolvedObject.Kind == "PersistentVolume") &&
|
||||
event.Namespace != api.NamespaceDefault &&
|
||||
event.Namespace != "" {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "not allowed for node"))
|
||||
|
||||
// Make sure event.Namespace and the involvedObject.Namespace agree
|
||||
if len(event.InvolvedObject.Namespace) == 0 {
|
||||
// event.Namespace must also be empty (or "default", for compatibility with old clients)
|
||||
if event.Namespace != api.NamespaceNone && event.Namespace != api.NamespaceDefault {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "does not match event.namespace"))
|
||||
}
|
||||
} else {
|
||||
// event namespace must match
|
||||
if event.Namespace != event.InvolvedObject.Namespace {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "does not match event.namespace"))
|
||||
}
|
||||
}
|
||||
if event.InvolvedObject.Kind != "Node" &&
|
||||
event.InvolvedObject.Kind != "PersistentVolume" &&
|
||||
event.Namespace != event.InvolvedObject.Namespace {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, "does not match involvedObject"))
|
||||
|
||||
// For kinds we recognize, make sure involvedObject.Namespace is set for namespaced kinds
|
||||
if namespaced, err := isNamespacedKind(event.InvolvedObject.Kind, event.InvolvedObject.APIVersion); err == nil {
|
||||
if namespaced && len(event.InvolvedObject.Namespace) == 0 {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("involvedObject", "namespace"), fmt.Sprintf("required for kind %s", event.InvolvedObject.Kind)))
|
||||
}
|
||||
if !namespaced && len(event.InvolvedObject.Namespace) > 0 {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("involvedObject", "namespace"), event.InvolvedObject.Namespace, fmt.Sprintf("not allowed for kind %s", event.InvolvedObject.Kind)))
|
||||
}
|
||||
}
|
||||
|
||||
for _, msg := range validation.IsDNS1123Subdomain(event.Namespace) {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("namespace"), event.Namespace, msg))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// Check whether the kind in groupVersion is scoped at the root of the api hierarchy
|
||||
func isNamespacedKind(kind, groupVersion string) (bool, error) {
|
||||
group := apiutil.GetGroup(groupVersion)
|
||||
g, err := registered.Group(group)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
restMapping, err := g.RESTMapper.RESTMapping(unversioned.GroupKind{Group: group, Kind: kind}, apiutil.GetVersion(groupVersion))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
scopeName := restMapping.Scope.Name()
|
||||
if scopeName == meta.RESTScopeNameNamespace {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
|
|
|||
544
vendor/k8s.io/kubernetes/pkg/api/validation/validation.go
generated
vendored
544
vendor/k8s.io/kubernetes/pkg/api/validation/validation.go
generated
vendored
|
|
@ -23,6 +23,7 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
|
@ -36,6 +37,7 @@ import (
|
|||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/capabilities"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/security/apparmor"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/util/validation"
|
||||
|
|
@ -52,6 +54,7 @@ const fieldImmutableErrorMsg string = `field is immutable`
|
|||
const isNotIntegerErrorMsg string = `must be an integer`
|
||||
|
||||
var pdPartitionErrorMsg string = validation.InclusiveRangeError(1, 255)
|
||||
var volumeModeErrorMsg string = "must be a number between 0 and 0777 (octal), both inclusive"
|
||||
|
||||
const totalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB
|
||||
|
||||
|
|
@ -100,7 +103,16 @@ func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList {
|
|||
return allErrs
|
||||
}
|
||||
|
||||
func ValidatePodSpecificAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
|
||||
// ValidateDNS1123Subdomain validates that a name is a proper DNS subdomain.
|
||||
func ValidateDNS1123Subdomain(value string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
for _, msg := range validation.IsDNS1123Subdomain(value) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, value, msg))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidatePodSpecificAnnotations(annotations map[string]string, spec *api.PodSpec, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if annotations[api.AffinityAnnotationKey] != "" {
|
||||
allErrs = append(allErrs, ValidateAffinityInPodAnnotations(annotations, fldPath)...)
|
||||
|
|
@ -119,7 +131,50 @@ func ValidatePodSpecificAnnotations(annotations map[string]string, fldPath *fiel
|
|||
}
|
||||
|
||||
allErrs = append(allErrs, ValidateSeccompPodAnnotations(annotations, fldPath)...)
|
||||
allErrs = append(allErrs, ValidateAppArmorPodAnnotations(annotations, spec, fldPath)...)
|
||||
|
||||
sysctls, err := api.SysctlsFromPodAnnotation(annotations[api.SysctlsPodAnnotationKey])
|
||||
if err != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Key(api.SysctlsPodAnnotationKey), annotations[api.SysctlsPodAnnotationKey], err.Error()))
|
||||
} else {
|
||||
allErrs = append(allErrs, validateSysctls(sysctls, fldPath.Key(api.SysctlsPodAnnotationKey))...)
|
||||
}
|
||||
unsafeSysctls, err := api.SysctlsFromPodAnnotation(annotations[api.UnsafeSysctlsPodAnnotationKey])
|
||||
if err != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Key(api.UnsafeSysctlsPodAnnotationKey), annotations[api.UnsafeSysctlsPodAnnotationKey], err.Error()))
|
||||
} else {
|
||||
allErrs = append(allErrs, validateSysctls(unsafeSysctls, fldPath.Key(api.UnsafeSysctlsPodAnnotationKey))...)
|
||||
}
|
||||
inBoth := sysctlIntersection(sysctls, unsafeSysctls)
|
||||
if len(inBoth) > 0 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Key(api.UnsafeSysctlsPodAnnotationKey), strings.Join(inBoth, ", "), "can not be safe and unsafe"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidatePodSpecificAnnotationUpdates(newPod, oldPod *api.Pod, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
newAnnotations := newPod.Annotations
|
||||
oldAnnotations := oldPod.Annotations
|
||||
for k, oldVal := range oldAnnotations {
|
||||
if newAnnotations[k] == oldVal {
|
||||
continue // No change.
|
||||
}
|
||||
if strings.HasPrefix(k, apparmor.ContainerAnnotationKeyPrefix) {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Key(k), "may not update AppArmor annotations"))
|
||||
}
|
||||
}
|
||||
// Check for removals.
|
||||
for k := range newAnnotations {
|
||||
if _, ok := oldAnnotations[k]; ok {
|
||||
continue // No change.
|
||||
}
|
||||
if strings.HasPrefix(k, apparmor.ContainerAnnotationKeyPrefix) {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Key(k), "may not remove AppArmor annotations"))
|
||||
}
|
||||
}
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotations(newAnnotations, &newPod.Spec, fldPath)...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +259,7 @@ var ValidateReplicationControllerName = NameIsDNSSubdomain
|
|||
// ValidateServiceName can be used to check whether the given service name is valid.
|
||||
// Prefix indicates this name will be used as part of generation, in which case
|
||||
// trailing dashes are allowed.
|
||||
var ValidateServiceName = NameIsDNS952Label
|
||||
var ValidateServiceName = NameIsDNS1035Label
|
||||
|
||||
// ValidateNodeName can be used to check whether the given node name is valid.
|
||||
// Prefix indicates this name will be used as part of generation, in which case
|
||||
|
|
@ -242,6 +297,9 @@ var ValidateServiceAccountName = NameIsDNSSubdomain
|
|||
// trailing dashes are allowed.
|
||||
var ValidateEndpointsName = NameIsDNSSubdomain
|
||||
|
||||
// ValidateClusterName can be used to check whether the given cluster name is valid.
|
||||
var ValidateClusterName = NameIsDNS1035Label
|
||||
|
||||
// NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain.
|
||||
func NameIsDNSSubdomain(name string, prefix bool) []string {
|
||||
if prefix {
|
||||
|
|
@ -258,12 +316,12 @@ func NameIsDNSLabel(name string, prefix bool) []string {
|
|||
return validation.IsDNS1123Label(name)
|
||||
}
|
||||
|
||||
// NameIsDNS952Label is a ValidateNameFunc for names that must be a DNS 952 label.
|
||||
func NameIsDNS952Label(name string, prefix bool) []string {
|
||||
// NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label.
|
||||
func NameIsDNS1035Label(name string, prefix bool) []string {
|
||||
if prefix {
|
||||
name = maskTrailingDash(name)
|
||||
}
|
||||
return validation.IsDNS952Label(name)
|
||||
return validation.IsDNS1035Label(name)
|
||||
}
|
||||
|
||||
// Validates that given value is not negative.
|
||||
|
|
@ -327,6 +385,11 @@ func ValidateObjectMeta(meta *api.ObjectMeta, requiresNamespace bool, nameFn Val
|
|||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("namespace"), "not allowed on this type"))
|
||||
}
|
||||
}
|
||||
if len(meta.ClusterName) != 0 {
|
||||
for _, msg := range ValidateClusterName(meta.ClusterName, false) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("clusterName"), meta.ClusterName, msg))
|
||||
}
|
||||
}
|
||||
allErrs = append(allErrs, ValidateNonnegativeField(meta.Generation, fldPath.Child("generation"))...)
|
||||
allErrs = append(allErrs, unversionedvalidation.ValidateLabels(meta.Labels, fldPath.Child("labels"))...)
|
||||
allErrs = append(allErrs, ValidateAnnotations(meta.Annotations, fldPath.Child("annotations"))...)
|
||||
|
|
@ -388,6 +451,7 @@ func ValidateObjectMetaUpdate(newMeta, oldMeta *api.ObjectMeta, fldPath *field.P
|
|||
allErrs = append(allErrs, ValidateImmutableField(newMeta.Namespace, oldMeta.Namespace, fldPath.Child("namespace"))...)
|
||||
allErrs = append(allErrs, ValidateImmutableField(newMeta.UID, oldMeta.UID, fldPath.Child("uid"))...)
|
||||
allErrs = append(allErrs, ValidateImmutableField(newMeta.CreationTimestamp, oldMeta.CreationTimestamp, fldPath.Child("creationTimestamp"))...)
|
||||
allErrs = append(allErrs, ValidateImmutableField(newMeta.ClusterName, oldMeta.ClusterName, fldPath.Child("clusterName"))...)
|
||||
|
||||
allErrs = append(allErrs, unversionedvalidation.ValidateLabels(newMeta.Labels, fldPath.Child("labels"))...)
|
||||
allErrs = append(allErrs, ValidateAnnotations(newMeta.Annotations, fldPath.Child("annotations"))...)
|
||||
|
|
@ -533,6 +597,14 @@ func validateVolumeSource(source *api.VolumeSource, fldPath *field.Path) field.E
|
|||
allErrs = append(allErrs, validateCephFSVolumeSource(source.CephFS, fldPath.Child("cephfs"))...)
|
||||
}
|
||||
}
|
||||
if source.Quobyte != nil {
|
||||
if numVolumes > 0 {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("quobyte"), "may not specify more than 1 volume type"))
|
||||
} else {
|
||||
numVolumes++
|
||||
allErrs = append(allErrs, validateQuobyteVolumeSource(source.Quobyte, fldPath.Child("quobyte"))...)
|
||||
}
|
||||
}
|
||||
if source.DownwardAPI != nil {
|
||||
if numVolumes > 0 {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("downwarAPI"), "may not specify more than 1 volume type"))
|
||||
|
|
@ -577,6 +649,11 @@ func validateVolumeSource(source *api.VolumeSource, fldPath *field.Path) field.E
|
|||
allErrs = append(allErrs, validateVsphereVolumeSource(source.VsphereVolume, fldPath.Child("vsphereVolume"))...)
|
||||
}
|
||||
}
|
||||
if source.AzureDisk != nil {
|
||||
numVolumes++
|
||||
allErrs = append(allErrs, validateAzureDisk(source.AzureDisk, fldPath.Child("azureDisk"))...)
|
||||
}
|
||||
|
||||
if numVolumes == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath, "must specify a volume type"))
|
||||
}
|
||||
|
|
@ -598,7 +675,7 @@ func validateGitRepoVolumeSource(gitRepo *api.GitRepoVolumeSource, fldPath *fiel
|
|||
allErrs = append(allErrs, field.Required(fldPath.Child("repository"), ""))
|
||||
}
|
||||
|
||||
pathErrs := validateVolumeSourcePath(gitRepo.Directory, fldPath.Child("directory"))
|
||||
pathErrs := validateLocalDescendingPath(gitRepo.Directory, fldPath.Child("directory"))
|
||||
allErrs = append(allErrs, pathErrs...)
|
||||
return allErrs
|
||||
}
|
||||
|
|
@ -660,6 +737,17 @@ func validateSecretVolumeSource(secretSource *api.SecretVolumeSource, fldPath *f
|
|||
if len(secretSource.SecretName) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("secretName"), ""))
|
||||
}
|
||||
|
||||
secretMode := secretSource.DefaultMode
|
||||
if secretMode != nil && (*secretMode > 0777 || *secretMode < 0) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("defaultMode"), *secretMode, volumeModeErrorMsg))
|
||||
}
|
||||
|
||||
itemsPath := fldPath.Child("items")
|
||||
for i, kp := range secretSource.Items {
|
||||
itemPath := itemsPath.Index(i)
|
||||
allErrs = append(allErrs, validateKeyToPath(&kp, itemPath)...)
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
|
|
@ -668,6 +756,33 @@ func validateConfigMapVolumeSource(configMapSource *api.ConfigMapVolumeSource, f
|
|||
if len(configMapSource.Name) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("name"), ""))
|
||||
}
|
||||
|
||||
configMapMode := configMapSource.DefaultMode
|
||||
if configMapMode != nil && (*configMapMode > 0777 || *configMapMode < 0) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("defaultMode"), *configMapMode, volumeModeErrorMsg))
|
||||
}
|
||||
|
||||
itemsPath := fldPath.Child("items")
|
||||
for i, kp := range configMapSource.Items {
|
||||
itemPath := itemsPath.Index(i)
|
||||
allErrs = append(allErrs, validateKeyToPath(&kp, itemPath)...)
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateKeyToPath(kp *api.KeyToPath, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if len(kp.Key) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("key"), ""))
|
||||
}
|
||||
if len(kp.Path) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("path"), ""))
|
||||
}
|
||||
allErrs = append(allErrs, validateLocalNonReservedPath(kp.Path, fldPath.Child("path"))...)
|
||||
if kp.Mode != nil && (*kp.Mode > 0777 || *kp.Mode < 0) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("mode"), *kp.Mode, volumeModeErrorMsg))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
|
|
@ -693,6 +808,24 @@ func validateNFSVolumeSource(nfs *api.NFSVolumeSource, fldPath *field.Path) fiel
|
|||
return allErrs
|
||||
}
|
||||
|
||||
func validateQuobyteVolumeSource(quobyte *api.QuobyteVolumeSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if len(quobyte.Registry) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("registry"), "must be a host:port pair or multiple pairs seperated by commas"))
|
||||
} else {
|
||||
for _, hostPortPair := range strings.Split(quobyte.Registry, ",") {
|
||||
if _, _, err := net.SplitHostPort(hostPortPair); err != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("registry"), quobyte.Registry, "must be a host:port pair or multiple pairs seperated by commas"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(quobyte.Volume) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("volume"), ""))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateGlusterfs(glusterfs *api.GlusterfsVolumeSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if len(glusterfs.EndpointsName) == 0 {
|
||||
|
|
@ -715,69 +848,71 @@ func validateFlockerVolumeSource(flocker *api.FlockerVolumeSource, fldPath *fiel
|
|||
return allErrs
|
||||
}
|
||||
|
||||
var validDownwardAPIFieldPathExpressions = sets.NewString("metadata.name", "metadata.namespace", "metadata.labels", "metadata.annotations")
|
||||
var validDownwardAPIFieldPathExpressions = sets.NewString(
|
||||
"metadata.name",
|
||||
"metadata.namespace",
|
||||
"metadata.labels",
|
||||
"metadata.annotations")
|
||||
|
||||
func validateDownwardAPIVolumeSource(downwardAPIVolume *api.DownwardAPIVolumeSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
for _, downwardAPIVolumeFile := range downwardAPIVolume.Items {
|
||||
if len(downwardAPIVolumeFile.Path) == 0 {
|
||||
|
||||
downwardAPIMode := downwardAPIVolume.DefaultMode
|
||||
if downwardAPIMode != nil && (*downwardAPIMode > 0777 || *downwardAPIMode < 0) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("defaultMode"), *downwardAPIMode, volumeModeErrorMsg))
|
||||
}
|
||||
|
||||
for _, file := range downwardAPIVolume.Items {
|
||||
if len(file.Path) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("path"), ""))
|
||||
}
|
||||
allErrs = append(allErrs, validateVolumeSourcePath(downwardAPIVolumeFile.Path, fldPath.Child("path"))...)
|
||||
if downwardAPIVolumeFile.FieldRef != nil {
|
||||
allErrs = append(allErrs, validateObjectFieldSelector(downwardAPIVolumeFile.FieldRef, &validDownwardAPIFieldPathExpressions, fldPath.Child("fieldRef"))...)
|
||||
if downwardAPIVolumeFile.ResourceFieldRef != nil {
|
||||
allErrs = append(allErrs, validateLocalNonReservedPath(file.Path, fldPath.Child("path"))...)
|
||||
if file.FieldRef != nil {
|
||||
allErrs = append(allErrs, validateObjectFieldSelector(file.FieldRef, &validDownwardAPIFieldPathExpressions, fldPath.Child("fieldRef"))...)
|
||||
if file.ResourceFieldRef != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, "resource", "fieldRef and resourceFieldRef can not be specified simultaneously"))
|
||||
}
|
||||
} else if downwardAPIVolumeFile.ResourceFieldRef != nil {
|
||||
allErrs = append(allErrs, validateContainerResourceFieldSelector(downwardAPIVolumeFile.ResourceFieldRef, &validContainerResourceFieldPathExpressions, fldPath.Child("resourceFieldRef"), true)...)
|
||||
} else if file.ResourceFieldRef != nil {
|
||||
allErrs = append(allErrs, validateContainerResourceFieldSelector(file.ResourceFieldRef, &validContainerResourceFieldPathExpressions, fldPath.Child("resourceFieldRef"), true)...)
|
||||
} else {
|
||||
allErrs = append(allErrs, field.Required(fldPath, "one of fieldRef and resourceFieldRef is required"))
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// This validate will make sure targetPath:
|
||||
// 1. is not abs path
|
||||
// 2. does not start with '../'
|
||||
// 3. does not contain '/../'
|
||||
// 4. does not end with '/..'
|
||||
func validateSubPath(targetPath string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if path.IsAbs(targetPath) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must be a relative path"))
|
||||
}
|
||||
if strings.HasPrefix(targetPath, "../") {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not start with '../'"))
|
||||
}
|
||||
if strings.Contains(targetPath, "/../") {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not contain '/../'"))
|
||||
}
|
||||
if strings.HasSuffix(targetPath, "/..") {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not end with '/..'"))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// This validate will make sure targetPath:
|
||||
// 1. is not abs path
|
||||
// 2. does not contain '..'
|
||||
// 3. does not start with '..'
|
||||
func validateVolumeSourcePath(targetPath string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if path.IsAbs(targetPath) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must be a relative path"))
|
||||
}
|
||||
// TODO assume OS of api server & nodes are the same for now
|
||||
items := strings.Split(targetPath, string(os.PathSeparator))
|
||||
|
||||
for _, item := range items {
|
||||
if item == ".." {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not contain '..'"))
|
||||
if file.Mode != nil && (*file.Mode > 0777 || *file.Mode < 0) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("mode"), *file.Mode, volumeModeErrorMsg))
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(items[0], "..") && len(items[0]) > 2 {
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// This validate will make sure targetPath:
|
||||
// 1. is not abs path
|
||||
// 2. does not have any element which is ".."
|
||||
func validateLocalDescendingPath(targetPath string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if path.IsAbs(targetPath) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must be a relative path"))
|
||||
}
|
||||
|
||||
// TODO: this assumes the OS of apiserver & nodes are the same
|
||||
parts := strings.Split(targetPath, string(os.PathSeparator))
|
||||
for _, item := range parts {
|
||||
if item == ".." {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not contain '..'"))
|
||||
break // even for `../../..`, one error is sufficient to make the point
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// This validate will make sure targetPath:
|
||||
// 1. is not abs path
|
||||
// 2. does not contain any '..' elements
|
||||
// 3. does not start with '..'
|
||||
func validateLocalNonReservedPath(targetPath string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
allErrs = append(allErrs, validateLocalDescendingPath(targetPath, fldPath)...)
|
||||
// Don't report this error if the check for .. elements already caught it.
|
||||
if strings.HasPrefix(targetPath, "..") && !strings.HasPrefix(targetPath, "../") {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not start with '..'"))
|
||||
}
|
||||
return allErrs
|
||||
|
|
@ -829,6 +964,22 @@ func validateAzureFile(azure *api.AzureFileVolumeSource, fldPath *field.Path) fi
|
|||
return allErrs
|
||||
}
|
||||
|
||||
var supportedCachingModes = sets.NewString(string(api.AzureDataDiskCachingNone), string(api.AzureDataDiskCachingReadOnly), string(api.AzureDataDiskCachingReadWrite))
|
||||
|
||||
func validateAzureDisk(azure *api.AzureDiskVolumeSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if azure.DiskName == "" {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("diskName"), ""))
|
||||
}
|
||||
if azure.DataDiskURI == "" {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("diskURI"), ""))
|
||||
}
|
||||
if azure.CachingMode != nil && !supportedCachingModes.Has(string(*azure.CachingMode)) {
|
||||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("cachingMode"), *azure.CachingMode, supportedCachingModes.List()))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateVsphereVolumeSource(cd *api.VsphereVirtualDiskVolumeSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if len(cd.VolumePath) == 0 {
|
||||
|
|
@ -925,6 +1076,14 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) field.ErrorList {
|
|||
allErrs = append(allErrs, validateRBDVolumeSource(pv.Spec.RBD, specPath.Child("rbd"))...)
|
||||
}
|
||||
}
|
||||
if pv.Spec.Quobyte != nil {
|
||||
if numVolumes > 0 {
|
||||
allErrs = append(allErrs, field.Forbidden(specPath.Child("quobyte"), "may not specify more than 1 volume type"))
|
||||
} else {
|
||||
numVolumes++
|
||||
allErrs = append(allErrs, validateQuobyteVolumeSource(pv.Spec.Quobyte, specPath.Child("quobyte"))...)
|
||||
}
|
||||
}
|
||||
if pv.Spec.CephFS != nil {
|
||||
if numVolumes > 0 {
|
||||
allErrs = append(allErrs, field.Forbidden(specPath.Child("cephFS"), "may not specify more than 1 volume type"))
|
||||
|
|
@ -973,6 +1132,11 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) field.ErrorList {
|
|||
allErrs = append(allErrs, validateVsphereVolumeSource(pv.Spec.VsphereVolume, specPath.Child("vsphereVolume"))...)
|
||||
}
|
||||
}
|
||||
if pv.Spec.AzureDisk != nil {
|
||||
numVolumes++
|
||||
allErrs = append(allErrs, validateAzureDisk(pv.Spec.AzureDisk, specPath.Child("azureDisk"))...)
|
||||
}
|
||||
|
||||
if numVolumes == 0 {
|
||||
allErrs = append(allErrs, field.Required(specPath, "must specify a volume type"))
|
||||
}
|
||||
|
|
@ -999,26 +1163,37 @@ func ValidatePersistentVolumeStatusUpdate(newPv, oldPv *api.PersistentVolume) fi
|
|||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePersistentVolumeClaim validates a PersistentVolumeClaim
|
||||
func ValidatePersistentVolumeClaim(pvc *api.PersistentVolumeClaim) field.ErrorList {
|
||||
allErrs := ValidateObjectMeta(&pvc.ObjectMeta, true, ValidatePersistentVolumeName, field.NewPath("metadata"))
|
||||
specPath := field.NewPath("spec")
|
||||
if len(pvc.Spec.AccessModes) == 0 {
|
||||
allErrs = append(allErrs, field.Required(specPath.Child("accessModes"), "at least 1 accessMode is required"))
|
||||
allErrs = append(allErrs, ValidatePersistentVolumeClaimSpec(&pvc.Spec, field.NewPath("spec"))...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePersistentVolumeClaimSpec validates a PersistentVolumeClaimSpec
|
||||
func ValidatePersistentVolumeClaimSpec(spec *api.PersistentVolumeClaimSpec, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if len(spec.AccessModes) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("accessModes"), "at least 1 access mode is required"))
|
||||
}
|
||||
if pvc.Spec.Selector != nil {
|
||||
allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(pvc.Spec.Selector, specPath.Child("selector"))...)
|
||||
if spec.Selector != nil {
|
||||
allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...)
|
||||
}
|
||||
for _, mode := range pvc.Spec.AccessModes {
|
||||
for _, mode := range spec.AccessModes {
|
||||
if mode != api.ReadWriteOnce && mode != api.ReadOnlyMany && mode != api.ReadWriteMany {
|
||||
allErrs = append(allErrs, field.NotSupported(specPath.Child("accessModes"), mode, supportedAccessModes.List()))
|
||||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("accessModes"), mode, supportedAccessModes.List()))
|
||||
}
|
||||
}
|
||||
if _, ok := pvc.Spec.Resources.Requests[api.ResourceStorage]; !ok {
|
||||
allErrs = append(allErrs, field.Required(specPath.Child("resources").Key(string(api.ResourceStorage)), ""))
|
||||
storageValue, ok := spec.Resources.Requests[api.ResourceStorage]
|
||||
if !ok {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("resources").Key(string(api.ResourceStorage)), ""))
|
||||
} else {
|
||||
allErrs = append(allErrs, ValidateResourceQuantityValue(string(api.ResourceStorage), storageValue, fldPath.Child("resources").Key(string(api.ResourceStorage)))...)
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePersistentVolumeClaimUpdate validates an update to a PeristentVolumeClaim
|
||||
func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *api.PersistentVolumeClaim) field.ErrorList {
|
||||
allErrs := ValidateObjectMetaUpdate(&newPvc.ObjectMeta, &oldPvc.ObjectMeta, field.NewPath("metadata"))
|
||||
allErrs = append(allErrs, ValidatePersistentVolumeClaim(newPvc)...)
|
||||
|
|
@ -1039,6 +1214,7 @@ func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *api.PersistentVolumeCla
|
|||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePersistentVolumeClaimStatusUpdate validates an update to status of a PeristentVolumeClaim
|
||||
func ValidatePersistentVolumeClaimStatusUpdate(newPvc, oldPvc *api.PersistentVolumeClaim) field.ErrorList {
|
||||
allErrs := ValidateObjectMetaUpdate(&newPvc.ObjectMeta, &oldPvc.ObjectMeta, field.NewPath("metadata"))
|
||||
if len(newPvc.ResourceVersion) == 0 {
|
||||
|
|
@ -1112,7 +1288,7 @@ func validateEnv(vars []api.EnvVar, fldPath *field.Path) field.ErrorList {
|
|||
return allErrs
|
||||
}
|
||||
|
||||
var validFieldPathExpressionsEnv = sets.NewString("metadata.name", "metadata.namespace", "status.podIP")
|
||||
var validFieldPathExpressionsEnv = sets.NewString("metadata.name", "metadata.namespace", "spec.nodeName", "spec.serviceAccountName", "status.podIP")
|
||||
var validContainerResourceFieldPathExpressions = sets.NewString("limits.cpu", "limits.memory", "requests.cpu", "requests.memory")
|
||||
|
||||
func validateEnvVarValueFrom(ev api.EnvVar, fldPath *field.Path) field.ErrorList {
|
||||
|
|
@ -1197,11 +1373,11 @@ func validateContainerResourceDivisor(rName string, divisor resource.Quantity, f
|
|||
switch rName {
|
||||
case "limits.cpu", "requests.cpu":
|
||||
if !validContainerResourceDivisorForCPU.Has(divisor.String()) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("divisor"), rName, fmt.Sprintf("only divisor's values 1m and 1 are supported with the cpu resource")))
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("divisor"), rName, "only divisor's values 1m and 1 are supported with the cpu resource"))
|
||||
}
|
||||
case "limits.memory", "requests.memory":
|
||||
if !validContainerResourceDivisorForMemory.Has(divisor.String()) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("divisor"), rName, fmt.Sprintf("only divisor's values 1, 1k, 1M, 1G, 1T, 1P, 1E, 1Ki, 1Mi, 1Gi, 1Ti, 1Pi, 1Ei are supported with the memory resource")))
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("divisor"), rName, "only divisor's values 1, 1k, 1M, 1G, 1T, 1P, 1E, 1Ki, 1Mi, 1Gi, 1Ti, 1Pi, 1Ei are supported with the memory resource"))
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
|
|
@ -1262,7 +1438,7 @@ func validateVolumeMounts(mounts []api.VolumeMount, volumes sets.String, fldPath
|
|||
}
|
||||
mountpoints.Insert(mnt.MountPath)
|
||||
if len(mnt.SubPath) > 0 {
|
||||
allErrs = append(allErrs, validateSubPath(mnt.SubPath, fldPath.Child("subPath"))...)
|
||||
allErrs = append(allErrs, validateLocalDescendingPath(mnt.SubPath, fldPath.Child("subPath"))...)
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
|
|
@ -1621,7 +1797,7 @@ func validateTolerations(tolerations []api.Toleration, fldPath *field.Path) fiel
|
|||
func ValidatePod(pod *api.Pod) field.ErrorList {
|
||||
fldPath := field.NewPath("metadata")
|
||||
allErrs := ValidateObjectMeta(&pod.ObjectMeta, true, ValidatePodName, fldPath)
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotations(pod.ObjectMeta.Annotations, fldPath.Child("annotations"))...)
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotations(pod.ObjectMeta.Annotations, &pod.Spec, fldPath.Child("annotations"))...)
|
||||
allErrs = append(allErrs, ValidatePodSpec(&pod.Spec, field.NewPath("spec"))...)
|
||||
return allErrs
|
||||
}
|
||||
|
|
@ -1724,6 +1900,41 @@ func ValidateNodeSelector(nodeSelector *api.NodeSelector, fldPath *field.Path) f
|
|||
return allErrs
|
||||
}
|
||||
|
||||
// ValidateAvoidPodsInNodeAnnotations tests that the serialized AvoidPods in Node.Annotations has valid data
|
||||
func ValidateAvoidPodsInNodeAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
avoids, err := api.GetAvoidPodsFromNodeAnnotations(annotations)
|
||||
if err != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("AvoidPods"), api.PreferAvoidPodsAnnotationKey, err.Error()))
|
||||
return allErrs
|
||||
}
|
||||
|
||||
if len(avoids.PreferAvoidPods) != 0 {
|
||||
for i, pa := range avoids.PreferAvoidPods {
|
||||
idxPath := fldPath.Child(api.PreferAvoidPodsAnnotationKey).Index(i)
|
||||
allErrs = append(allErrs, validatePreferAvoidPodsEntry(pa, idxPath)...)
|
||||
}
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// validatePreferAvoidPodsEntry tests if given PreferAvoidPodsEntry has valid data.
|
||||
func validatePreferAvoidPodsEntry(avoidPodEntry api.PreferAvoidPodsEntry, fldPath *field.Path) field.ErrorList {
|
||||
allErrors := field.ErrorList{}
|
||||
if avoidPodEntry.PodSignature.PodController == nil {
|
||||
allErrors = append(allErrors, field.Required(fldPath.Child("PodSignature"), ""))
|
||||
} else {
|
||||
if *(avoidPodEntry.PodSignature.PodController.Controller) != true {
|
||||
allErrors = append(allErrors,
|
||||
field.Invalid(fldPath.Child("PodSignature").Child("PodController").Child("Controller"),
|
||||
*(avoidPodEntry.PodSignature.PodController.Controller), "must point to a controller"))
|
||||
}
|
||||
}
|
||||
return allErrors
|
||||
}
|
||||
|
||||
// ValidatePreferredSchedulingTerms tests that the specified SoftNodeAffinity fields has valid data
|
||||
func ValidatePreferredSchedulingTerms(terms []api.PreferredSchedulingTerm, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
|
@ -1828,6 +2039,9 @@ func ValidateAffinityInPodAnnotations(annotations map[string]string, fldPath *fi
|
|||
allErrs = append(allErrs, field.Invalid(fldPath, api.AffinityAnnotationKey, err.Error()))
|
||||
return allErrs
|
||||
}
|
||||
if affinity == nil {
|
||||
return allErrs
|
||||
}
|
||||
|
||||
affinityFldPath := fldPath.Child(api.AffinityAnnotationKey)
|
||||
if affinity.NodeAffinity != nil {
|
||||
|
|
@ -1880,7 +2094,7 @@ func validateSeccompProfile(p string, fldPath *field.Path) field.ErrorList {
|
|||
return nil
|
||||
}
|
||||
if strings.HasPrefix(p, "localhost/") {
|
||||
return validateSubPath(strings.TrimPrefix(p, "localhost/"), fldPath)
|
||||
return validateLocalDescendingPath(strings.TrimPrefix(p, "localhost/"), fldPath)
|
||||
}
|
||||
return field.ErrorList{field.Invalid(fldPath, p, "must be a valid seccomp profile")}
|
||||
}
|
||||
|
|
@ -1899,6 +2113,73 @@ func ValidateSeccompPodAnnotations(annotations map[string]string, fldPath *field
|
|||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateAppArmorPodAnnotations(annotations map[string]string, spec *api.PodSpec, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
for k, p := range annotations {
|
||||
if !strings.HasPrefix(k, apparmor.ContainerAnnotationKeyPrefix) {
|
||||
continue
|
||||
}
|
||||
containerName := strings.TrimPrefix(k, apparmor.ContainerAnnotationKeyPrefix)
|
||||
if !podSpecHasContainer(spec, containerName) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child(k), containerName, "container not found"))
|
||||
}
|
||||
|
||||
if err := apparmor.ValidateProfileFormat(p); err != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child(k), p, err.Error()))
|
||||
}
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func podSpecHasContainer(spec *api.PodSpec, containerName string) bool {
|
||||
for _, c := range spec.InitContainers {
|
||||
if c.Name == containerName {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for _, c := range spec.Containers {
|
||||
if c.Name == containerName {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const (
|
||||
// a sysctl segment regex, concatenated with dots to form a sysctl name
|
||||
SysctlSegmentFmt string = "[a-z0-9]([-_a-z0-9]*[a-z0-9])?"
|
||||
|
||||
// a sysctl name regex
|
||||
SysctlFmt string = "(" + SysctlSegmentFmt + "\\.)*" + SysctlSegmentFmt
|
||||
|
||||
// the maximal length of a sysctl name
|
||||
SysctlMaxLength int = 253
|
||||
)
|
||||
|
||||
var sysctlRegexp = regexp.MustCompile("^" + SysctlFmt + "$")
|
||||
|
||||
// IsValidSysctlName checks that the given string is a valid sysctl name,
|
||||
// i.e. matches SysctlFmt.
|
||||
func IsValidSysctlName(name string) bool {
|
||||
if len(name) > SysctlMaxLength {
|
||||
return false
|
||||
}
|
||||
return sysctlRegexp.MatchString(name)
|
||||
}
|
||||
|
||||
func validateSysctls(sysctls []api.Sysctl, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
for i, s := range sysctls {
|
||||
if len(s.Name) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Index(i).Child("name"), ""))
|
||||
} else if !IsValidSysctlName(s.Name) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Index(i).Child("name"), s.Name, fmt.Sprintf("must have at most %d characters and match regex %s", SysctlMaxLength, SysctlFmt)))
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePodSecurityContext test that the specified PodSecurityContext has valid data.
|
||||
func ValidatePodSecurityContext(securityContext *api.PodSecurityContext, spec *api.PodSpec, specPath, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
|
@ -1925,28 +2206,45 @@ func ValidatePodSecurityContext(securityContext *api.PodSecurityContext, spec *a
|
|||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateContainerUpdates(newContainers, oldContainers []api.Container, fldPath *field.Path) (allErrs field.ErrorList, stop bool) {
|
||||
allErrs = field.ErrorList{}
|
||||
if len(newContainers) != len(oldContainers) {
|
||||
//TODO: Pinpoint the specific container that causes the invalid error after we have strategic merge diff
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath, "pod updates may not add or remove containers"))
|
||||
return allErrs, true
|
||||
}
|
||||
|
||||
// validate updated container images
|
||||
for i, ctr := range newContainers {
|
||||
if len(ctr.Image) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Index(i).Child("image"), ""))
|
||||
}
|
||||
}
|
||||
return allErrs, false
|
||||
}
|
||||
|
||||
// ValidatePodUpdate tests to see if the update is legal for an end user to make. newPod is updated with fields
|
||||
// that cannot be changed.
|
||||
func ValidatePodUpdate(newPod, oldPod *api.Pod) field.ErrorList {
|
||||
fldPath := field.NewPath("metadata")
|
||||
allErrs := ValidateObjectMetaUpdate(&newPod.ObjectMeta, &oldPod.ObjectMeta, fldPath)
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotations(newPod.ObjectMeta.Annotations, fldPath.Child("annotations"))...)
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotationUpdates(newPod, oldPod, fldPath.Child("annotations"))...)
|
||||
specPath := field.NewPath("spec")
|
||||
if len(newPod.Spec.Containers) != len(oldPod.Spec.Containers) {
|
||||
//TODO: Pinpoint the specific container that causes the invalid error after we have strategic merge diff
|
||||
allErrs = append(allErrs, field.Forbidden(specPath.Child("containers"), "pod updates may not add or remove containers"))
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// validate updateable fields:
|
||||
// 1. containers[*].image
|
||||
// 2. spec.activeDeadlineSeconds
|
||||
// 2. initContainers[*].image
|
||||
// 3. spec.activeDeadlineSeconds
|
||||
|
||||
// validate updated container images
|
||||
for i, ctr := range newPod.Spec.Containers {
|
||||
if len(ctr.Image) == 0 {
|
||||
allErrs = append(allErrs, field.Required(specPath.Child("containers").Index(i).Child("image"), ""))
|
||||
}
|
||||
containerErrs, stop := ValidateContainerUpdates(newPod.Spec.Containers, oldPod.Spec.Containers, specPath.Child("containers"))
|
||||
allErrs = append(allErrs, containerErrs...)
|
||||
if stop {
|
||||
return allErrs
|
||||
}
|
||||
containerErrs, stop = ValidateContainerUpdates(newPod.Spec.InitContainers, oldPod.Spec.InitContainers, specPath.Child("initContainers"))
|
||||
allErrs = append(allErrs, containerErrs...)
|
||||
if stop {
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// validate updated spec.activeDeadlineSeconds. two types of updates are allowed:
|
||||
|
|
@ -1978,6 +2276,13 @@ func ValidatePodUpdate(newPod, oldPod *api.Pod) field.ErrorList {
|
|||
newContainers = append(newContainers, container)
|
||||
}
|
||||
mungedPod.Spec.Containers = newContainers
|
||||
// munge initContainers[*].image
|
||||
var newInitContainers []api.Container
|
||||
for ix, container := range mungedPod.Spec.InitContainers {
|
||||
container.Image = oldPod.Spec.InitContainers[ix].Image
|
||||
newInitContainers = append(newInitContainers, container)
|
||||
}
|
||||
mungedPod.Spec.InitContainers = newInitContainers
|
||||
// munge spec.activeDeadlineSeconds
|
||||
mungedPod.Spec.ActiveDeadlineSeconds = nil
|
||||
if oldPod.Spec.ActiveDeadlineSeconds != nil {
|
||||
|
|
@ -2041,17 +2346,19 @@ func ValidatePodTemplateUpdate(newPod, oldPod *api.PodTemplate) field.ErrorList
|
|||
|
||||
var supportedSessionAffinityType = sets.NewString(string(api.ServiceAffinityClientIP), string(api.ServiceAffinityNone))
|
||||
var supportedServiceType = sets.NewString(string(api.ServiceTypeClusterIP), string(api.ServiceTypeNodePort),
|
||||
string(api.ServiceTypeLoadBalancer))
|
||||
string(api.ServiceTypeLoadBalancer), string(api.ServiceTypeExternalName))
|
||||
|
||||
// ValidateService tests if required fields in the service are set.
|
||||
func ValidateService(service *api.Service) field.ErrorList {
|
||||
allErrs := ValidateObjectMeta(&service.ObjectMeta, true, ValidateServiceName, field.NewPath("metadata"))
|
||||
|
||||
specPath := field.NewPath("spec")
|
||||
if len(service.Spec.Ports) == 0 && service.Spec.ClusterIP != api.ClusterIPNone {
|
||||
isHeadlessService := service.Spec.ClusterIP == api.ClusterIPNone
|
||||
if len(service.Spec.Ports) == 0 && !isHeadlessService && service.Spec.Type != api.ServiceTypeExternalName {
|
||||
allErrs = append(allErrs, field.Required(specPath.Child("ports"), ""))
|
||||
}
|
||||
if service.Spec.Type == api.ServiceTypeLoadBalancer {
|
||||
switch service.Spec.Type {
|
||||
case api.ServiceTypeLoadBalancer:
|
||||
for ix := range service.Spec.Ports {
|
||||
port := &service.Spec.Ports[ix]
|
||||
// This is a workaround for broken cloud environments that
|
||||
|
|
@ -2062,9 +2369,17 @@ func ValidateService(service *api.Service) field.ErrorList {
|
|||
allErrs = append(allErrs, field.Invalid(portPath, port.Port, "may not expose port 10250 externally since it is used by kubelet"))
|
||||
}
|
||||
}
|
||||
case api.ServiceTypeExternalName:
|
||||
if service.Spec.ClusterIP != "" {
|
||||
allErrs = append(allErrs, field.Invalid(specPath.Child("clusterIP"), service.Spec.ClusterIP, "must be empty for ExternalName services"))
|
||||
}
|
||||
if len(service.Spec.ExternalName) > 0 {
|
||||
allErrs = append(allErrs, ValidateDNS1123Subdomain(service.Spec.ExternalName, specPath.Child("externalName"))...)
|
||||
} else {
|
||||
allErrs = append(allErrs, field.Required(specPath.Child("externalName"), ""))
|
||||
}
|
||||
}
|
||||
|
||||
isHeadlessService := service.Spec.ClusterIP == api.ClusterIPNone
|
||||
allPortNames := sets.String{}
|
||||
portsPath := specPath.Child("ports")
|
||||
for i := range service.Spec.Ports {
|
||||
|
|
@ -2305,7 +2620,7 @@ func ValidatePodTemplateSpec(spec *api.PodTemplateSpec, fldPath *field.Path) fie
|
|||
allErrs := field.ErrorList{}
|
||||
allErrs = append(allErrs, unversionedvalidation.ValidateLabels(spec.Labels, fldPath.Child("labels"))...)
|
||||
allErrs = append(allErrs, ValidateAnnotations(spec.Annotations, fldPath.Child("annotations"))...)
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotations(spec.Annotations, fldPath.Child("annotations"))...)
|
||||
allErrs = append(allErrs, ValidatePodSpecificAnnotations(spec.Annotations, &spec.Spec, fldPath.Child("annotations"))...)
|
||||
allErrs = append(allErrs, ValidatePodSpec(&spec.Spec, fldPath.Child("spec"))...)
|
||||
return allErrs
|
||||
}
|
||||
|
|
@ -2328,6 +2643,9 @@ func ValidateReadOnlyPersistentDisks(volumes []api.Volume, fldPath *field.Path)
|
|||
// validateTaints tests if given taints have valid data.
|
||||
func validateTaints(taints []api.Taint, fldPath *field.Path) field.ErrorList {
|
||||
allErrors := field.ErrorList{}
|
||||
|
||||
uniqueTaints := map[api.TaintEffect]sets.String{}
|
||||
|
||||
for i, currTaint := range taints {
|
||||
idxPath := fldPath.Index(i)
|
||||
// validate the taint key
|
||||
|
|
@ -2338,6 +2656,20 @@ func validateTaints(taints []api.Taint, fldPath *field.Path) field.ErrorList {
|
|||
}
|
||||
// validate the taint effect
|
||||
allErrors = append(allErrors, validateTaintEffect(&currTaint.Effect, false, idxPath.Child("effect"))...)
|
||||
|
||||
// validate if taint is unique by <key, effect>
|
||||
if len(uniqueTaints[currTaint.Effect]) > 0 && uniqueTaints[currTaint.Effect].Has(currTaint.Key) {
|
||||
duplicatedError := field.Duplicate(idxPath, currTaint)
|
||||
duplicatedError.Detail = "taints must be unique by key and effect pair"
|
||||
allErrors = append(allErrors, duplicatedError)
|
||||
continue
|
||||
}
|
||||
|
||||
// add taint to existingTaints for uniqueness check
|
||||
if len(uniqueTaints[currTaint.Effect]) == 0 {
|
||||
uniqueTaints[currTaint.Effect] = sets.String{}
|
||||
}
|
||||
uniqueTaints[currTaint.Effect].Insert(currTaint.Key)
|
||||
}
|
||||
return allErrors
|
||||
}
|
||||
|
|
@ -2359,10 +2691,14 @@ func ValidateTaintsInNodeAnnotations(annotations map[string]string, fldPath *fie
|
|||
}
|
||||
|
||||
func ValidateNodeSpecificAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
|
||||
if annotations[api.TaintsAnnotationKey] != "" {
|
||||
return ValidateTaintsInNodeAnnotations(annotations, fldPath)
|
||||
allErrs := field.ErrorList{}
|
||||
if annotations[api.PreferAvoidPodsAnnotationKey] != "" {
|
||||
allErrs = append(allErrs, ValidateAvoidPodsInNodeAnnotations(annotations, fldPath)...)
|
||||
}
|
||||
return field.ErrorList{}
|
||||
if annotations[api.TaintsAnnotationKey] != "" {
|
||||
allErrs = append(allErrs, ValidateTaintsInNodeAnnotations(annotations, fldPath)...)
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidateNode tests if required fields in the node are set.
|
||||
|
|
@ -2780,11 +3116,11 @@ func ValidateResourceRequirements(requirements *api.ResourceRequirements, fldPat
|
|||
// Check that request <= limit.
|
||||
requestQuantity, exists := requirements.Requests[resourceName]
|
||||
if exists {
|
||||
// For GPUs, require that no request be set.
|
||||
if resourceName == api.ResourceNvidiaGPU {
|
||||
allErrs = append(allErrs, field.Invalid(reqPath, requestQuantity.String(), "cannot be set"))
|
||||
// For GPUs, not only requests can't exceed limits, they also can't be lower, i.e. must be equal.
|
||||
if resourceName == api.ResourceNvidiaGPU && quantity.Cmp(requestQuantity) != 0 {
|
||||
allErrs = append(allErrs, field.Invalid(reqPath, requestQuantity.String(), fmt.Sprintf("must be equal to %s limit", api.ResourceNvidiaGPU)))
|
||||
} else if quantity.Cmp(requestQuantity) < 0 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, quantity.String(), "must be greater than or equal to request"))
|
||||
allErrs = append(allErrs, field.Invalid(limPath, quantity.String(), fmt.Sprintf("must be greater than or equal to %s request", resourceName)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2957,7 +3293,7 @@ func validateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorL
|
|||
|
||||
if len(strings.Split(stringValue, "/")) == 1 {
|
||||
if !api.IsStandardFinalizerName(stringValue) {
|
||||
return append(allErrs, field.Invalid(fldPath, stringValue, fmt.Sprintf("name is neither a standard finalizer name nor is it fully qualified")))
|
||||
return append(allErrs, field.Invalid(fldPath, stringValue, "name is neither a standard finalizer name nor is it fully qualified"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3191,3 +3527,17 @@ func isValidHostnamesMap(serializedPodHostNames string) bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func sysctlIntersection(a []api.Sysctl, b []api.Sysctl) []string {
|
||||
lookup := make(map[string]struct{}, len(a))
|
||||
result := []string{}
|
||||
for i := range a {
|
||||
lookup[a[i].Name] = struct{}{}
|
||||
}
|
||||
for i := range b {
|
||||
if _, found := lookup[b[i].Name]; found {
|
||||
result = append(result, b[i].Name)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
|
|
|||
3749
vendor/k8s.io/kubernetes/pkg/api/zz_generated.deepcopy.go
generated
vendored
Normal file
3749
vendor/k8s.io/kubernetes/pkg/api/zz_generated.deepcopy.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue