Merge pull request #19349 from caesarxuchao/generate-updatestatus

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2016-01-13 16:51:33 -08:00
commit ec78f3d5a9
20 changed files with 1052 additions and 477 deletions

View File

@ -19,6 +19,7 @@ package generators
import ( import (
"io" "io"
"path/filepath" "path/filepath"
"strings"
"k8s.io/kubernetes/cmd/libs/go2idl/generator" "k8s.io/kubernetes/cmd/libs/go2idl/generator"
"k8s.io/kubernetes/cmd/libs/go2idl/namer" "k8s.io/kubernetes/cmd/libs/go2idl/namer"
@ -49,6 +50,18 @@ func (g *genClientForType) Imports(c *generator.Context) (imports []string) {
return g.imports.ImportLines() return g.imports.ImportLines()
} }
// Ideally, we'd like hasStatus to return true if there is a subresource path
// registered for "status" in the API server, but we do not have that
// information, so hasStatus returns true if the type has a status field.
func hasStatus(t *types.Type) bool {
for _, m := range t.Members {
if m.Name == "Status" && strings.Contains(m.Tags, `json:"status`) {
return true
}
}
return false
}
// GenerateType makes the body of a file implementing a set for type t. // GenerateType makes the body of a file implementing a set for type t.
func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
sw := generator.NewSnippetWriter(w, c, "$", "$") sw := generator.NewSnippetWriter(w, c, "$", "$")
@ -63,11 +76,20 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
"apiListOptions": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ListOptions"}), "apiListOptions": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ListOptions"}),
} }
sw.Do(namespacerTemplate, m) sw.Do(namespacerTemplate, m)
sw.Do(interfaceTemplate, m) sw.Do(interfaceTemplate1, m)
// Include the UpdateStatus method if the type has a status
if hasStatus(t) {
sw.Do(interfaceUpdateStatusTemplate, m)
}
sw.Do(interfaceTemplate2, m)
sw.Do(structTemplate, m) sw.Do(structTemplate, m)
sw.Do(newStructTemplate, m) sw.Do(newStructTemplate, m)
sw.Do(createTemplate, m) sw.Do(createTemplate, m)
sw.Do(updateTemplate, m) sw.Do(updateTemplate, m)
// Generate the UpdateStatus method if the type has a status
if hasStatus(t) {
sw.Do(updateStatusTemplate, m)
}
sw.Do(deleteTemplate, m) sw.Do(deleteTemplate, m)
sw.Do(deleteCollectionTemplate, m) sw.Do(deleteCollectionTemplate, m)
sw.Do(getTemplate, m) sw.Do(getTemplate, m)
@ -86,11 +108,17 @@ type $.type|public$Namespacer interface {
` `
// template for the Interface // template for the Interface
var interfaceTemplate = ` var interfaceTemplate1 = `
// $.type|public$Interface has methods to work with $.type|public$ resources. // $.type|public$Interface has methods to work with $.type|public$ resources.
type $.type|public$Interface interface { type $.type|public$Interface interface {
Create(*$.type|raw$) (*$.type|raw$, error) Create(*$.type|raw$) (*$.type|raw$, error)
Update(*$.type|raw$) (*$.type|raw$, error) Update(*$.type|raw$) (*$.type|raw$, error)`
var interfaceUpdateStatusTemplate = `
UpdateStatus(*$.type|raw$) (*$.type|raw$, error)`
// template for the Interface
var interfaceTemplate2 = `
Delete(name string, options *$.apiDeleteOptions|raw$) error Delete(name string, options *$.apiDeleteOptions|raw$) error
DeleteCollection(options *$.apiDeleteOptions|raw$, listOptions $.apiListOptions|raw$) error DeleteCollection(options *$.apiDeleteOptions|raw$, listOptions $.apiListOptions|raw$) error
Get(name string) (*$.type|raw$, error) Get(name string) (*$.type|raw$, error)
@ -199,6 +227,14 @@ func (c *$.type|privatePlural$) Update($.type|private$ *$.type|raw$) (result *$.
} }
` `
var updateStatusTemplate = `
func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (*$.type|raw$, error) {
result := &$.type|raw${}
err := c.client.Put().Resource("$.type|privatePlural$").Name($.type|private$.Name).SubResource("status").Body($.type|private$).Do().Into(result)
return result, err
}
`
var watchTemplate = ` var watchTemplate = `
// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. // Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$.
func (c *$.type|privatePlural$) Watch(opts $.apiListOptions|raw$) ($.watchInterface|raw$, error) { func (c *$.type|privatePlural$) Watch(opts $.apiListOptions|raw$) ($.watchInterface|raw$, error) {

View File

@ -85,15 +85,16 @@ func (x *TestType) CodecEncodeSelf(e *codec1978.Encoder) {
} else { } else {
yysep2 := !z.EncBinary() yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [3]bool var yyq2 [4]bool
_, _, _ = yysep2, yyq2, yy2arr2 _, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false const yyr2 bool = false
yyq2[0] = x.Kind != "" yyq2[0] = x.Kind != ""
yyq2[1] = x.APIVersion != "" yyq2[1] = x.APIVersion != ""
yyq2[2] = true yyq2[2] = true
yyq2[3] = true
var yynn2 int var yynn2 int
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
r.EncodeArrayStart(3) r.EncodeArrayStart(4)
} else { } else {
yynn2 = 0 yynn2 = 0
for _, b := range yyq2 { for _, b := range yyq2 {
@ -171,6 +172,23 @@ func (x *TestType) CodecEncodeSelf(e *codec1978.Encoder) {
yy11.CodecEncodeSelf(e) yy11.CodecEncodeSelf(e)
} }
} }
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[3] {
yy13 := &x.Status
yy13.CodecEncodeSelf(e)
} else {
r.EncodeNil()
}
} else {
if yyq2[3] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("status"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy14 := &x.Status
yy14.CodecEncodeSelf(e)
}
}
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
@ -184,25 +202,25 @@ func (x *TestType) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
yym12 := z.DecBinary() yym15 := z.DecBinary()
_ = yym12 _ = yym15
if false { if false {
} else if z.HasExtensions() && z.DecExt(x) { } else if z.HasExtensions() && z.DecExt(x) {
} else { } else {
yyct13 := r.ContainerType() yyct16 := r.ContainerType()
if yyct13 == codecSelferValueTypeMap1234 { if yyct16 == codecSelferValueTypeMap1234 {
yyl13 := r.ReadMapStart() yyl16 := r.ReadMapStart()
if yyl13 == 0 { if yyl16 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else { } else {
x.codecDecodeSelfFromMap(yyl13, d) x.codecDecodeSelfFromMap(yyl16, d)
} }
} else if yyct13 == codecSelferValueTypeArray1234 { } else if yyct16 == codecSelferValueTypeArray1234 {
yyl13 := r.ReadArrayStart() yyl16 := r.ReadArrayStart()
if yyl13 == 0 { if yyl16 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
x.codecDecodeSelfFromArray(yyl13, d) x.codecDecodeSelfFromArray(yyl16, d)
} }
} else { } else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
@ -214,12 +232,12 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yys14Slc = z.DecScratchBuffer() // default slice to decode into var yys17Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys14Slc _ = yys17Slc
var yyhl14 bool = l >= 0 var yyhl17 bool = l >= 0
for yyj14 := 0; ; yyj14++ { for yyj17 := 0; ; yyj17++ {
if yyhl14 { if yyhl17 {
if yyj14 >= l { if yyj17 >= l {
break break
} }
} else { } else {
@ -228,10 +246,10 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
} }
z.DecSendContainerState(codecSelfer_containerMapKey1234) z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys14Slc = r.DecodeBytes(yys14Slc, true, true) yys17Slc = r.DecodeBytes(yys17Slc, true, true)
yys14 := string(yys14Slc) yys17 := string(yys17Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234) z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys14 { switch yys17 {
case "kind": case "kind":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Kind = "" x.Kind = ""
@ -248,13 +266,20 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_api.ObjectMeta{} x.ObjectMeta = pkg2_api.ObjectMeta{}
} else { } else {
yyv17 := &x.ObjectMeta yyv20 := &x.ObjectMeta
yyv17.CodecDecodeSelf(d) yyv20.CodecDecodeSelf(d)
}
case "status":
if r.TryDecodeAsNil() {
x.Status = TestTypeStatus{}
} else {
yyv21 := &x.Status
yyv21.CodecDecodeSelf(d)
} }
default: default:
z.DecStructFieldNotFound(-1, yys14) z.DecStructFieldNotFound(-1, yys17)
} // end switch yys14 } // end switch yys17
} // end for yyj14 } // end for yyj17
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} }
@ -262,16 +287,16 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj18 int var yyj22 int
var yyb18 bool var yyb22 bool
var yyhl18 bool = l >= 0 var yyhl22 bool = l >= 0
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -281,13 +306,13 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.Kind = string(r.DecodeString()) x.Kind = string(r.DecodeString())
} }
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -297,13 +322,13 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.APIVersion = string(r.DecodeString()) x.APIVersion = string(r.DecodeString())
} }
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -311,21 +336,38 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_api.ObjectMeta{} x.ObjectMeta = pkg2_api.ObjectMeta{}
} else { } else {
yyv21 := &x.ObjectMeta yyv25 := &x.ObjectMeta
yyv21.CodecDecodeSelf(d) yyv25.CodecDecodeSelf(d)
}
yyj22++
if yyhl22 {
yyb22 = yyj22 > l
} else {
yyb22 = r.CheckBreak()
}
if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Status = TestTypeStatus{}
} else {
yyv26 := &x.Status
yyv26.CodecDecodeSelf(d)
} }
for { for {
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj18-1, "") z.DecStructFieldNotFound(yyj22-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -337,37 +379,37 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
if x == nil { if x == nil {
r.EncodeNil() r.EncodeNil()
} else { } else {
yym22 := z.EncBinary() yym27 := z.EncBinary()
_ = yym22 _ = yym27
if false { if false {
} else if z.HasExtensions() && z.EncExt(x) { } else if z.HasExtensions() && z.EncExt(x) {
} else { } else {
yysep23 := !z.EncBinary() yysep28 := !z.EncBinary()
yy2arr23 := z.EncBasicHandle().StructToArray yy2arr28 := z.EncBasicHandle().StructToArray
var yyq23 [4]bool var yyq28 [4]bool
_, _, _ = yysep23, yyq23, yy2arr23 _, _, _ = yysep28, yyq28, yy2arr28
const yyr23 bool = false const yyr28 bool = false
yyq23[0] = x.Kind != "" yyq28[0] = x.Kind != ""
yyq23[1] = x.APIVersion != "" yyq28[1] = x.APIVersion != ""
yyq23[2] = true yyq28[2] = true
var yynn23 int var yynn28 int
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
r.EncodeArrayStart(4) r.EncodeArrayStart(4)
} else { } else {
yynn23 = 1 yynn28 = 1
for _, b := range yyq23 { for _, b := range yyq28 {
if b { if b {
yynn23++ yynn28++
} }
} }
r.EncodeMapStart(yynn23) r.EncodeMapStart(yynn28)
yynn23 = 0 yynn28 = 0
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq23[0] { if yyq28[0] {
yym25 := z.EncBinary() yym30 := z.EncBinary()
_ = yym25 _ = yym30
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
@ -376,23 +418,23 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, "") r.EncodeString(codecSelferC_UTF81234, "")
} }
} else { } else {
if yyq23[0] { if yyq28[0] {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("kind")) r.EncodeString(codecSelferC_UTF81234, string("kind"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym26 := z.EncBinary() yym31 := z.EncBinary()
_ = yym26 _ = yym31
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq23[1] { if yyq28[1] {
yym28 := z.EncBinary() yym33 := z.EncBinary()
_ = yym28 _ = yym33
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
@ -401,54 +443,54 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, "") r.EncodeString(codecSelferC_UTF81234, "")
} }
} else { } else {
if yyq23[1] { if yyq28[1] {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym29 := z.EncBinary() yym34 := z.EncBinary()
_ = yym29 _ = yym34
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq23[2] { if yyq28[2] {
yy31 := &x.ListMeta yy36 := &x.ListMeta
yym32 := z.EncBinary() yym37 := z.EncBinary()
_ = yym32 _ = yym37
if false { if false {
} else if z.HasExtensions() && z.EncExt(yy31) { } else if z.HasExtensions() && z.EncExt(yy36) {
} else { } else {
z.EncFallback(yy31) z.EncFallback(yy36)
} }
} else { } else {
r.EncodeNil() r.EncodeNil()
} }
} else { } else {
if yyq23[2] { if yyq28[2] {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("metadata")) r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy33 := &x.ListMeta yy38 := &x.ListMeta
yym34 := z.EncBinary() yym39 := z.EncBinary()
_ = yym34 _ = yym39
if false { if false {
} else if z.HasExtensions() && z.EncExt(yy33) { } else if z.HasExtensions() && z.EncExt(yy38) {
} else { } else {
z.EncFallback(yy33) z.EncFallback(yy38)
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if x.Items == nil { if x.Items == nil {
r.EncodeNil() r.EncodeNil()
} else { } else {
yym36 := z.EncBinary() yym41 := z.EncBinary()
_ = yym36 _ = yym41
if false { if false {
} else { } else {
h.encSliceTestType(([]TestType)(x.Items), e) h.encSliceTestType(([]TestType)(x.Items), e)
@ -461,15 +503,15 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
if x.Items == nil { if x.Items == nil {
r.EncodeNil() r.EncodeNil()
} else { } else {
yym37 := z.EncBinary() yym42 := z.EncBinary()
_ = yym37 _ = yym42
if false { if false {
} else { } else {
h.encSliceTestType(([]TestType)(x.Items), e) h.encSliceTestType(([]TestType)(x.Items), e)
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234) z.EncSendContainerState(codecSelfer_containerMapEnd1234)
@ -482,25 +524,25 @@ func (x *TestTypeList) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
yym38 := z.DecBinary() yym43 := z.DecBinary()
_ = yym38 _ = yym43
if false { if false {
} else if z.HasExtensions() && z.DecExt(x) { } else if z.HasExtensions() && z.DecExt(x) {
} else { } else {
yyct39 := r.ContainerType() yyct44 := r.ContainerType()
if yyct39 == codecSelferValueTypeMap1234 { if yyct44 == codecSelferValueTypeMap1234 {
yyl39 := r.ReadMapStart() yyl44 := r.ReadMapStart()
if yyl39 == 0 { if yyl44 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else { } else {
x.codecDecodeSelfFromMap(yyl39, d) x.codecDecodeSelfFromMap(yyl44, d)
} }
} else if yyct39 == codecSelferValueTypeArray1234 { } else if yyct44 == codecSelferValueTypeArray1234 {
yyl39 := r.ReadArrayStart() yyl44 := r.ReadArrayStart()
if yyl39 == 0 { if yyl44 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
x.codecDecodeSelfFromArray(yyl39, d) x.codecDecodeSelfFromArray(yyl44, d)
} }
} else { } else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
@ -512,12 +554,12 @@ func (x *TestTypeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yys40Slc = z.DecScratchBuffer() // default slice to decode into var yys45Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys40Slc _ = yys45Slc
var yyhl40 bool = l >= 0 var yyhl45 bool = l >= 0
for yyj40 := 0; ; yyj40++ { for yyj45 := 0; ; yyj45++ {
if yyhl40 { if yyhl45 {
if yyj40 >= l { if yyj45 >= l {
break break
} }
} else { } else {
@ -526,10 +568,10 @@ func (x *TestTypeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
} }
z.DecSendContainerState(codecSelfer_containerMapKey1234) z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys40Slc = r.DecodeBytes(yys40Slc, true, true) yys45Slc = r.DecodeBytes(yys45Slc, true, true)
yys40 := string(yys40Slc) yys45 := string(yys45Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234) z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys40 { switch yys45 {
case "kind": case "kind":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Kind = "" x.Kind = ""
@ -546,31 +588,31 @@ func (x *TestTypeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ListMeta = pkg1_unversioned.ListMeta{} x.ListMeta = pkg1_unversioned.ListMeta{}
} else { } else {
yyv43 := &x.ListMeta yyv48 := &x.ListMeta
yym44 := z.DecBinary() yym49 := z.DecBinary()
_ = yym44 _ = yym49
if false { if false {
} else if z.HasExtensions() && z.DecExt(yyv43) { } else if z.HasExtensions() && z.DecExt(yyv48) {
} else { } else {
z.DecFallback(yyv43, false) z.DecFallback(yyv48, false)
} }
} }
case "items": case "items":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Items = nil x.Items = nil
} else { } else {
yyv45 := &x.Items yyv50 := &x.Items
yym46 := z.DecBinary() yym51 := z.DecBinary()
_ = yym46 _ = yym51
if false { if false {
} else { } else {
h.decSliceTestType((*[]TestType)(yyv45), d) h.decSliceTestType((*[]TestType)(yyv50), d)
} }
} }
default: default:
z.DecStructFieldNotFound(-1, yys40) z.DecStructFieldNotFound(-1, yys45)
} // end switch yys40 } // end switch yys45
} // end for yyj40 } // end for yyj45
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} }
@ -578,16 +620,16 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj47 int var yyj52 int
var yyb47 bool var yyb52 bool
var yyhl47 bool = l >= 0 var yyhl52 bool = l >= 0
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -597,13 +639,13 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.Kind = string(r.DecodeString()) x.Kind = string(r.DecodeString())
} }
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -613,13 +655,13 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.APIVersion = string(r.DecodeString()) x.APIVersion = string(r.DecodeString())
} }
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -627,22 +669,22 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ListMeta = pkg1_unversioned.ListMeta{} x.ListMeta = pkg1_unversioned.ListMeta{}
} else { } else {
yyv50 := &x.ListMeta yyv55 := &x.ListMeta
yym51 := z.DecBinary() yym56 := z.DecBinary()
_ = yym51 _ = yym56
if false { if false {
} else if z.HasExtensions() && z.DecExt(yyv50) { } else if z.HasExtensions() && z.DecExt(yyv55) {
} else { } else {
z.DecFallback(yyv50, false) z.DecFallback(yyv55, false)
} }
} }
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -650,26 +692,188 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Items = nil x.Items = nil
} else { } else {
yyv52 := &x.Items yyv57 := &x.Items
yym53 := z.DecBinary() yym58 := z.DecBinary()
_ = yym53 _ = yym58
if false { if false {
} else { } else {
h.decSliceTestType((*[]TestType)(yyv52), d) h.decSliceTestType((*[]TestType)(yyv57), d)
} }
} }
for { for {
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj47-1, "") z.DecStructFieldNotFound(yyj52-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x *TestTypeStatus) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
if x == nil {
r.EncodeNil()
} else {
yym59 := z.EncBinary()
_ = yym59
if false {
} else if z.HasExtensions() && z.EncExt(x) {
} else {
yysep60 := !z.EncBinary()
yy2arr60 := z.EncBasicHandle().StructToArray
var yyq60 [1]bool
_, _, _ = yysep60, yyq60, yy2arr60
const yyr60 bool = false
var yynn60 int
if yyr60 || yy2arr60 {
r.EncodeArrayStart(1)
} else {
yynn60 = 1
for _, b := range yyq60 {
if b {
yynn60++
}
}
r.EncodeMapStart(yynn60)
yynn60 = 0
}
if yyr60 || yy2arr60 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yym62 := z.EncBinary()
_ = yym62
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Blah))
}
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("Blah"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym63 := z.EncBinary()
_ = yym63
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Blah))
}
}
if yyr60 || yy2arr60 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
}
}
}
}
func (x *TestTypeStatus) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yym64 := z.DecBinary()
_ = yym64
if false {
} else if z.HasExtensions() && z.DecExt(x) {
} else {
yyct65 := r.ContainerType()
if yyct65 == codecSelferValueTypeMap1234 {
yyl65 := r.ReadMapStart()
if yyl65 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else {
x.codecDecodeSelfFromMap(yyl65, d)
}
} else if yyct65 == codecSelferValueTypeArray1234 {
yyl65 := r.ReadArrayStart()
if yyl65 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
x.codecDecodeSelfFromArray(yyl65, d)
}
} else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
}
}
}
func (x *TestTypeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yys66Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys66Slc
var yyhl66 bool = l >= 0
for yyj66 := 0; ; yyj66++ {
if yyhl66 {
if yyj66 >= l {
break
}
} else {
if r.CheckBreak() {
break
}
}
z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys66Slc = r.DecodeBytes(yys66Slc, true, true)
yys66 := string(yys66Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys66 {
case "Blah":
if r.TryDecodeAsNil() {
x.Blah = ""
} else {
x.Blah = string(r.DecodeString())
}
default:
z.DecStructFieldNotFound(-1, yys66)
} // end switch yys66
} // end for yyj66
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
}
func (x *TestTypeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj68 int
var yyb68 bool
var yyhl68 bool = l >= 0
yyj68++
if yyhl68 {
yyb68 = yyj68 > l
} else {
yyb68 = r.CheckBreak()
}
if yyb68 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Blah = ""
} else {
x.Blah = string(r.DecodeString())
}
for {
yyj68++
if yyhl68 {
yyb68 = yyj68 > l
} else {
yyb68 = r.CheckBreak()
}
if yyb68 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj68-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -679,10 +883,10 @@ func (x codecSelfer1234) encSliceTestType(v []TestType, e *codec1978.Encoder) {
z, r := codec1978.GenHelperEncoder(e) z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r _, _, _ = h, z, r
r.EncodeArrayStart(len(v)) r.EncodeArrayStart(len(v))
for _, yyv54 := range v { for _, yyv70 := range v {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yy55 := &yyv54 yy71 := &yyv70
yy55.CodecEncodeSelf(e) yy71.CodecEncodeSelf(e)
} }
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -692,83 +896,83 @@ func (x codecSelfer1234) decSliceTestType(v *[]TestType, d *codec1978.Decoder) {
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
yyv56 := *v yyv72 := *v
yyh56, yyl56 := z.DecSliceHelperStart() yyh72, yyl72 := z.DecSliceHelperStart()
var yyc56 bool var yyc72 bool
if yyl56 == 0 { if yyl72 == 0 {
if yyv56 == nil { if yyv72 == nil {
yyv56 = []TestType{} yyv72 = []TestType{}
yyc56 = true yyc72 = true
} else if len(yyv56) != 0 { } else if len(yyv72) != 0 {
yyv56 = yyv56[:0] yyv72 = yyv72[:0]
yyc56 = true yyc72 = true
} }
} else if yyl56 > 0 { } else if yyl72 > 0 {
var yyrr56, yyrl56 int var yyrr72, yyrl72 int
var yyrt56 bool var yyrt72 bool
if yyl56 > cap(yyv56) { if yyl72 > cap(yyv72) {
yyrg56 := len(yyv56) > 0 yyrg72 := len(yyv72) > 0
yyv256 := yyv56 yyv272 := yyv72
yyrl56, yyrt56 = z.DecInferLen(yyl56, z.DecBasicHandle().MaxInitLen, 192) yyrl72, yyrt72 = z.DecInferLen(yyl72, z.DecBasicHandle().MaxInitLen, 208)
if yyrt56 { if yyrt72 {
if yyrl56 <= cap(yyv56) { if yyrl72 <= cap(yyv72) {
yyv56 = yyv56[:yyrl56] yyv72 = yyv72[:yyrl72]
} else { } else {
yyv56 = make([]TestType, yyrl56) yyv72 = make([]TestType, yyrl72)
} }
} else { } else {
yyv56 = make([]TestType, yyrl56) yyv72 = make([]TestType, yyrl72)
} }
yyc56 = true yyc72 = true
yyrr56 = len(yyv56) yyrr72 = len(yyv72)
if yyrg56 { if yyrg72 {
copy(yyv56, yyv256) copy(yyv72, yyv272)
} }
} else if yyl56 != len(yyv56) { } else if yyl72 != len(yyv72) {
yyv56 = yyv56[:yyl56] yyv72 = yyv72[:yyl72]
yyc56 = true yyc72 = true
} }
yyj56 := 0 yyj72 := 0
for ; yyj56 < yyrr56; yyj56++ { for ; yyj72 < yyrr72; yyj72++ {
yyh56.ElemContainerState(yyj56) yyh72.ElemContainerState(yyj72)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
yyv56[yyj56] = TestType{} yyv72[yyj72] = TestType{}
} else { } else {
yyv57 := &yyv56[yyj56] yyv73 := &yyv72[yyj72]
yyv57.CodecDecodeSelf(d) yyv73.CodecDecodeSelf(d)
} }
} }
if yyrt56 { if yyrt72 {
for ; yyj56 < yyl56; yyj56++ { for ; yyj72 < yyl72; yyj72++ {
yyv56 = append(yyv56, TestType{}) yyv72 = append(yyv72, TestType{})
yyh56.ElemContainerState(yyj56) yyh72.ElemContainerState(yyj72)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
yyv56[yyj56] = TestType{} yyv72[yyj72] = TestType{}
} else { } else {
yyv58 := &yyv56[yyj56] yyv74 := &yyv72[yyj72]
yyv58.CodecDecodeSelf(d) yyv74.CodecDecodeSelf(d)
} }
} }
} }
} else { } else {
yyj56 := 0 yyj72 := 0
for ; !r.CheckBreak(); yyj56++ { for ; !r.CheckBreak(); yyj72++ {
if yyj56 >= len(yyv56) { if yyj72 >= len(yyv72) {
yyv56 = append(yyv56, TestType{}) // var yyz56 TestType yyv72 = append(yyv72, TestType{}) // var yyz72 TestType
yyc56 = true yyc72 = true
} }
yyh56.ElemContainerState(yyj56) yyh72.ElemContainerState(yyj72)
if yyj56 < len(yyv56) { if yyj72 < len(yyv72) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
yyv56[yyj56] = TestType{} yyv72[yyj72] = TestType{}
} else { } else {
yyv59 := &yyv56[yyj56] yyv75 := &yyv72[yyj72]
yyv59.CodecDecodeSelf(d) yyv75.CodecDecodeSelf(d)
} }
} else { } else {
@ -776,16 +980,16 @@ func (x codecSelfer1234) decSliceTestType(v *[]TestType, d *codec1978.Decoder) {
} }
} }
if yyj56 < len(yyv56) { if yyj72 < len(yyv72) {
yyv56 = yyv56[:yyj56] yyv72 = yyv72[:yyj72]
yyc56 = true yyc72 = true
} else if yyj56 == 0 && yyv56 == nil { } else if yyj72 == 0 && yyv72 == nil {
yyv56 = []TestType{} yyv72 = []TestType{}
yyc56 = true yyc72 = true
} }
} }
yyh56.End() yyh72.End()
if yyc56 { if yyc72 {
*v = yyv56 *v = yyv72
} }
} }

