Commit 392a4d94 authored by deads2k's avatar deads2k

update client-go staging

parent 4f8f6006
...@@ -324,143 +324,147 @@ ...@@ -324,143 +324,147 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/openapi", "ImportPath": "k8s.io/apimachinery/pkg/openapi",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/rand", "ImportPath": "k8s.io/apimachinery/pkg/util/rand",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" "Rev": "a6364387e6d54a910a0810543a14b6867eafaa99"
} }
] ]
} }
/*
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 openapi holds shared codes and types between open API code generator and spec generator.
package openapi
...@@ -19,11 +19,11 @@ package v1 ...@@ -19,11 +19,11 @@ package v1
import ( import (
"fmt" "fmt"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/fields"
) )
// The EventExpansion interface allows manually adding extra methods to the EventInterface. // The EventExpansion interface allows manually adding extra methods to the EventInterface.
......
...@@ -17,10 +17,10 @@ limitations under the License. ...@@ -17,10 +17,10 @@ limitations under the License.
package fake package fake
import ( import (
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/testing" "k8s.io/client-go/testing"
) )
......
...@@ -21,11 +21,11 @@ import ( ...@@ -21,11 +21,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/client-go/pkg/api/resource" "k8s.io/client-go/pkg/api/resource"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/pkg/util/intstr" "k8s.io/client-go/pkg/util/intstr"
utillabels "k8s.io/client-go/pkg/util/labels" utillabels "k8s.io/client-go/pkg/util/labels"
) )
......
...@@ -17,9 +17,9 @@ limitations under the License. ...@@ -17,9 +17,9 @@ limitations under the License.
package api package api
import ( import (
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/pkg/fields"
) )
func addDefaultingFuncs(scheme *runtime.Scheme) error { func addDefaultingFuncs(scheme *runtime.Scheme) error {
......
...@@ -27,13 +27,13 @@ import ( ...@@ -27,13 +27,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/selection"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/pkg/api/resource" "k8s.io/client-go/pkg/api/resource"
"k8s.io/client-go/pkg/fields"
) )
// Conversion error conveniently packages up errors in conversions. // Conversion error conveniently packages up errors in conversions.
......
...@@ -18,11 +18,11 @@ package api ...@@ -18,11 +18,11 @@ package api
import ( import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/pkg/api/resource" "k8s.io/client-go/pkg/api/resource"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/pkg/util/intstr" "k8s.io/client-go/pkg/util/intstr"
) )
...@@ -1856,6 +1856,10 @@ type PodSpec struct { ...@@ -1856,6 +1856,10 @@ type PodSpec struct {
// If specified, the pod's scheduling constraints // If specified, the pod's scheduling constraints
// +optional // +optional
Affinity *Affinity Affinity *Affinity
// If specified, the pod will be dispatched by specified scheduler.
// If not specified, the pod will be dispatched by default scheduler.
// +optional
SchedulerName string
} }
// Sysctl defines a kernel parameter to be set // Sysctl defines a kernel parameter to be set
......
...@@ -174,6 +174,9 @@ func SetDefaults_PodSpec(obj *PodSpec) { ...@@ -174,6 +174,9 @@ func SetDefaults_PodSpec(obj *PodSpec) {
period := int64(DefaultTerminationGracePeriodSeconds) period := int64(DefaultTerminationGracePeriodSeconds)
obj.TerminationGracePeriodSeconds = &period obj.TerminationGracePeriodSeconds = &period
} }
if obj.SchedulerName == "" {
obj.SchedulerName = DefaultSchedulerName
}
} }
func SetDefaults_Probe(obj *Probe) { func SetDefaults_Probe(obj *Probe) {
if obj.TimeoutSeconds == 0 { if obj.TimeoutSeconds == 0 {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2553,6 +2553,11 @@ message PodSpec { ...@@ -2553,6 +2553,11 @@ message PodSpec {
// If specified, the pod's scheduling constraints // If specified, the pod's scheduling constraints
// +optional // +optional
optional Affinity affinity = 18; optional Affinity affinity = 18;
// If specified, the pod will be dispatched by specified scheduler.
// If not specified, the pod will be dispatched by default scheduler.
// +optional
optional string schedulername = 19;
} }
// PodStatus represents information about the status of a pod. Status may trail the actual // PodStatus represents information about the status of a pod. Status may trail the actual
......
...@@ -22,12 +22,12 @@ import ( ...@@ -22,12 +22,12 @@ import (
"strings" "strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/selection"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/fields"
) )
// IsOpaqueIntResourceName returns true if the resource name has the opaque // IsOpaqueIntResourceName returns true if the resource name has the opaque
......
...@@ -2140,6 +2140,10 @@ type PodSpec struct { ...@@ -2140,6 +2140,10 @@ type PodSpec struct {
// If specified, the pod's scheduling constraints // If specified, the pod's scheduling constraints
// +optional // +optional
Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"` Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"`
// If specified, the pod will be dispatched by specified scheduler.
// If not specified, the pod will be dispatched by default scheduler.
// +optional
SchedulerName string `json:"schedulername,omitempty" protobuf:"bytes,19,opt,name=schedulername"`
} }
// PodSecurityContext holds pod-level security attributes and common container settings. // PodSecurityContext holds pod-level security attributes and common container settings.
......
...@@ -1294,6 +1294,7 @@ var map_PodSpec = map[string]string{ ...@@ -1294,6 +1294,7 @@ var map_PodSpec = map[string]string{
"hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.",
"subdomain": "If specified, the fully qualified Pod hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the pod will not have a domainname at all.", "subdomain": "If specified, the fully qualified Pod hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the pod will not have a domainname at all.",
"affinity": "If specified, the pod's scheduling constraints", "affinity": "If specified, the pod's scheduling constraints",
"schedulername": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.",
} }
func (PodSpec) SwaggerDoc() map[string]string { func (PodSpec) SwaggerDoc() map[string]string {
......
...@@ -3069,6 +3069,7 @@ func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conv ...@@ -3069,6 +3069,7 @@ func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conv
out.Hostname = in.Hostname out.Hostname = in.Hostname
out.Subdomain = in.Subdomain out.Subdomain = in.Subdomain
out.Affinity = (*api.Affinity)(unsafe.Pointer(in.Affinity)) out.Affinity = (*api.Affinity)(unsafe.Pointer(in.Affinity))
out.SchedulerName = in.SchedulerName
return nil return nil
} }
...@@ -3106,6 +3107,7 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv ...@@ -3106,6 +3107,7 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv
out.Hostname = in.Hostname out.Hostname = in.Hostname
out.Subdomain = in.Subdomain out.Subdomain = in.Subdomain
out.Affinity = (*Affinity)(unsafe.Pointer(in.Affinity)) out.Affinity = (*Affinity)(unsafe.Pointer(in.Affinity))
out.SchedulerName = in.SchedulerName
return nil return nil
} }
......
...@@ -23,10 +23,10 @@ package api ...@@ -23,10 +23,10 @@ package api
import ( import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion" conversion "k8s.io/apimachinery/pkg/conversion"
fields "k8s.io/apimachinery/pkg/fields"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
fields "k8s.io/client-go/pkg/fields"
reflect "reflect" reflect "reflect"
) )
......
...@@ -1679,7 +1679,7 @@ func (x codecSelfer1234) decSliceStatefulSet(v *[]StatefulSet, d *codec1978.Deco ...@@ -1679,7 +1679,7 @@ func (x codecSelfer1234) decSliceStatefulSet(v *[]StatefulSet, d *codec1978.Deco
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 808) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 824)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
......
...@@ -2481,7 +2481,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { ...@@ -2481,7 +2481,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 832) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 848)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
......
...@@ -4534,7 +4534,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { ...@@ -4534,7 +4534,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 832) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 848)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
...@@ -4772,7 +4772,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) { ...@@ -4772,7 +4772,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 1080) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 1096)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
......
...@@ -21093,7 +21093,7 @@ func (x codecSelfer1234) decSliceDeployment(v *[]Deployment, d *codec1978.Decode ...@@ -21093,7 +21093,7 @@ func (x codecSelfer1234) decSliceDeployment(v *[]Deployment, d *codec1978.Decode
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 872) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 888)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
...@@ -21212,7 +21212,7 @@ func (x codecSelfer1234) decSliceDaemonSet(v *[]DaemonSet, d *codec1978.Decoder) ...@@ -21212,7 +21212,7 @@ func (x codecSelfer1234) decSliceDaemonSet(v *[]DaemonSet, d *codec1978.Decoder)
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 768) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 784)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
...@@ -21926,7 +21926,7 @@ func (x codecSelfer1234) decSliceReplicaSet(v *[]ReplicaSet, d *codec1978.Decode ...@@ -21926,7 +21926,7 @@ func (x codecSelfer1234) decSliceReplicaSet(v *[]ReplicaSet, d *codec1978.Decode
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 808) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 824)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
......
...@@ -39,6 +39,7 @@ type MasterConfiguration struct { ...@@ -39,6 +39,7 @@ type MasterConfiguration struct {
Networking Networking Networking Networking
KubernetesVersion string KubernetesVersion string
CloudProvider string CloudProvider string
AuthorizationMode string
} }
type API struct { type API struct {
......
...@@ -16,9 +16,7 @@ limitations under the License. ...@@ -16,9 +16,7 @@ limitations under the License.
package v1alpha1 package v1alpha1
import ( import "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
)
const ( const (
DefaultServiceDNSDomain = "cluster.local" DefaultServiceDNSDomain = "cluster.local"
...@@ -27,6 +25,7 @@ const ( ...@@ -27,6 +25,7 @@ const (
DefaultKubernetesFallbackVersion = "v1.5.0" DefaultKubernetesFallbackVersion = "v1.5.0"
DefaultAPIBindPort = 6443 DefaultAPIBindPort = 6443
DefaultDiscoveryBindPort = 9898 DefaultDiscoveryBindPort = 9898
DefaultAuthorizationMode = "RBAC"
) )
func addDefaultingFuncs(scheme *runtime.Scheme) error { func addDefaultingFuncs(scheme *runtime.Scheme) error {
...@@ -56,4 +55,8 @@ func SetDefaults_MasterConfiguration(obj *MasterConfiguration) { ...@@ -56,4 +55,8 @@ func SetDefaults_MasterConfiguration(obj *MasterConfiguration) {
if obj.Discovery.Token == nil && obj.Discovery.File == nil && obj.Discovery.HTTPS == nil { if obj.Discovery.Token == nil && obj.Discovery.File == nil && obj.Discovery.HTTPS == nil {
obj.Discovery.Token = &TokenDiscovery{} obj.Discovery.Token = &TokenDiscovery{}
} }
if obj.AuthorizationMode == "" {
obj.AuthorizationMode = DefaultAuthorizationMode
}
} }
...@@ -29,6 +29,7 @@ type MasterConfiguration struct { ...@@ -29,6 +29,7 @@ type MasterConfiguration struct {
Networking Networking `json:"networking"` Networking Networking `json:"networking"`
KubernetesVersion string `json:"kubernetesVersion"` KubernetesVersion string `json:"kubernetesVersion"`
CloudProvider string `json:"cloudProvider"` CloudProvider string `json:"cloudProvider"`
AuthorizationMode string `json:"authorizationMode"`
} }
type API struct { type API struct {
......
...@@ -90,7 +90,7 @@ func NewSignedCert(cfg Config, key *rsa.PrivateKey, caCert *x509.Certificate, ca ...@@ -90,7 +90,7 @@ func NewSignedCert(cfg Config, key *rsa.PrivateKey, caCert *x509.Certificate, ca
certTmpl := x509.Certificate{ certTmpl := x509.Certificate{
Subject: pkix.Name{ Subject: pkix.Name{
CommonName: cfg.CommonName, CommonName: cfg.CommonName,
Organization: caCert.Subject.Organization, Organization: cfg.Organization,
}, },
DNSNames: cfg.AltNames.DNSNames, DNSNames: cfg.AltNames.DNSNames,
IPAddresses: cfg.AltNames.IPs, IPAddresses: cfg.AltNames.IPs,
......
...@@ -48,6 +48,13 @@ const ( ...@@ -48,6 +48,13 @@ const (
deleteFromPrimitiveListDirectivePrefix = "$deleteFromPrimitiveList" deleteFromPrimitiveListDirectivePrefix = "$deleteFromPrimitiveList"
) )
// JSONMap is a representations of JSON object encoded as map[string]interface{}
// where the children can be either map[string]interface{}, []interface{} or
// primitive type).
// Operating on JSONMap representation is much faster as it doesn't require any
// json marshaling and/or unmarshaling operations.
type JSONMap map[string]interface{}
// IsPreconditionFailed returns true if the provided error indicates // IsPreconditionFailed returns true if the provided error indicates
// a precondition failed. // a precondition failed.
func IsPreconditionFailed(err error) bool { func IsPreconditionFailed(err error) bool {
...@@ -136,11 +143,6 @@ func RequireMetadataKeyUnchanged(key string) PreconditionFunc { ...@@ -136,11 +143,6 @@ func RequireMetadataKeyUnchanged(key string) PreconditionFunc {
} }
} }
// Deprecated: Use the synonym CreateTwoWayMergePatch, instead.
func CreateStrategicMergePatch(original, modified []byte, dataStruct interface{}) ([]byte, error) {
return CreateTwoWayMergePatch(original, modified, dataStruct)
}
// CreateTwoWayMergePatch creates a patch that can be passed to StrategicMergePatch from an original // CreateTwoWayMergePatch creates a patch that can be passed to StrategicMergePatch from an original
// document and a modified document, which are passed to the method as json encoded content. It will // document and a modified document, which are passed to the method as json encoded content. It will
// return a patch that yields the modified document when applied to the original document, or an error // return a patch that yields the modified document when applied to the original document, or an error
...@@ -160,12 +162,24 @@ func CreateTwoWayMergePatch(original, modified []byte, dataStruct interface{}, f ...@@ -160,12 +162,24 @@ func CreateTwoWayMergePatch(original, modified []byte, dataStruct interface{}, f
} }
} }
patchMap, err := CreateTwoWayMergeMapPatch(originalMap, modifiedMap, dataStruct, fns...)
if err != nil {
return nil, err
}
return json.Marshal(patchMap)
}
// CreateTwoWayMergeMapPatch creates a patch from an original and modified JSON objects,
// encoded JSONMap.
// The serialized version of the map can then be passed to StrategicMergeMapPatch.
func CreateTwoWayMergeMapPatch(original, modified JSONMap, dataStruct interface{}, fns ...PreconditionFunc) (JSONMap, error) {
t, err := getTagStructType(dataStruct) t, err := getTagStructType(dataStruct)
if err != nil { if err != nil {
return nil, err return nil, err
} }
patchMap, err := diffMaps(originalMap, modifiedMap, t, false, false) patchMap, err := diffMaps(original, modified, t, false, false)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -177,7 +191,7 @@ func CreateTwoWayMergePatch(original, modified []byte, dataStruct interface{}, f ...@@ -177,7 +191,7 @@ func CreateTwoWayMergePatch(original, modified []byte, dataStruct interface{}, f
} }
} }
return json.Marshal(patchMap) return patchMap, nil
} }
// Returns a (recursive) strategic merge patch that yields modified when applied to original. // Returns a (recursive) strategic merge patch that yields modified when applied to original.
...@@ -494,12 +508,6 @@ loopB: ...@@ -494,12 +508,6 @@ loopB:
return patch, nil return patch, nil
} }
// Deprecated: StrategicMergePatchData is deprecated. Use the synonym StrategicMergePatch,
// instead, which follows the naming convention of evanphx/json-patch.
func StrategicMergePatchData(original, patch []byte, dataStruct interface{}) ([]byte, error) {
return StrategicMergePatch(original, patch, dataStruct)
}
// StrategicMergePatch applies a strategic merge patch. The patch and the original document // StrategicMergePatch applies a strategic merge patch. The patch and the original document
// must be json encoded content. A patch can be created from an original and a modified document // must be json encoded content. A patch can be created from an original and a modified document
// by calling CreateStrategicMergePatch. // by calling CreateStrategicMergePatch.
...@@ -524,17 +532,23 @@ func StrategicMergePatch(original, patch []byte, dataStruct interface{}) ([]byte ...@@ -524,17 +532,23 @@ func StrategicMergePatch(original, patch []byte, dataStruct interface{}) ([]byte
return nil, errBadJSONDoc return nil, errBadJSONDoc
} }
t, err := getTagStructType(dataStruct) result, err := StrategicMergeMapPatch(originalMap, patchMap, dataStruct)
if err != nil { if err != nil {
return nil, err return nil, err
} }
result, err := mergeMap(originalMap, patchMap, t, true) return json.Marshal(result)
}
// StrategicMergePatch applies a strategic merge patch. The original and patch documents
// must be JSONMap. A patch can be created from an original and modified document by
// calling CreateTwoWayMergeMapPatch.
func StrategicMergeMapPatch(original, patch JSONMap, dataStruct interface{}) (JSONMap, error) {
t, err := getTagStructType(dataStruct)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return mergeMap(original, patch, t, true)
return json.Marshal(result)
} }
func getTagStructType(dataStruct interface{}) (reflect.Type, error) { func getTagStructType(dataStruct interface{}) (reflect.Type, error) {
......
...@@ -35,6 +35,7 @@ import ( ...@@ -35,6 +35,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
...@@ -44,7 +45,6 @@ import ( ...@@ -44,7 +45,6 @@ import (
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/api/v1"
pathvalidation "k8s.io/client-go/pkg/api/validation/path" pathvalidation "k8s.io/client-go/pkg/api/validation/path"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/pkg/util/flowcontrol" "k8s.io/client-go/pkg/util/flowcontrol"
restclientwatch "k8s.io/client-go/rest/watch" restclientwatch "k8s.io/client-go/rest/watch"
"k8s.io/client-go/tools/metrics" "k8s.io/client-go/tools/metrics"
......
...@@ -21,12 +21,12 @@ import ( ...@@ -21,12 +21,12 @@ import (
"path" "path"
"strings" "strings"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/fields"
) )
func NewRootGetAction(resource schema.GroupVersionResource, name string) GetActionImpl { func NewRootGetAction(resource schema.GroupVersionResource, name string) GetActionImpl {
......
...@@ -20,11 +20,11 @@ import ( ...@@ -20,11 +20,11 @@ import (
"time" "time"
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
) )
......
...@@ -244,7 +244,7 @@ func (e *eventLogger) eventObserve(newEvent *v1.Event) (*v1.Event, []byte, error ...@@ -244,7 +244,7 @@ func (e *eventLogger) eventObserve(newEvent *v1.Event) (*v1.Event, []byte, error
newData, _ := json.Marshal(event) newData, _ := json.Marshal(event)
oldData, _ := json.Marshal(eventCopy2) oldData, _ := json.Marshal(eventCopy2)
patch, err = strategicpatch.CreateStrategicMergePatch(oldData, newData, event) patch, err = strategicpatch.CreateTwoWayMergePatch(oldData, newData, event)
} }
// record our new observation // record our new observation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment