Add VolumesAttached field to Node Status API

This commit is contained in:
saadali
2016-06-16 13:41:43 -07:00
parent a055c4e80f
commit e3e919ca20
12 changed files with 1375 additions and 218 deletions

View File

@@ -36525,7 +36525,7 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [9]bool
var yyq2 [10]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[0] = len(x.Capacity) != 0
@@ -36537,9 +36537,10 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) {
yyq2[6] = true
yyq2[7] = len(x.Images) != 0
yyq2[8] = len(x.VolumesInUse) != 0
yyq2[9] = len(x.VolumesAttached) != 0
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(9)
r.EncodeArrayStart(10)
} else {
yynn2 = 0
for _, b := range yyq2 {
@@ -36777,6 +36778,39 @@ func (x *NodeStatus) CodecEncodeSelf(e *codec1978.Encoder) {
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[9] {
if x.VolumesAttached == nil {
r.EncodeNil()
} else {
yym35 := z.EncBinary()
_ = yym35
if false {
} else {
h.encSliceAttachedVolume(([]AttachedVolume)(x.VolumesAttached), e)
}
}
} else {
r.EncodeNil()
}
} else {
if yyq2[9] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("volumesAttached"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.VolumesAttached == nil {
r.EncodeNil()
} else {
yym36 := z.EncBinary()
_ = yym36
if false {
} else {
h.encSliceAttachedVolume(([]AttachedVolume)(x.VolumesAttached), e)
}
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
@@ -36920,6 +36954,18 @@ func (x *NodeStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
h.decSliceUniqueVolumeName((*[]UniqueVolumeName)(yyv15), d)
}
}
case "volumesAttached":
if r.TryDecodeAsNil() {
x.VolumesAttached = nil
} else {
yyv17 := &x.VolumesAttached
yym18 := z.DecBinary()
_ = yym18
if false {
} else {
h.decSliceAttachedVolume((*[]AttachedVolume)(yyv17), d)
}
}
default:
z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3
@@ -36931,16 +36977,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj17 int
var yyb17 bool
var yyhl17 bool = l >= 0
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
var yyj19 int
var yyb19 bool
var yyhl19 bool = l >= 0
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -36948,16 +36994,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Capacity = nil
} else {
yyv18 := &x.Capacity
yyv18.CodecDecodeSelf(d)
yyv20 := &x.Capacity
yyv20.CodecDecodeSelf(d)
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -36965,16 +37011,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Allocatable = nil
} else {
yyv19 := &x.Allocatable
yyv19.CodecDecodeSelf(d)
yyv21 := &x.Allocatable
yyv21.CodecDecodeSelf(d)
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -36984,13 +37030,13 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} else {
x.Phase = NodePhase(r.DecodeString())
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -36998,21 +37044,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Conditions = nil
} else {
yyv21 := &x.Conditions
yym22 := z.DecBinary()
_ = yym22
yyv23 := &x.Conditions
yym24 := z.DecBinary()
_ = yym24
if false {
} else {
h.decSliceNodeCondition((*[]NodeCondition)(yyv21), d)
h.decSliceNodeCondition((*[]NodeCondition)(yyv23), d)
}
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -37020,21 +37066,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Addresses = nil
} else {
yyv23 := &x.Addresses
yym24 := z.DecBinary()
_ = yym24
yyv25 := &x.Addresses
yym26 := z.DecBinary()
_ = yym26
if false {
} else {
h.decSliceNodeAddress((*[]NodeAddress)(yyv23), d)
h.decSliceNodeAddress((*[]NodeAddress)(yyv25), d)
}
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -37042,16 +37088,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.DaemonEndpoints = NodeDaemonEndpoints{}
} else {
yyv25 := &x.DaemonEndpoints
yyv25.CodecDecodeSelf(d)
yyv27 := &x.DaemonEndpoints
yyv27.CodecDecodeSelf(d)
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -37059,16 +37105,16 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.NodeInfo = NodeSystemInfo{}
} else {
yyv26 := &x.NodeInfo
yyv26.CodecDecodeSelf(d)
yyv28 := &x.NodeInfo
yyv28.CodecDecodeSelf(d)
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -37076,21 +37122,21 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Images = nil
} else {
yyv27 := &x.Images
yym28 := z.DecBinary()
_ = yym28
yyv29 := &x.Images
yym30 := z.DecBinary()
_ = yym30
if false {
} else {
h.decSliceContainerImage((*[]ContainerImage)(yyv27), d)
h.decSliceContainerImage((*[]ContainerImage)(yyv29), d)
}
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -37098,26 +37144,48 @@ func (x *NodeStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.VolumesInUse = nil
} else {
yyv29 := &x.VolumesInUse
yym30 := z.DecBinary()
_ = yym30
yyv31 := &x.VolumesInUse
yym32 := z.DecBinary()
_ = yym32
if false {
} else {
h.decSliceUniqueVolumeName((*[]UniqueVolumeName)(yyv29), d)
h.decSliceUniqueVolumeName((*[]UniqueVolumeName)(yyv31), d)
}
}
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb19 = r.CheckBreak()
}
if yyb19 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.VolumesAttached = nil
} else {
yyv33 := &x.VolumesAttached
yym34 := z.DecBinary()
_ = yym34
if false {
} else {
h.decSliceAttachedVolume((*[]AttachedVolume)(yyv33), d)
}
}
for {
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
yyj19++
if yyhl19 {
yyb19 = yyj19 > l
} else {
yyb17 = r.CheckBreak()
yyb19 = r.CheckBreak()
}
if yyb17 {
if yyb19 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj17-1, "")
z.DecStructFieldNotFound(yyj19-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
@@ -37148,6 +37216,199 @@ func (x *UniqueVolumeName) CodecDecodeSelf(d *codec1978.Decoder) {
}
}
func (x *AttachedVolume) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
if x == nil {
r.EncodeNil()
} else {
yym1 := z.EncBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.EncExt(x) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [2]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(2)
} else {
yynn2 = 2
for _, b := range yyq2 {
if b {
yynn2++
}
}
r.EncodeMapStart(yynn2)
yynn2 = 0
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
x.Name.CodecEncodeSelf(e)
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("name"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
x.Name.CodecEncodeSelf(e)
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yym7 := z.EncBinary()
_ = yym7
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.DevicePath))
}
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("devicePath"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym8 := z.EncBinary()
_ = yym8
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.DevicePath))
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
}
}
}
}
func (x *AttachedVolume) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yym1 := z.DecBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.DecExt(x) {
} else {
yyct2 := r.ContainerType()
if yyct2 == codecSelferValueTypeMap1234 {
yyl2 := r.ReadMapStart()
if yyl2 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else {
x.codecDecodeSelfFromMap(yyl2, d)
}
} else if yyct2 == codecSelferValueTypeArray1234 {
yyl2 := r.ReadArrayStart()
if yyl2 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
x.codecDecodeSelfFromArray(yyl2, d)
}
} else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
}
}
}
func (x *AttachedVolume) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yys3Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys3Slc
var yyhl3 bool = l >= 0
for yyj3 := 0; ; yyj3++ {
if yyhl3 {
if yyj3 >= l {
break
}
} else {
if r.CheckBreak() {
break
}
}
z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys3Slc = r.DecodeBytes(yys3Slc, true, true)
yys3 := string(yys3Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys3 {
case "name":
if r.TryDecodeAsNil() {
x.Name = ""
} else {
x.Name = UniqueVolumeName(r.DecodeString())
}
case "devicePath":
if r.TryDecodeAsNil() {
x.DevicePath = ""
} else {
x.DevicePath = string(r.DecodeString())
}
default:
z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3
} // end for yyj3
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
}
func (x *AttachedVolume) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj6 int
var yyb6 bool
var yyhl6 bool = l >= 0
yyj6++
if yyhl6 {
yyb6 = yyj6 > l
} else {
yyb6 = r.CheckBreak()
}
if yyb6 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Name = ""
} else {
x.Name = UniqueVolumeName(r.DecodeString())
}
yyj6++
if yyhl6 {
yyb6 = yyj6 > l
} else {
yyb6 = r.CheckBreak()
}
if yyb6 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.DevicePath = ""
} else {
x.DevicePath = string(r.DecodeString())
}
for {
yyj6++
if yyhl6 {
yyb6 = yyj6 > l
} else {
yyb6 = r.CheckBreak()
}
if yyb6 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj6-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x *ContainerImage) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
@@ -57477,6 +57738,125 @@ func (x codecSelfer1234) decSliceUniqueVolumeName(v *[]UniqueVolumeName, d *code
}
}
func (x codecSelfer1234) encSliceAttachedVolume(v []AttachedVolume, e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
r.EncodeArrayStart(len(v))
for _, yyv1 := range v {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yy2 := &yyv1
yy2.CodecEncodeSelf(e)
}
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x codecSelfer1234) decSliceAttachedVolume(v *[]AttachedVolume, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yyv1 := *v
yyh1, yyl1 := z.DecSliceHelperStart()
var yyc1 bool
_ = yyc1
if yyl1 == 0 {
if yyv1 == nil {
yyv1 = []AttachedVolume{}
yyc1 = true
} else if len(yyv1) != 0 {
yyv1 = yyv1[:0]
yyc1 = true
}
} else if yyl1 > 0 {
var yyrr1, yyrl1 int
var yyrt1 bool
_, _ = yyrl1, yyrt1
yyrr1 = yyl1 // len(yyv1)
if yyl1 > cap(yyv1) {
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 32)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
} else {
yyv1 = make([]AttachedVolume, yyrl1)
}
} else {
yyv1 = make([]AttachedVolume, yyrl1)
}
yyc1 = true
yyrr1 = len(yyv1)
if yyrg1 {
copy(yyv1, yyv21)
}
} else if yyl1 != len(yyv1) {
yyv1 = yyv1[:yyl1]
yyc1 = true
}
yyj1 := 0
for ; yyj1 < yyrr1; yyj1++ {
yyh1.ElemContainerState(yyj1)
if r.TryDecodeAsNil() {
yyv1[yyj1] = AttachedVolume{}
} else {
yyv2 := &yyv1[yyj1]
yyv2.CodecDecodeSelf(d)
}
}
if yyrt1 {
for ; yyj1 < yyl1; yyj1++ {
yyv1 = append(yyv1, AttachedVolume{})
yyh1.ElemContainerState(yyj1)
if r.TryDecodeAsNil() {
yyv1[yyj1] = AttachedVolume{}
} else {
yyv3 := &yyv1[yyj1]
yyv3.CodecDecodeSelf(d)
}
}
}
} else {
yyj1 := 0
for ; !r.CheckBreak(); yyj1++ {
if yyj1 >= len(yyv1) {
yyv1 = append(yyv1, AttachedVolume{}) // var yyz1 AttachedVolume
yyc1 = true
}
yyh1.ElemContainerState(yyj1)
if yyj1 < len(yyv1) {
if r.TryDecodeAsNil() {
yyv1[yyj1] = AttachedVolume{}
} else {
yyv4 := &yyv1[yyj1]
yyv4.CodecDecodeSelf(d)
}
} else {
z.DecSwallow()
}
}
if yyj1 < len(yyv1) {
yyv1 = yyv1[:yyj1]
yyc1 = true
} else if yyj1 == 0 && yyv1 == nil {
yyv1 = []AttachedVolume{}
yyc1 = true
}
}
yyh1.End()
if yyc1 {
*v = yyv1
}
}
func (x codecSelfer1234) encResourceList(v ResourceList, e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
@@ -57630,7 +58010,7 @@ func (x codecSelfer1234) decSliceNode(v *[]Node, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 592)
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 616)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]