View File

@ -26,6 +26,7 @@ import (
type TestType struct { type TestType struct {
unversioned.TypeMeta `json:",inline"` unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta `json:"metadata,omitempty"`
Status TestTypeStatus `json:"status,omitempty"`
} }
type TestTypeList struct { type TestTypeList struct {
@ -34,3 +35,7 @@ type TestTypeList struct {
Items []TestType `json:"items"` Items []TestType `json:"items"`
} }
type TestTypeStatus struct {
Blah string
}

View File

@ -85,15 +85,16 @@ func (x *TestType) CodecEncodeSelf(e *codec1978.Encoder) {
} else { } else {
yysep2 := !z.EncBinary() yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [3]bool var yyq2 [4]bool
_, _, _ = yysep2, yyq2, yy2arr2 _, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false const yyr2 bool = false
yyq2[0] = x.Kind != "" yyq2[0] = x.Kind != ""
yyq2[1] = x.APIVersion != "" yyq2[1] = x.APIVersion != ""
yyq2[2] = true yyq2[2] = true
yyq2[3] = true
var yynn2 int var yynn2 int
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
r.EncodeArrayStart(3) r.EncodeArrayStart(4)
} else { } else {
yynn2 = 0 yynn2 = 0
for _, b := range yyq2 { for _, b := range yyq2 {
@ -171,6 +172,23 @@ func (x *TestType) CodecEncodeSelf(e *codec1978.Encoder) {
yy11.CodecEncodeSelf(e) yy11.CodecEncodeSelf(e)
} }
} }
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[3] {
yy13 := &x.Status
yy13.CodecEncodeSelf(e)
} else {
r.EncodeNil()
}
} else {
if yyq2[3] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("status"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy14 := &x.Status
yy14.CodecEncodeSelf(e)
}
}
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
@ -184,25 +202,25 @@ func (x *TestType) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
yym12 := z.DecBinary() yym15 := z.DecBinary()
_ = yym12 _ = yym15
if false { if false {
} else if z.HasExtensions() && z.DecExt(x) { } else if z.HasExtensions() && z.DecExt(x) {
} else { } else {
yyct13 := r.ContainerType() yyct16 := r.ContainerType()
if yyct13 == codecSelferValueTypeMap1234 { if yyct16 == codecSelferValueTypeMap1234 {
yyl13 := r.ReadMapStart() yyl16 := r.ReadMapStart()
if yyl13 == 0 { if yyl16 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else { } else {
x.codecDecodeSelfFromMap(yyl13, d) x.codecDecodeSelfFromMap(yyl16, d)
} }
} else if yyct13 == codecSelferValueTypeArray1234 { } else if yyct16 == codecSelferValueTypeArray1234 {
yyl13 := r.ReadArrayStart() yyl16 := r.ReadArrayStart()
if yyl13 == 0 { if yyl16 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
x.codecDecodeSelfFromArray(yyl13, d) x.codecDecodeSelfFromArray(yyl16, d)
} }
} else { } else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
@ -214,12 +232,12 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yys14Slc = z.DecScratchBuffer() // default slice to decode into var yys17Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys14Slc _ = yys17Slc
var yyhl14 bool = l >= 0 var yyhl17 bool = l >= 0
for yyj14 := 0; ; yyj14++ { for yyj17 := 0; ; yyj17++ {
if yyhl14 { if yyhl17 {
if yyj14 >= l { if yyj17 >= l {
break break
} }
} else { } else {
@ -228,10 +246,10 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
} }
z.DecSendContainerState(codecSelfer_containerMapKey1234) z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys14Slc = r.DecodeBytes(yys14Slc, true, true) yys17Slc = r.DecodeBytes(yys17Slc, true, true)
yys14 := string(yys14Slc) yys17 := string(yys17Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234) z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys14 { switch yys17 {
case "kind": case "kind":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Kind = "" x.Kind = ""
@ -248,13 +266,20 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_api.ObjectMeta{} x.ObjectMeta = pkg2_api.ObjectMeta{}
} else { } else {
yyv17 := &x.ObjectMeta yyv20 := &x.ObjectMeta
yyv17.CodecDecodeSelf(d) yyv20.CodecDecodeSelf(d)
}
case "status":
if r.TryDecodeAsNil() {
x.Status = TestTypeStatus{}
} else {
yyv21 := &x.Status
yyv21.CodecDecodeSelf(d)
} }
default: default:
z.DecStructFieldNotFound(-1, yys14) z.DecStructFieldNotFound(-1, yys17)
} // end switch yys14 } // end switch yys17
} // end for yyj14 } // end for yyj17
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} }
@ -262,16 +287,16 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj18 int var yyj22 int
var yyb18 bool var yyb22 bool
var yyhl18 bool = l >= 0 var yyhl22 bool = l >= 0
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -281,13 +306,13 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.Kind = string(r.DecodeString()) x.Kind = string(r.DecodeString())
} }
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -297,13 +322,13 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.APIVersion = string(r.DecodeString()) x.APIVersion = string(r.DecodeString())
} }
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -311,21 +336,38 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_api.ObjectMeta{} x.ObjectMeta = pkg2_api.ObjectMeta{}
} else { } else {
yyv21 := &x.ObjectMeta yyv25 := &x.ObjectMeta
yyv21.CodecDecodeSelf(d) yyv25.CodecDecodeSelf(d)
}
yyj22++
if yyhl22 {
yyb22 = yyj22 > l
} else {
yyb22 = r.CheckBreak()
}
if yyb22 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Status = TestTypeStatus{}
} else {
yyv26 := &x.Status
yyv26.CodecDecodeSelf(d)
} }
for { for {
yyj18++ yyj22++
if yyhl18 { if yyhl22 {
yyb18 = yyj18 > l yyb22 = yyj22 > l
} else { } else {
yyb18 = r.CheckBreak() yyb22 = r.CheckBreak()
} }
if yyb18 { if yyb22 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj18-1, "") z.DecStructFieldNotFound(yyj22-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -337,37 +379,37 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
if x == nil { if x == nil {
r.EncodeNil() r.EncodeNil()
} else { } else {
yym22 := z.EncBinary() yym27 := z.EncBinary()
_ = yym22 _ = yym27
if false { if false {
} else if z.HasExtensions() && z.EncExt(x) { } else if z.HasExtensions() && z.EncExt(x) {
} else { } else {
yysep23 := !z.EncBinary() yysep28 := !z.EncBinary()
yy2arr23 := z.EncBasicHandle().StructToArray yy2arr28 := z.EncBasicHandle().StructToArray
var yyq23 [4]bool var yyq28 [4]bool
_, _, _ = yysep23, yyq23, yy2arr23 _, _, _ = yysep28, yyq28, yy2arr28
const yyr23 bool = false const yyr28 bool = false
yyq23[0] = x.Kind != "" yyq28[0] = x.Kind != ""
yyq23[1] = x.APIVersion != "" yyq28[1] = x.APIVersion != ""
yyq23[2] = true yyq28[2] = true
var yynn23 int var yynn28 int
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
r.EncodeArrayStart(4) r.EncodeArrayStart(4)
} else { } else {
yynn23 = 1 yynn28 = 1
for _, b := range yyq23 { for _, b := range yyq28 {
if b { if b {
yynn23++ yynn28++
} }
} }
r.EncodeMapStart(yynn23) r.EncodeMapStart(yynn28)
yynn23 = 0 yynn28 = 0
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq23[0] { if yyq28[0] {
yym25 := z.EncBinary() yym30 := z.EncBinary()
_ = yym25 _ = yym30
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
@ -376,23 +418,23 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, "") r.EncodeString(codecSelferC_UTF81234, "")
} }
} else { } else {
if yyq23[0] { if yyq28[0] {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("kind")) r.EncodeString(codecSelferC_UTF81234, string("kind"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym26 := z.EncBinary() yym31 := z.EncBinary()
_ = yym26 _ = yym31
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq23[1] { if yyq28[1] {
yym28 := z.EncBinary() yym33 := z.EncBinary()
_ = yym28 _ = yym33
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
@ -401,54 +443,54 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, "") r.EncodeString(codecSelferC_UTF81234, "")
} }
} else { } else {
if yyq23[1] { if yyq28[1] {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym29 := z.EncBinary() yym34 := z.EncBinary()
_ = yym29 _ = yym34
if false { if false {
} else { } else {
r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq23[2] { if yyq28[2] {
yy31 := &x.ListMeta yy36 := &x.ListMeta
yym32 := z.EncBinary() yym37 := z.EncBinary()
_ = yym32 _ = yym37
if false { if false {
} else if z.HasExtensions() && z.EncExt(yy31) { } else if z.HasExtensions() && z.EncExt(yy36) {
} else { } else {
z.EncFallback(yy31) z.EncFallback(yy36)
} }
} else { } else {
r.EncodeNil() r.EncodeNil()
} }
} else { } else {
if yyq23[2] { if yyq28[2] {
z.EncSendContainerState(codecSelfer_containerMapKey1234) z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("metadata")) r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234) z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy33 := &x.ListMeta yy38 := &x.ListMeta
yym34 := z.EncBinary() yym39 := z.EncBinary()
_ = yym34 _ = yym39
if false { if false {
} else if z.HasExtensions() && z.EncExt(yy33) { } else if z.HasExtensions() && z.EncExt(yy38) {
} else { } else {
z.EncFallback(yy33) z.EncFallback(yy38)
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if x.Items == nil { if x.Items == nil {
r.EncodeNil() r.EncodeNil()
} else { } else {
yym36 := z.EncBinary() yym41 := z.EncBinary()
_ = yym36 _ = yym41
if false { if false {
} else { } else {
h.encSliceTestType(([]TestType)(x.Items), e) h.encSliceTestType(([]TestType)(x.Items), e)
@ -461,15 +503,15 @@ func (x *TestTypeList) CodecEncodeSelf(e *codec1978.Encoder) {
if x.Items == nil { if x.Items == nil {
r.EncodeNil() r.EncodeNil()
} else { } else {
yym37 := z.EncBinary() yym42 := z.EncBinary()
_ = yym37 _ = yym42
if false { if false {
} else { } else {
h.encSliceTestType(([]TestType)(x.Items), e) h.encSliceTestType(([]TestType)(x.Items), e)
} }
} }
} }
if yyr23 || yy2arr23 { if yyr28 || yy2arr28 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234) z.EncSendContainerState(codecSelfer_containerMapEnd1234)
@ -482,25 +524,25 @@ func (x *TestTypeList) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
yym38 := z.DecBinary() yym43 := z.DecBinary()
_ = yym38 _ = yym43
if false { if false {
} else if z.HasExtensions() && z.DecExt(x) { } else if z.HasExtensions() && z.DecExt(x) {
} else { } else {
yyct39 := r.ContainerType() yyct44 := r.ContainerType()
if yyct39 == codecSelferValueTypeMap1234 { if yyct44 == codecSelferValueTypeMap1234 {
yyl39 := r.ReadMapStart() yyl44 := r.ReadMapStart()
if yyl39 == 0 { if yyl44 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else { } else {
x.codecDecodeSelfFromMap(yyl39, d) x.codecDecodeSelfFromMap(yyl44, d)
} }
} else if yyct39 == codecSelferValueTypeArray1234 { } else if yyct44 == codecSelferValueTypeArray1234 {
yyl39 := r.ReadArrayStart() yyl44 := r.ReadArrayStart()
if yyl39 == 0 { if yyl44 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
x.codecDecodeSelfFromArray(yyl39, d) x.codecDecodeSelfFromArray(yyl44, d)
} }
} else { } else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
@ -512,12 +554,12 @@ func (x *TestTypeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yys40Slc = z.DecScratchBuffer() // default slice to decode into var yys45Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys40Slc _ = yys45Slc
var yyhl40 bool = l >= 0 var yyhl45 bool = l >= 0
for yyj40 := 0; ; yyj40++ { for yyj45 := 0; ; yyj45++ {
if yyhl40 { if yyhl45 {
if yyj40 >= l { if yyj45 >= l {
break break
} }
} else { } else {
@ -526,10 +568,10 @@ func (x *TestTypeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
} }
z.DecSendContainerState(codecSelfer_containerMapKey1234) z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys40Slc = r.DecodeBytes(yys40Slc, true, true) yys45Slc = r.DecodeBytes(yys45Slc, true, true)
yys40 := string(yys40Slc) yys45 := string(yys45Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234) z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys40 { switch yys45 {
case "kind": case "kind":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Kind = "" x.Kind = ""
@ -546,31 +588,31 @@ func (x *TestTypeList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ListMeta = pkg1_unversioned.ListMeta{} x.ListMeta = pkg1_unversioned.ListMeta{}
} else { } else {
yyv43 := &x.ListMeta yyv48 := &x.ListMeta
yym44 := z.DecBinary() yym49 := z.DecBinary()
_ = yym44 _ = yym49
if false { if false {
} else if z.HasExtensions() && z.DecExt(yyv43) { } else if z.HasExtensions() && z.DecExt(yyv48) {
} else { } else {
z.DecFallback(yyv43, false) z.DecFallback(yyv48, false)
} }
} }
case "items": case "items":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Items = nil x.Items = nil
} else { } else {
yyv45 := &x.Items yyv50 := &x.Items
yym46 := z.DecBinary() yym51 := z.DecBinary()
_ = yym46 _ = yym51
if false { if false {
} else { } else {
h.decSliceTestType((*[]TestType)(yyv45), d) h.decSliceTestType((*[]TestType)(yyv50), d)
} }
} }
default: default:
z.DecStructFieldNotFound(-1, yys40) z.DecStructFieldNotFound(-1, yys45)
} // end switch yys40 } // end switch yys45
} // end for yyj40 } // end for yyj45
z.DecSendContainerState(codecSelfer_containerMapEnd1234) z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} }
@ -578,16 +620,16 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj47 int var yyj52 int
var yyb47 bool var yyb52 bool
var yyhl47 bool = l >= 0 var yyhl52 bool = l >= 0
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -597,13 +639,13 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.Kind = string(r.DecodeString()) x.Kind = string(r.DecodeString())
} }
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -613,13 +655,13 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else { } else {
x.APIVersion = string(r.DecodeString()) x.APIVersion = string(r.DecodeString())
} }
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -627,22 +669,22 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ListMeta = pkg1_unversioned.ListMeta{} x.ListMeta = pkg1_unversioned.ListMeta{}
} else { } else {
yyv50 := &x.ListMeta yyv55 := &x.ListMeta
yym51 := z.DecBinary() yym56 := z.DecBinary()
_ = yym51 _ = yym56
if false { if false {
} else if z.HasExtensions() && z.DecExt(yyv50) { } else if z.HasExtensions() && z.DecExt(yyv55) {
} else { } else {
z.DecFallback(yyv50, false) z.DecFallback(yyv55, false)
} }
} }
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -650,26 +692,188 @@ func (x *TestTypeList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Items = nil x.Items = nil
} else { } else {
yyv52 := &x.Items yyv57 := &x.Items
yym53 := z.DecBinary() yym58 := z.DecBinary()
_ = yym53 _ = yym58
if false { if false {
} else { } else {
h.decSliceTestType((*[]TestType)(yyv52), d) h.decSliceTestType((*[]TestType)(yyv57), d)
} }
} }
for { for {
yyj47++ yyj52++
if yyhl47 { if yyhl52 {
yyb47 = yyj47 > l yyb52 = yyj52 > l
} else { } else {
yyb47 = r.CheckBreak() yyb52 = r.CheckBreak()
} }
if yyb47 { if yyb52 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj47-1, "") z.DecStructFieldNotFound(yyj52-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x *TestTypeStatus) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
if x == nil {
r.EncodeNil()
} else {
yym59 := z.EncBinary()
_ = yym59
if false {
} else if z.HasExtensions() && z.EncExt(x) {
} else {
yysep60 := !z.EncBinary()
yy2arr60 := z.EncBasicHandle().StructToArray
var yyq60 [1]bool
_, _, _ = yysep60, yyq60, yy2arr60
const yyr60 bool = false
var yynn60 int
if yyr60 || yy2arr60 {
r.EncodeArrayStart(1)
} else {
yynn60 = 1
for _, b := range yyq60 {
if b {
yynn60++
}
}
r.EncodeMapStart(yynn60)
yynn60 = 0
}
if yyr60 || yy2arr60 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yym62 := z.EncBinary()
_ = yym62
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Blah))
}
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("Blah"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym63 := z.EncBinary()
_ = yym63
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Blah))
}
}
if yyr60 || yy2arr60 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
}
}
}
}
func (x *TestTypeStatus) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yym64 := z.DecBinary()
_ = yym64
if false {
} else if z.HasExtensions() && z.DecExt(x) {
} else {
yyct65 := r.ContainerType()
if yyct65 == codecSelferValueTypeMap1234 {
yyl65 := r.ReadMapStart()
if yyl65 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else {
x.codecDecodeSelfFromMap(yyl65, d)
}
} else if yyct65 == codecSelferValueTypeArray1234 {
yyl65 := r.ReadArrayStart()
if yyl65 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
x.codecDecodeSelfFromArray(yyl65, d)
}
} else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
}
}
}
func (x *TestTypeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yys66Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys66Slc
var yyhl66 bool = l >= 0
for yyj66 := 0; ; yyj66++ {
if yyhl66 {
if yyj66 >= l {
break
}
} else {
if r.CheckBreak() {
break
}
}
z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys66Slc = r.DecodeBytes(yys66Slc, true, true)
yys66 := string(yys66Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys66 {
case "Blah":
if r.TryDecodeAsNil() {
x.Blah = ""
} else {
x.Blah = string(r.DecodeString())
}
default:
z.DecStructFieldNotFound(-1, yys66)
} // end switch yys66
} // end for yyj66
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
}
func (x *TestTypeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj68 int
var yyb68 bool
var yyhl68 bool = l >= 0
yyj68++
if yyhl68 {
yyb68 = yyj68 > l
} else {
yyb68 = r.CheckBreak()
}
if yyb68 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Blah = ""
} else {
x.Blah = string(r.DecodeString())
}
for {
yyj68++
if yyhl68 {
yyb68 = yyj68 > l
} else {
yyb68 = r.CheckBreak()
}
if yyb68 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj68-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -679,10 +883,10 @@ func (x codecSelfer1234) encSliceTestType(v []TestType, e *codec1978.Encoder) {
z, r := codec1978.GenHelperEncoder(e) z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r _, _, _ = h, z, r
r.EncodeArrayStart(len(v)) r.EncodeArrayStart(len(v))
for _, yyv54 := range v { for _, yyv70 := range v {
z.EncSendContainerState(codecSelfer_containerArrayElem1234) z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yy55 := &yyv54 yy71 := &yyv70
yy55.CodecEncodeSelf(e) yy71.CodecEncodeSelf(e)
} }
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -692,83 +896,83 @@ func (x codecSelfer1234) decSliceTestType(v *[]TestType, d *codec1978.Decoder) {
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
yyv56 := *v yyv72 := *v
yyh56, yyl56 := z.DecSliceHelperStart() yyh72, yyl72 := z.DecSliceHelperStart()
var yyc56 bool var yyc72 bool
if yyl56 == 0 { if yyl72 == 0 {
if yyv56 == nil { if yyv72 == nil {
yyv56 = []TestType{} yyv72 = []TestType{}
yyc56 = true yyc72 = true
} else if len(yyv56) != 0 { } else if len(yyv72) != 0 {
yyv56 = yyv56[:0] yyv72 = yyv72[:0]
yyc56 = true yyc72 = true
} }
} else if yyl56 > 0 { } else if yyl72 > 0 {
var yyrr56, yyrl56 int var yyrr72, yyrl72 int
var yyrt56 bool var yyrt72 bool
if yyl56 > cap(yyv56) { if yyl72 > cap(yyv72) {
yyrg56 := len(yyv56) > 0 yyrg72 := len(yyv72) > 0
yyv256 := yyv56 yyv272 := yyv72
yyrl56, yyrt56 = z.DecInferLen(yyl56, z.DecBasicHandle().MaxInitLen, 192) yyrl72, yyrt72 = z.DecInferLen(yyl72, z.DecBasicHandle().MaxInitLen, 208)
if yyrt56 { if yyrt72 {
if yyrl56 <= cap(yyv56) { if yyrl72 <= cap(yyv72) {
yyv56 = yyv56[:yyrl56] yyv72 = yyv72[:yyrl72]
} else { } else {
yyv56 = make([]TestType, yyrl56) yyv72 = make([]TestType, yyrl72)
} }
} else { } else {
yyv56 = make([]TestType, yyrl56) yyv72 = make([]TestType, yyrl72)
} }
yyc56 = true yyc72 = true
yyrr56 = len(yyv56) yyrr72 = len(yyv72)
if yyrg56 { if yyrg72 {
copy(yyv56, yyv256) copy(yyv72, yyv272)
} }
} else if yyl56 != len(yyv56) { } else if yyl72 != len(yyv72) {
yyv56 = yyv56[:yyl56] yyv72 = yyv72[:yyl72]
yyc56 = true yyc72 = true
} }
yyj56 := 0 yyj72 := 0
for ; yyj56 < yyrr56; yyj56++ { for ; yyj72 < yyrr72; yyj72++ {
yyh56.ElemContainerState(yyj56) yyh72.ElemContainerState(yyj72)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
yyv56[yyj56] = TestType{} yyv72[yyj72] = TestType{}
} else { } else {
yyv57 := &yyv56[yyj56] yyv73 := &yyv72[yyj72]
yyv57.CodecDecodeSelf(d) yyv73.CodecDecodeSelf(d)
} }
} }
if yyrt56 { if yyrt72 {
for ; yyj56 < yyl56; yyj56++ { for ; yyj72 < yyl72; yyj72++ {
yyv56 = append(yyv56, TestType{}) yyv72 = append(yyv72, TestType{})
yyh56.ElemContainerState(yyj56) yyh72.ElemContainerState(yyj72)
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
yyv56[yyj56] = TestType{} yyv72[yyj72] = TestType{}
} else { } else {
yyv58 := &yyv56[yyj56] yyv74 := &yyv72[yyj72]
yyv58.CodecDecodeSelf(d) yyv74.CodecDecodeSelf(d)
} }
} }
} }
} else { } else {
yyj56 := 0 yyj72 := 0
for ; !r.CheckBreak(); yyj56++ { for ; !r.CheckBreak(); yyj72++ {
if yyj56 >= len(yyv56) { if yyj72 >= len(yyv72) {
yyv56 = append(yyv56, TestType{}) // var yyz56 TestType yyv72 = append(yyv72, TestType{}) // var yyz72 TestType
yyc56 = true yyc72 = true
} }
yyh56.ElemContainerState(yyj56) yyh72.ElemContainerState(yyj72)
if yyj56 < len(yyv56) { if yyj72 < len(yyv72) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
yyv56[yyj56] = TestType{} yyv72[yyj72] = TestType{}
} else { } else {
yyv59 := &yyv56[yyj56] yyv75 := &yyv72[yyj72]
yyv59.CodecDecodeSelf(d) yyv75.CodecDecodeSelf(d)
} }
} else { } else {
@ -776,16 +980,16 @@ func (x codecSelfer1234) decSliceTestType(v *[]TestType, d *codec1978.Decoder) {
} }
} }
if yyj56 < len(yyv56) { if yyj72 < len(yyv72) {
yyv56 = yyv56[:yyj56] yyv72 = yyv72[:yyj72]
yyc56 = true yyc72 = true
} else if yyj56 == 0 && yyv56 == nil { } else if yyj72 == 0 && yyv72 == nil {
yyv56 = []TestType{} yyv72 = []TestType{}
yyc56 = true yyc72 = true
} }
} }
yyh56.End() yyh72.End()
if yyc56 { if yyc72 {
*v = yyv56 *v = yyv72
} }
} }

