Vendor: Update k8s version

Signed-off-by: Michał Żyłowski <michal.zylowski@intel.com>
This commit is contained in:
Michał Żyłowski 2017-02-03 14:41:32 +01:00
parent dfa93414c5
commit 52baf68d50
3756 changed files with 113013 additions and 92675 deletions

View file

@ -12,9 +12,12 @@ go_library(
srcs = ["install.go"],
tags = ["automanaged"],
deps = [
"//pkg/apimachinery/announced:go_default_library",
"//pkg/api:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/v1beta1:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/announced",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/registered",
"//vendor:k8s.io/apimachinery/pkg/runtime",
],
)

View file

@ -19,12 +19,20 @@ limitations under the License.
package install
import (
"k8s.io/kubernetes/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/apps/v1beta1"
)
func init() {
Install(api.GroupFactoryRegistry, api.Registry, api.Scheme)
}
// Install registers the API group and adds types to a scheme
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: apps.GroupName,
@ -35,7 +43,7 @@ func init() {
announced.VersionToSchemeFunc{
v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
},
).Announce().RegisterAndEnable(); err != nil {
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
panic(err)
}
}

View file

@ -19,7 +19,6 @@ package apps
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api"
)
var (
@ -49,8 +48,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&StatefulSet{},
&StatefulSetList{},
&api.ListOptions{},
&api.DeleteOptions{},
)
return nil
}

View file

@ -32,7 +32,7 @@ import (
type StatefulSet struct {
metav1.TypeMeta
// +optional
api.ObjectMeta
metav1.ObjectMeta
// Spec defines the desired identities of pods in this set.
// +optional

View file

@ -343,7 +343,7 @@ func (this *StatefulSet) String() string {
return "nil"
}
s := strings.Join([]string{`&StatefulSet{`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "StatefulSetSpec", "StatefulSetSpec", 1), `&`, ``, 1) + `,`,
`Status:` + strings.Replace(strings.Replace(this.Status.String(), "StatefulSetStatus", "StatefulSetStatus", 1), `&`, ``, 1) + `,`,
`}`,
@ -1034,45 +1034,45 @@ var (
var fileDescriptorGenerated = []byte{
// 645 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x53, 0x4d, 0x6f, 0xd3, 0x40,
0x10, 0x8d, 0x93, 0xa6, 0x84, 0x4d, 0xf9, 0x5a, 0x2a, 0x14, 0x55, 0xc8, 0xad, 0x72, 0x21, 0x48,
0xed, 0x5a, 0x69, 0x0b, 0x54, 0x1c, 0x8d, 0x04, 0x42, 0x02, 0x8a, 0x1c, 0x54, 0x41, 0x81, 0xc3,
0xda, 0x99, 0xa6, 0x4b, 0xfc, 0x25, 0xef, 0x38, 0x12, 0x37, 0x2e, 0x1c, 0xb8, 0xf1, 0x2f, 0xf8,
0x07, 0xfc, 0x86, 0x8a, 0x53, 0x8f, 0x9c, 0x2a, 0x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 0x53, 0x83,
0xea, 0x9d, 0xe9, 0x27, 0x27, 0x9f, 0xd7, 0xfc, 0x6a, 0x90, 0x1b, 0x85, 0x9b, 0xa5, 0x4f, 0x08,
0x8d, 0xdc, 0x2c, 0x0d, 0xba, 0x4f, 0x47, 0x7f, 0x74, 0x11, 0x85, 0x6a, 0x89, 0x15, 0xfb, 0xd6,
0xf0, 0x64, 0x95, 0xee, 0x16, 0xbe, 0x3a, 0x33, 0x14, 0x74, 0x3d, 0x77, 0x02, 0x65, 0x75, 0x02,
0x13, 0x2b, 0x8b, 0x67, 0x60, 0xdf, 0x3d, 0x3a, 0x35, 0x4b, 0xc7, 0xa7, 0x66, 0xe9, 0xd7, 0xa9,
0x59, 0xfa, 0x3c, 0x34, 0x8d, 0xa3, 0xa1, 0x69, 0x1c, 0x0f, 0x4d, 0xe3, 0xf7, 0xd0, 0x34, 0xbe,
0xfd, 0x31, 0x4b, 0xfb, 0x97, 0xf4, 0x45, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x5a, 0x18,
0x81, 0x34, 0x06, 0x00, 0x00,
}

View file

@ -39,7 +39,7 @@ option go_package = "v1beta1";
// map to the same storage identity.
message StatefulSet {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired identities of pods in this set.
// +optional

View file

@ -20,7 +20,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api/v1"
)
// GroupName is the group name use in this package
@ -44,10 +43,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&StatefulSet{},
&StatefulSetList{},
&v1.ListOptions{},
&v1.DeleteOptions{},
&metav1.ExportOptions{},
&metav1.GetOptions{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil

View file

@ -26,9 +26,9 @@ import (
"fmt"
codec1978 "github.com/ugorji/go/codec"
pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg3_types "k8s.io/apimachinery/pkg/types"
pkg2_types "k8s.io/apimachinery/pkg/types"
pkg4_resource "k8s.io/kubernetes/pkg/api/resource"
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg3_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg5_intstr "k8s.io/kubernetes/pkg/util/intstr"
"reflect"
"runtime"
@ -66,9 +66,9 @@ func init() {
}
if false { // reference the types, but skip this branch at build/run time
var v0 pkg1_v1.TypeMeta
var v1 pkg3_types.UID
var v1 pkg2_types.UID
var v2 pkg4_resource.Quantity
var v3 pkg2_v1.ObjectMeta
var v3 pkg3_v1.PodTemplateSpec
var v4 pkg5_intstr.IntOrString
var v5 time.Time
_, _, _, _, _, _ = v0, v1, v2, v3, v4, v5
@ -164,7 +164,13 @@ func (x *StatefulSet) CodecEncodeSelf(e *codec1978.Encoder) {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yy10 := &x.ObjectMeta
yy10.CodecEncodeSelf(e)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(yy10) {
} else {
z.EncFallback(yy10)
}
} else {
r.EncodeNil()
}
@ -174,7 +180,13 @@ func (x *StatefulSet) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy12 := &x.ObjectMeta
yy12.CodecEncodeSelf(e)
yym13 := z.EncBinary()
_ = yym13
if false {
} else if z.HasExtensions() && z.EncExt(yy12) {
} else {
z.EncFallback(yy12)
}
}
}
if yyr2 || yy2arr2 {
@ -298,24 +310,30 @@ func (x *StatefulSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv8 := &x.ObjectMeta
yyv8.CodecDecodeSelf(d)
yym9 := z.DecBinary()
_ = yym9
if false {
} else if z.HasExtensions() && z.DecExt(yyv8) {
} else {
z.DecFallback(yyv8, false)
}
}
case "spec":
if r.TryDecodeAsNil() {
x.Spec = StatefulSetSpec{}
} else {
yyv9 := &x.Spec
yyv9.CodecDecodeSelf(d)
yyv10 := &x.Spec
yyv10.CodecDecodeSelf(d)
}
case "status":
if r.TryDecodeAsNil() {
x.Status = StatefulSetStatus{}
} else {
yyv10 := &x.Status
yyv10.CodecDecodeSelf(d)
yyv11 := &x.Status
yyv11.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@ -328,16 +346,16 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj11 int
var yyb11 bool
var yyhl11 bool = l >= 0
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
var yyj12 int
var yyb12 bool
var yyhl12 bool = l >= 0
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -345,21 +363,21 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
yyv12 := &x.Kind
yym13 := z.DecBinary()
_ = yym13
yyv13 := &x.Kind
yym14 := z.DecBinary()
_ = yym14
if false {
} else {
*((*string)(yyv12)) = r.DecodeString()
*((*string)(yyv13)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -367,38 +385,44 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv14 := &x.APIVersion
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.APIVersion
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv16 := &x.ObjectMeta
yyv16.CodecDecodeSelf(d)
yyv17 := &x.ObjectMeta
yym18 := z.DecBinary()
_ = yym18
if false {
} else if z.HasExtensions() && z.DecExt(yyv17) {
} else {
z.DecFallback(yyv17, false)
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -406,16 +430,16 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Spec = StatefulSetSpec{}
} else {
yyv17 := &x.Spec
yyv17.CodecDecodeSelf(d)
yyv19 := &x.Spec
yyv19.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -423,21 +447,21 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Status = StatefulSetStatus{}
} else {
yyv18 := &x.Status
yyv18.CodecDecodeSelf(d)
yyv20 := &x.Status
yyv20.CodecDecodeSelf(d)
}
for {
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj11-1, "")
z.DecStructFieldNotFound(yyj12-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
@ -566,7 +590,7 @@ func (x *StatefulSetSpec) CodecEncodeSelf(e *codec1978.Encoder) {
_ = yym17
if false {
} else {
h.encSlicev1_PersistentVolumeClaim(([]pkg2_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
h.encSlicev1_PersistentVolumeClaim(([]pkg3_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
}
}
} else {
@ -584,7 +608,7 @@ func (x *StatefulSetSpec) CodecEncodeSelf(e *codec1978.Encoder) {
_ = yym18
if false {
} else {
h.encSlicev1_PersistentVolumeClaim(([]pkg2_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
h.encSlicev1_PersistentVolumeClaim(([]pkg3_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
}
}
}
@ -704,7 +728,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "template":
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
x.Template = pkg3_v1.PodTemplateSpec{}
} else {
yyv8 := &x.Template
yyv8.CodecDecodeSelf(d)
@ -718,7 +742,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
_ = yym10
if false {
} else {
h.decSlicev1_PersistentVolumeClaim((*[]pkg2_v1.PersistentVolumeClaim)(yyv9), d)
h.decSlicev1_PersistentVolumeClaim((*[]pkg3_v1.PersistentVolumeClaim)(yyv9), d)
}
}
case "serviceName":
@ -812,7 +836,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
x.Template = pkg3_v1.PodTemplateSpec{}
} else {
yyv18 := &x.Template
yyv18.CodecDecodeSelf(d)
@ -836,7 +860,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
_ = yym20
if false {
} else {
h.decSlicev1_PersistentVolumeClaim((*[]pkg2_v1.PersistentVolumeClaim)(yyv19), d)
h.decSlicev1_PersistentVolumeClaim((*[]pkg3_v1.PersistentVolumeClaim)(yyv19), d)
}
}
yyj13++
@ -1497,7 +1521,7 @@ func (x *StatefulSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x codecSelfer1234) encSlicev1_PersistentVolumeClaim(v []pkg2_v1.PersistentVolumeClaim, e *codec1978.Encoder) {
func (x codecSelfer1234) encSlicev1_PersistentVolumeClaim(v []pkg3_v1.PersistentVolumeClaim, e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
@ -1510,7 +1534,7 @@ func (x codecSelfer1234) encSlicev1_PersistentVolumeClaim(v []pkg2_v1.Persistent
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.PersistentVolumeClaim, d *codec1978.Decoder) {
func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg3_v1.PersistentVolumeClaim, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
@ -1521,7 +1545,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
_ = yyc1
if yyl1 == 0 {
if yyv1 == nil {
yyv1 = []pkg2_v1.PersistentVolumeClaim{}
yyv1 = []pkg3_v1.PersistentVolumeClaim{}
yyc1 = true
} else if len(yyv1) != 0 {
yyv1 = yyv1[:0]
@ -1541,10 +1565,10 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
} else {
yyv1 = make([]pkg2_v1.PersistentVolumeClaim, yyrl1)
yyv1 = make([]pkg3_v1.PersistentVolumeClaim, yyrl1)
}
} else {
yyv1 = make([]pkg2_v1.PersistentVolumeClaim, yyrl1)
yyv1 = make([]pkg3_v1.PersistentVolumeClaim, yyrl1)
}
yyc1 = true
yyrr1 = len(yyv1)
@ -1559,7 +1583,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
for ; yyj1 < yyrr1; yyj1++ {
yyh1.ElemContainerState(yyj1)
if r.TryDecodeAsNil() {
yyv1[yyj1] = pkg2_v1.PersistentVolumeClaim{}
yyv1[yyj1] = pkg3_v1.PersistentVolumeClaim{}
} else {
yyv2 := &yyv1[yyj1]
yyv2.CodecDecodeSelf(d)
@ -1568,10 +1592,10 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
}
if yyrt1 {
for ; yyj1 < yyl1; yyj1++ {
yyv1 = append(yyv1, pkg2_v1.PersistentVolumeClaim{})
yyv1 = append(yyv1, pkg3_v1.PersistentVolumeClaim{})
yyh1.ElemContainerState(yyj1)
if r.TryDecodeAsNil() {
yyv1[yyj1] = pkg2_v1.PersistentVolumeClaim{}
yyv1[yyj1] = pkg3_v1.PersistentVolumeClaim{}
} else {
yyv3 := &yyv1[yyj1]
yyv3.CodecDecodeSelf(d)
@ -1585,13 +1609,13 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
for ; !r.CheckBreak(); yyj1++ {
if yyj1 >= len(yyv1) {
yyv1 = append(yyv1, pkg2_v1.PersistentVolumeClaim{}) // var yyz1 pkg2_v1.PersistentVolumeClaim
yyv1 = append(yyv1, pkg3_v1.PersistentVolumeClaim{}) // var yyz1 pkg3_v1.PersistentVolumeClaim
yyc1 = true
}
yyh1.ElemContainerState(yyj1)
if yyj1 < len(yyv1) {
if r.TryDecodeAsNil() {
yyv1[yyj1] = pkg2_v1.PersistentVolumeClaim{}
yyv1[yyj1] = pkg3_v1.PersistentVolumeClaim{}
} else {
yyv4 := &yyv1[yyj1]
yyv4.CodecDecodeSelf(d)
@ -1606,7 +1630,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
yyv1 = yyv1[:yyj1]
yyc1 = true
} else if yyj1 == 0 && yyv1 == nil {
yyv1 = []pkg2_v1.PersistentVolumeClaim{}
yyv1 = []pkg3_v1.PersistentVolumeClaim{}
yyc1 = true
}
}
@ -1655,7 +1679,7 @@ func (x codecSelfer1234) decSliceStatefulSet(v *[]StatefulSet, d *codec1978.Deco
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 808)
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 824)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]

View file

@ -32,7 +32,7 @@ import (
type StatefulSet struct {
metav1.TypeMeta `json:",inline"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the desired identities of pods in this set.
// +optional

View file

@ -50,10 +50,7 @@ func RegisterConversions(scheme *runtime.Scheme) error {
}
func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -68,10 +65,7 @@ func Convert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.
}
func autoConvert_apps_StatefulSet_To_v1beta1_StatefulSet(in *apps.StatefulSet, out *StatefulSet, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}

View file

@ -21,10 +21,10 @@ limitations under the License.
package v1beta1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kubernetes/pkg/api/v1"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
reflect "reflect"
)
@ -48,8 +48,10 @@ func DeepCopy_v1beta1_StatefulSet(in interface{}, out interface{}, c *conversion
in := in.(*StatefulSet)
out := out.(*StatefulSet)
*out = *in
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_v1beta1_StatefulSetSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -94,17 +96,17 @@ func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conver
if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
*out = newVal.(*meta_v1.LabelSelector)
*out = newVal.(*v1.LabelSelector)
}
}
if err := v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
if err := api_v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]v1.PersistentVolumeClaim, len(*in))
*out = make([]api_v1.PersistentVolumeClaim, len(*in))
for i := range *in {
if err := v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
if err := api_v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}

View file

@ -29,7 +29,7 @@ func TestValidateStatefulSet(t *testing.T) {
validLabels := map[string]string{"a": "b"}
validPodTemplate := api.PodTemplate{
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
Spec: api.PodSpec{
@ -46,21 +46,21 @@ func TestValidateStatefulSet(t *testing.T) {
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: invalidLabels,
},
},
}
successCases := []apps.StatefulSet{
{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
{
ObjectMeta: api.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc-123", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
@ -75,49 +75,49 @@ func TestValidateStatefulSet(t *testing.T) {
errorCases := map[string]apps.StatefulSet{
"zero-length ID": {
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
"missing-namespace": {
ObjectMeta: api.ObjectMeta{Name: "abc-123"},
ObjectMeta: metav1.ObjectMeta{Name: "abc-123"},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
"empty selector": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Template: validPodTemplate.Template,
},
},
"selector_doesnt_match": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
Template: validPodTemplate.Template,
},
},
"invalid manifest": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
},
},
"negative_replicas": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: -1,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
},
},
"invalid_label": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Namespace: metav1.NamespaceDefault,
Labels: map[string]string{
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
},
@ -128,9 +128,9 @@ func TestValidateStatefulSet(t *testing.T) {
},
},
"invalid_label 2": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Namespace: metav1.NamespaceDefault,
Labels: map[string]string{
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
},
@ -140,9 +140,9 @@ func TestValidateStatefulSet(t *testing.T) {
},
},
"invalid_annotation": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Namespace: metav1.NamespaceDefault,
Annotations: map[string]string{
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
},
@ -153,9 +153,9 @@ func TestValidateStatefulSet(t *testing.T) {
},
},
"invalid restart policy 1": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Namespace: metav1.NamespaceDefault,
},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -165,16 +165,16 @@ func TestValidateStatefulSet(t *testing.T) {
DNSPolicy: api.DNSClusterFirst,
Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}},
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
},
},
},
"invalid restart policy 2": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Namespace: metav1.NamespaceDefault,
},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -184,7 +184,7 @@ func TestValidateStatefulSet(t *testing.T) {
DNSPolicy: api.DNSClusterFirst,
Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}},
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
},
@ -219,7 +219,7 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
validLabels := map[string]string{"a": "b"}
validPodTemplate := api.PodTemplate{
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
Spec: api.PodSpec{
@ -231,7 +231,7 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
}
readWriteVolumePodTemplate := api.PodTemplate{
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
Spec: api.PodSpec{
@ -249,7 +249,7 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: invalidLabels,
},
},
@ -261,14 +261,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
successCases := []psUpdateTest{
{
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 3,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -287,14 +287,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
errorCases := map[string]psUpdateTest{
"more than one read/write": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 2,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -304,14 +304,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"updates to a field other than spec.Replicas": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 1,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -321,14 +321,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"invalid selector": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 2,
Selector: &metav1.LabelSelector{MatchLabels: invalidLabels},
@ -338,14 +338,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"invalid pod": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 2,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -355,14 +355,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"negative replicas": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: metav1.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: -1,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},

View file

@ -48,8 +48,10 @@ func DeepCopy_apps_StatefulSet(in interface{}, out interface{}, c *conversion.Cl
in := in.(*StatefulSet)
out := out.(*StatefulSet)
*out = *in
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_apps_StatefulSetSpec(&in.Spec, &out.Spec, c); err != nil {
return err