View File

@ -26,6 +26,7 @@ import (
type TestType struct { type TestType struct {
unversioned.TypeMeta `json:",inline"` unversioned.TypeMeta `json:",inline"`
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta `json:"metadata,omitempty"`
Status TestTypeStatus `json:"status,omitempty"`
} }
type TestTypeList struct { type TestTypeList struct {
@ -34,3 +35,7 @@ type TestTypeList struct {
Items []TestType `json:"items"` Items []TestType `json:"items"`
} }
type TestTypeStatus struct {
Blah string
}

View File

@ -97,6 +97,29 @@ func TestUpdateTestType(t *testing.T) {
c.simpleClient.Validate(t, receivedTestType, err) c.simpleClient.Validate(t, receivedTestType, err)
} }
func TestUpdateStatusTestType(t *testing.T) {
ns := api.NamespaceDefault
requestTestType := &testgroup.TestType{
ObjectMeta: api.ObjectMeta{
Name: "foo",
ResourceVersion: "1",
Labels: map[string]string{
"foo": "bar",
"name": "baz",
},
},
Status: testgroup.TestTypeStatus{"I'm in good status"},
}
c := DecoratedSimpleClient{
simpleClient: simple.Client{
Request: simple.Request{Method: "PUT", Path: testHelper.ResourcePath("testtypes", ns, "foo"), Query: simple.BuildQueryValues(nil)},
Response: simple.Response{StatusCode: http.StatusOK, Body: requestTestType},
},
}
receivedTestType, err := c.Setup(t).TestTypes(ns).Update(requestTestType)
c.simpleClient.Validate(t, receivedTestType, err)
}
func TestDeleteTestType(t *testing.T) { func TestDeleteTestType(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
c := DecoratedSimpleClient{ c := DecoratedSimpleClient{

View File

@ -31,6 +31,7 @@ type TestTypeNamespacer interface {
type TestTypeInterface interface { type TestTypeInterface interface {
Create(*testgroup.TestType) (*testgroup.TestType, error) Create(*testgroup.TestType) (*testgroup.TestType, error)
Update(*testgroup.TestType) (*testgroup.TestType, error) Update(*testgroup.TestType) (*testgroup.TestType, error)
UpdateStatus(*testgroup.TestType) (*testgroup.TestType, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*testgroup.TestType, error) Get(name string) (*testgroup.TestType, error)
@ -78,6 +79,12 @@ func (c *testTypes) Update(testType *testgroup.TestType) (result *testgroup.Test
return return
} }
func (c *testTypes) UpdateStatus(testType *testgroup.TestType) (*testgroup.TestType, error) {
result := &testgroup.TestType{}
err := c.client.Put().Resource("testTypes").Name(testType.Name).SubResource("status").Body(testType).Do().Into(result)
return result, err
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs. // Delete takes name of the testType and deletes it. Returns an error if one occurs.
func (c *testTypes) Delete(name string, options *api.DeleteOptions) error { func (c *testTypes) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -31,6 +31,7 @@ type DaemonSetNamespacer interface {
type DaemonSetInterface interface { type DaemonSetInterface interface {
Create(*extensions.DaemonSet) (*extensions.DaemonSet, error) Create(*extensions.DaemonSet) (*extensions.DaemonSet, error)
Update(*extensions.DaemonSet) (*extensions.DaemonSet, error) Update(*extensions.DaemonSet) (*extensions.DaemonSet, error)
UpdateStatus(*extensions.DaemonSet) (*extensions.DaemonSet, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*extensions.DaemonSet, error) Get(name string) (*extensions.DaemonSet, error)
@ -78,6 +79,12 @@ func (c *daemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions
return return
} }
func (c *daemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (*extensions.DaemonSet, error) {
result := &extensions.DaemonSet{}
err := c.client.Put().Resource("daemonSets").Name(daemonSet.Name).SubResource("status").Body(daemonSet).Do().Into(result)
return result, err
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *daemonSets) Delete(name string, options *api.DeleteOptions) error { func (c *daemonSets) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -31,6 +31,7 @@ type DeploymentNamespacer interface {
type DeploymentInterface interface { type DeploymentInterface interface {
Create(*extensions.Deployment) (*extensions.Deployment, error) Create(*extensions.Deployment) (*extensions.Deployment, error)
Update(*extensions.Deployment) (*extensions.Deployment, error) Update(*extensions.Deployment) (*extensions.Deployment, error)
UpdateStatus(*extensions.Deployment) (*extensions.Deployment, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*extensions.Deployment, error) Get(name string) (*extensions.Deployment, error)
@ -78,6 +79,12 @@ func (c *deployments) Update(deployment *extensions.Deployment) (result *extensi
return return
} }
func (c *deployments) UpdateStatus(deployment *extensions.Deployment) (*extensions.Deployment, error) {
result := &extensions.Deployment{}
err := c.client.Put().Resource("deployments").Name(deployment.Name).SubResource("status").Body(deployment).Do().Into(result)
return result, err
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs. // Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *deployments) Delete(name string, options *api.DeleteOptions) error { func (c *deployments) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -31,6 +31,7 @@ type HorizontalPodAutoscalerNamespacer interface {
type HorizontalPodAutoscalerInterface interface { type HorizontalPodAutoscalerInterface interface {
Create(*extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) Create(*extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
Update(*extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) Update(*extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
UpdateStatus(*extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*extensions.HorizontalPodAutoscaler, error) Get(name string) (*extensions.HorizontalPodAutoscaler, error)
@ -78,6 +79,12 @@ func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *extensions.Ho
return return
} }
func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) {
result := &extensions.HorizontalPodAutoscaler{}
err := c.client.Put().Resource("horizontalPodAutoscalers").Name(horizontalPodAutoscaler.Name).SubResource("status").Body(horizontalPodAutoscaler).Do().Into(result)
return result, err
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error { func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -31,6 +31,7 @@ type IngressNamespacer interface {
type IngressInterface interface { type IngressInterface interface {
Create(*extensions.Ingress) (*extensions.Ingress, error) Create(*extensions.Ingress) (*extensions.Ingress, error)
Update(*extensions.Ingress) (*extensions.Ingress, error) Update(*extensions.Ingress) (*extensions.Ingress, error)
UpdateStatus(*extensions.Ingress) (*extensions.Ingress, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*extensions.Ingress, error) Get(name string) (*extensions.Ingress, error)
@ -78,6 +79,12 @@ func (c *ingresses) Update(ingress *extensions.Ingress) (result *extensions.Ingr
return return
} }
func (c *ingresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) {
result := &extensions.Ingress{}
err := c.client.Put().Resource("ingresses").Name(ingress.Name).SubResource("status").Body(ingress).Do().Into(result)
return result, err
}
// Delete takes name of the ingress and deletes it. Returns an error if one occurs. // Delete takes name of the ingress and deletes it. Returns an error if one occurs.
func (c *ingresses) Delete(name string, options *api.DeleteOptions) error { func (c *ingresses) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -31,6 +31,7 @@ type JobNamespacer interface {
type JobInterface interface { type JobInterface interface {
Create(*extensions.Job) (*extensions.Job, error) Create(*extensions.Job) (*extensions.Job, error)
Update(*extensions.Job) (*extensions.Job, error) Update(*extensions.Job) (*extensions.Job, error)
UpdateStatus(*extensions.Job) (*extensions.Job, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*extensions.Job, error) Get(name string) (*extensions.Job, error)
@ -78,6 +79,12 @@ func (c *jobs) Update(job *extensions.Job) (result *extensions.Job, err error) {
return return
} }
func (c *jobs) UpdateStatus(job *extensions.Job) (*extensions.Job, error) {
result := &extensions.Job{}
err := c.client.Put().Resource("jobs").Name(job.Name).SubResource("status").Body(job).Do().Into(result)
return result, err
}
// Delete takes name of the job and deletes it. Returns an error if one occurs. // Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(name string, options *api.DeleteOptions) error { func (c *jobs) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type NamespaceNamespacer interface {
type NamespaceInterface interface { type NamespaceInterface interface {
Create(*api.Namespace) (*api.Namespace, error) Create(*api.Namespace) (*api.Namespace, error)
Update(*api.Namespace) (*api.Namespace, error) Update(*api.Namespace) (*api.Namespace, error)
UpdateStatus(*api.Namespace) (*api.Namespace, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.Namespace, error) Get(name string) (*api.Namespace, error)
@ -77,6 +78,12 @@ func (c *namespaces) Update(namespace *api.Namespace) (result *api.Namespace, er
return return
} }
func (c *namespaces) UpdateStatus(namespace *api.Namespace) (*api.Namespace, error) {
result := &api.Namespace{}
err := c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("status").Body(namespace).Do().Into(result)
return result, err
}
// Delete takes name of the namespace and deletes it. Returns an error if one occurs. // Delete takes name of the namespace and deletes it. Returns an error if one occurs.
func (c *namespaces) Delete(name string, options *api.DeleteOptions) error { func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type NodeNamespacer interface {
type NodeInterface interface { type NodeInterface interface {
Create(*api.Node) (*api.Node, error) Create(*api.Node) (*api.Node, error)
Update(*api.Node) (*api.Node, error) Update(*api.Node) (*api.Node, error)
UpdateStatus(*api.Node) (*api.Node, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.Node, error) Get(name string) (*api.Node, error)
@ -77,6 +78,12 @@ func (c *nodes) Update(node *api.Node) (result *api.Node, err error) {
return return
} }
func (c *nodes) UpdateStatus(node *api.Node) (*api.Node, error) {
result := &api.Node{}
err := c.client.Put().Resource("nodes").Name(node.Name).SubResource("status").Body(node).Do().Into(result)
return result, err
}
// Delete takes name of the node and deletes it. Returns an error if one occurs. // Delete takes name of the node and deletes it. Returns an error if one occurs.
func (c *nodes) Delete(name string, options *api.DeleteOptions) error { func (c *nodes) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type PersistentVolumeNamespacer interface {
type PersistentVolumeInterface interface { type PersistentVolumeInterface interface {
Create(*api.PersistentVolume) (*api.PersistentVolume, error) Create(*api.PersistentVolume) (*api.PersistentVolume, error)
Update(*api.PersistentVolume) (*api.PersistentVolume, error) Update(*api.PersistentVolume) (*api.PersistentVolume, error)
UpdateStatus(*api.PersistentVolume) (*api.PersistentVolume, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.PersistentVolume, error) Get(name string) (*api.PersistentVolume, error)
@ -77,6 +78,12 @@ func (c *persistentVolumes) Update(persistentVolume *api.PersistentVolume) (resu
return return
} }
func (c *persistentVolumes) UpdateStatus(persistentVolume *api.PersistentVolume) (*api.PersistentVolume, error) {
result := &api.PersistentVolume{}
err := c.client.Put().Resource("persistentVolumes").Name(persistentVolume.Name).SubResource("status").Body(persistentVolume).Do().Into(result)
return result, err
}
// Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. // Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs.
func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) error { func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type PersistentVolumeClaimNamespacer interface {
type PersistentVolumeClaimInterface interface { type PersistentVolumeClaimInterface interface {
Create(*api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Create(*api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
Update(*api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Update(*api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
UpdateStatus(*api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.PersistentVolumeClaim, error) Get(name string) (*api.PersistentVolumeClaim, error)
@ -77,6 +78,12 @@ func (c *persistentVolumeClaims) Update(persistentVolumeClaim *api.PersistentVol
return return
} }
func (c *persistentVolumeClaims) UpdateStatus(persistentVolumeClaim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
result := &api.PersistentVolumeClaim{}
err := c.client.Put().Resource("persistentVolumeClaims").Name(persistentVolumeClaim.Name).SubResource("status").Body(persistentVolumeClaim).Do().Into(result)
return result, err
}
// Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. // Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs.
func (c *persistentVolumeClaims) Delete(name string, options *api.DeleteOptions) error { func (c *persistentVolumeClaims) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type PodNamespacer interface {
type PodInterface interface { type PodInterface interface {
Create(*api.Pod) (*api.Pod, error) Create(*api.Pod) (*api.Pod, error)
Update(*api.Pod) (*api.Pod, error) Update(*api.Pod) (*api.Pod, error)
UpdateStatus(*api.Pod) (*api.Pod, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.Pod, error) Get(name string) (*api.Pod, error)
@ -77,6 +78,12 @@ func (c *pods) Update(pod *api.Pod) (result *api.Pod, err error) {
return return
} }
func (c *pods) UpdateStatus(pod *api.Pod) (*api.Pod, error) {
result := &api.Pod{}
err := c.client.Put().Resource("pods").Name(pod.Name).SubResource("status").Body(pod).Do().Into(result)
return result, err
}
// Delete takes name of the pod and deletes it. Returns an error if one occurs. // Delete takes name of the pod and deletes it. Returns an error if one occurs.
func (c *pods) Delete(name string, options *api.DeleteOptions) error { func (c *pods) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type ReplicationControllerNamespacer interface {
type ReplicationControllerInterface interface { type ReplicationControllerInterface interface {
Create(*api.ReplicationController) (*api.ReplicationController, error) Create(*api.ReplicationController) (*api.ReplicationController, error)
Update(*api.ReplicationController) (*api.ReplicationController, error) Update(*api.ReplicationController) (*api.ReplicationController, error)
UpdateStatus(*api.ReplicationController) (*api.ReplicationController, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.ReplicationController, error) Get(name string) (*api.ReplicationController, error)
@ -77,6 +78,12 @@ func (c *replicationControllers) Update(replicationController *api.ReplicationCo
return return
} }
func (c *replicationControllers) UpdateStatus(replicationController *api.ReplicationController) (*api.ReplicationController, error) {
result := &api.ReplicationController{}
err := c.client.Put().Resource("replicationControllers").Name(replicationController.Name).SubResource("status").Body(replicationController).Do().Into(result)
return result, err
}
// Delete takes name of the replicationController and deletes it. Returns an error if one occurs. // Delete takes name of the replicationController and deletes it. Returns an error if one occurs.
func (c *replicationControllers) Delete(name string, options *api.DeleteOptions) error { func (c *replicationControllers) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type ResourceQuotaNamespacer interface {
type ResourceQuotaInterface interface { type ResourceQuotaInterface interface {
Create(*api.ResourceQuota) (*api.ResourceQuota, error) Create(*api.ResourceQuota) (*api.ResourceQuota, error)
Update(*api.ResourceQuota) (*api.ResourceQuota, error) Update(*api.ResourceQuota) (*api.ResourceQuota, error)
UpdateStatus(*api.ResourceQuota) (*api.ResourceQuota, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.ResourceQuota, error) Get(name string) (*api.ResourceQuota, error)
@ -77,6 +78,12 @@ func (c *resourceQuotas) Update(resourceQuota *api.ResourceQuota) (result *api.R
return return
} }
func (c *resourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
result := &api.ResourceQuota{}
err := c.client.Put().Resource("resourceQuotas").Name(resourceQuota.Name).SubResource("status").Body(resourceQuota).Do().Into(result)
return result, err
}
// Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs.
func (c *resourceQuotas) Delete(name string, options *api.DeleteOptions) error { func (c *resourceQuotas) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().

View File

@ -30,6 +30,7 @@ type ServiceNamespacer interface {
type ServiceInterface interface { type ServiceInterface interface {
Create(*api.Service) (*api.Service, error) Create(*api.Service) (*api.Service, error)
Update(*api.Service) (*api.Service, error) Update(*api.Service) (*api.Service, error)
UpdateStatus(*api.Service) (*api.Service, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*api.Service, error) Get(name string) (*api.Service, error)
@ -77,6 +78,12 @@ func (c *services) Update(service *api.Service) (result *api.Service, err error)
return return
} }
func (c *services) UpdateStatus(service *api.Service) (*api.Service, error) {
result := &api.Service{}
err := c.client.Put().Resource("services").Name(service.Name).SubResource("status").Body(service).Do().Into(result)
return result, err
}
// Delete takes name of the service and deletes it. Returns an error if one occurs. // Delete takes name of the service and deletes it. Returns an error if one occurs.
func (c *services) Delete(name string, options *api.DeleteOptions) error { func (c *services) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete(). return c.client.Delete().